Commit Graph

2004 Commits

Author SHA1 Message Date
Robert Osfield
0a4bf71fbb Updated version number after dev release 2013-06-21 19:35:56 +00:00
Robert Osfield
15fea448d8 Added new osg::Array::Binding parameter to osg::Geometry::set*Array(osg::Array* array, osg::Array::Binding binding=osg::Array::BIND_UNDEFINED) methods to make it easier for the user
to set the binding without the need to call the deprecated osg::Geometry::set*Binding(osg::Geometry::AttributeBinding)
2013-06-21 09:43:15 +00:00
Robert Osfield
df075ef9bb Cleaned up usage of BIND_PER_PRIMITIVE where possible. 2013-06-19 16:24:59 +00:00
Robert Osfield
c8fa3244c2 From Jan Ciger, "I have found a problem when building OSG with Qt 5 support. Qt has the
following in the qopengl.h header:

# include <QtGui/qopengles2ext.h>
# ifndef GL_DOUBLE
#  define GL_DOUBLE GL_FLOAT
# endif
# ifndef GLdouble
typedef GLfloat GLdouble;
# endif

Unfortunately, when building for normal OpenGL (not GL/ES!) on Windows
with MSVC2012, GLdouble is not defined (it is not a macro but typedef)
and the code above produces a conflicting definition, making the
compile fail. I am attaching a bit hackish workaround for this problem
in osg/GL "
2013-06-19 12:19:28 +00:00
Robert Osfield
635993038a Changed header guard back to original, and removed deprecated enum 2013-06-18 14:52:26 +00:00
Robert Osfield
390316e579 Removed experiment GeometryNew as it's no longer required. 2013-06-18 11:49:03 +00:00
Robert Osfield
7d40c7258f Clean up up osg::Geometry, removing long deprecated support for array indices and BIND_PER_PRIMITIVE binding that forced OpenGL slow paths. osg::Geometry is now smaller and only supports OpenGL fasts paths.
New methods osg::Geometry::containsDeprecatedData() and osg::Geometry::fixDeprecatedData() provide a means for converting geometries that still use the array indices and BIND_PER_PRIMITIVE across to complient
versions.

Cleaned up the rest of the OSG where use of array indices and BIND_PER_PRIMITIVE were accessed or used.
2013-06-18 11:18:28 +00:00
Robert Osfield
1a7f2fcb3e Introduced new osg::PatchParameter StateAttribute class to wrap up glPatchParameter associated state.
Note, osg::Program::setParameter(GL_PATCH_VERTICES,num); is nolonger support and should be replaced by using the new PatchParameter class.
2013-06-11 10:52:37 +00:00
Robert Osfield
8cf9600e2c Fixed remove and add callback so they properly handle nested callbacks 2013-06-10 10:37:08 +00:00
Robert Osfield
49cfece9d4 Reorder member variables to ensure better packing in memory. 2013-06-05 07:55:05 +00:00
Robert Osfield
4f1e6b28e8 Moved the Array::AttribDivisor into the Array::Binding enum to avoid conflicts in settings between Binding and AttribDivisor.
Removed the vertify bindings/shared arrays handling from GeometryNew
2013-06-05 07:27:35 +00:00
Robert Osfield
eb693f6a92 Updates to GeometryNew, Array and ArraDispatchers to clean up GeometryNew so that is no longer uses ArrayData. 2013-06-04 19:04:26 +00:00
Robert Osfield
cbea97009c Added s/getNormalize(), s/getPreserveDataType(), s/getAttribDivisor() and s/getBinding() to osg::Array base class in preperation for refactor of osg::Geometry and introduction of new features. 2013-06-04 14:55:57 +00:00
Robert Osfield
caa3a06c70 Introduced GeometryNew which is a cleaned up version of Geometry that removes support for array indices.
GeometryNew is only temporary and will be renamed to Geometry on the completion of refactoring work and feedback from community.
Ported osggeometry across to use GeometryNew.
2013-06-04 09:32:59 +00:00
Robert Osfield
2dc53ceabb From Aurelien Albert, Added support for texture swizzle. 2013-06-03 15:10:53 +00:00
Robert Osfield
9b67578c47 Updated version and so_version in prep for 3.1.8 developer release 2013-06-03 14:38:23 +00:00
Robert Osfield
4697b3c68b From Art Tevs, int and uint Vec classes 2013-06-03 11:38:20 +00:00
Robert Osfield
efe52842fa From Aurelien Albert, "This submission is made against trunk version and add the loading of "glVertexAttribDivisor" extension." 2013-06-03 09:19:46 +00:00
Robert Osfield
47f574429a From Marcin Prus and Robert Osfield, moved the key parts of the .dds plugins computeRowWidthInBytes implementation into the osg::Image::computeImageSizeInBytes(..) to
address bugs in the computation of image size.
2013-05-28 14:14:45 +00:00
Robert Osfield
18c37d14cd Moved quad buffer definitions into include/osg/Camera 2013-05-27 08:10:42 +00:00
Robert Osfield
1284a0dd40 From Pawel Ksiezopolski, first email: "This submission adds texture buffer object ( defined in GL_ARB_texture_buffer_object extension ) to the osg::Texture* family.
TextureBuffer objects may use osg::Texture::bindToImageUnit(), so GLSL shaders are able to use not only texelFetch() function , but also functions defined in GL_ARB_shader_image_load_store extension : imageLoad(), imageStore(), imageAtomicAdd() etc."

second email: "After a while I found that osg::Texture::applyTexParameters() used with TextureBuffer may cause some OpenGL errors ( applying texture filters and wraps to TextureBuffer makes no sense ) so I fixed it."
2013-05-22 12:49:46 +00:00
Robert Osfield
c238a7cca2 From Michael Kapelko, "The provided patch (against SVN revision 13380) adds missing constness to returning calls (without it the user code does not compile)." 2013-05-14 16:18:41 +00:00
Robert Osfield
1a683e2f83 From Ulrich Hertlein, "Attached is a patch that introduces 'static_cast<unsigned int>' on some instances where
the code returns '.size()' of a std::vector.  This caused some warnings when using clang++
on OS X."
2013-05-14 16:12:21 +00:00
Robert Osfield
f1d5ba4278 Updated version after dev release 2013-05-14 13:34:54 +00:00
Robert Osfield
9402efe38e Added DisplaySettings::KeystoneHint flag that can be set via --keystone-on and --keystone-off command line parameters, and the OSG_KEYSTONE env var 2013-05-10 17:59:07 +00:00
Robert Osfield
e545627571 Moved Keystone class into osgViewer library. 2013-05-09 15:18:14 +00:00
Robert Osfield
34a6b38983 Preperation for adding stereo support direclty into osgViewer. 2013-04-15 14:21:32 +00:00
Robert Osfield
dd8d7c2839 Updated developer release number 2013-03-21 16:42:09 +00:00
Robert Osfield
ed35a0a07a Added check against isVertexBufferObjectSupported() in set*Pointer() methods 2013-03-21 16:22:30 +00:00
Robert Osfield
68fdae5761 From Lukasz Izdebski,"added support for gl_SampleMaski." 2013-02-13 16:29:03 +00:00
Robert Osfield
63cd217c77 From Jordi Torres, Android build fix 2013-02-12 15:44:52 +00:00
Robert Osfield
2700c9d5e5 Updated SO version in prep for serialization foramt change 2013-02-07 11:08:34 +00:00
Robert Osfield
00c7e5e552 From Aurelien Albert, "This line,I use the "useVertexAttributeAliasing" mode in my application, and color arrays are not normalized, so shaders get [0.0-255.0] values instead of [0.0-1.0] values.
This patch fix this."

and those below, will be ignored
----

M    include/osg/State
2013-02-06 14:50:37 +00:00
Robert Osfield
19bfa92c91 Simplified include/osg/Math to use Standard C++ maths headers - <cmath> and <cfloat> 2013-02-06 12:02:05 +00:00
Robert Osfield
5297502a38 Updated version number after 3.1.4 developer release 2013-02-04 14:42:44 +00:00
Robert Osfield
6ec15736cd Standardized use of GL_HALF_FLOAT_NV and GL_HALF_FLOAT_ARB to GL_HALF_FLOAT 2013-01-31 16:26:06 +00:00
Robert Osfield
45585b78fb From Laurens Voerman, "I have implemented and tested (on windows only) your suggestion for resetCullingMask(), it's far less intrusive than my previous submission.
attached are the changes to current svn (28 Jan 2013 / rev :13312).
"
2013-01-28 14:30:21 +00:00
Robert Osfield
26a8f63212 From Wang Rui, "In the attached files I've added the Compute Shader support for OSG, as well as serializer updates and a new osgcomputeshaders example. My submission also include a setComputeGroups() function in Program for setting compute-shader work groups, and a bindToImageUnit() function in Texture for binding textures as image variables in shaders.
All code are tested on Windows 7 + NVIDIA GFX 570 with the latest GeForce 310.70 Driver (BETA), which could support OpenGL 4.3.

Compute shader information can be found at "http://www.opengl.org/registry/specs/ARB/compute_shader.txt"
"
2013-01-25 11:54:03 +00:00
Robert Osfield
f6450a1123 From Lukasz Izdebski, "Adding this GL mode makes possibly to use this GL Modes (added in core OpenGL 3.2) in Windows." 2013-01-25 11:08:32 +00:00
Robert Osfield
5aa1234fa4 Fixed usage of META_NodeVisitor so it doesn't include "" 2013-01-24 18:48:34 +00:00
Robert Osfield
0b1605ed08 From Wang Rui with edits from Robert Osfield, additional GLenums for cross platform build 2013-01-23 16:22:45 +00:00
Robert Osfield
83f9d0f3e6 Added Options support to ImageSequence LOAD_* functionality 2013-01-18 17:11:49 +00:00
Robert Osfield
5fb8cd6a9c Update SO_VERSION to reflect new API changes 2013-01-18 16:30:55 +00:00
Robert Osfield
a0980734ac Added LOAD_AND_RETAIN_IN_UPDATE_TRAVERSAL and LOAD_AND_DISCARD_IN_UPDATE_TRAVERSAL ImageSequence::Mode's to allow for ImageSequence usage without using background paging threads, instead loading all the images on demand in the update traversal. 2013-01-18 16:21:17 +00:00
Robert Osfield
4a0ce866c0 Updated SO version 2012-12-14 16:30:28 +00:00
Robert Osfield
32c0bc3b39 From Lionel Lagarde, "Here is a correction on the PixelBufferObject getter methods of Image.
The set method modify the buffer object of the BufferData while the get method returned the buffer object of the Image.

I've also removed the _bufferObject member of Image (not used anymore)."
--This line, Lionel Lagardeand those below, will be ignored--

M    include/osg/Image
2012-12-13 17:35:27 +00:00
Robert Osfield
e64d5e5eca Added template swapBytes method 2012-12-07 19:04:49 +00:00
Robert Osfield
5a88734598 Moved the expansion of the key codes into ApplicationUsage so that help is only generated for non zero keycodes. 2012-12-05 10:13:51 +00:00
Robert Osfield
e4a42fa65c Fixed error in Unfiform set method 2012-12-03 09:50:41 +00:00
Robert Osfield
8b30807ef1 From Paul Martz, build fixes 2012-11-19 11:25:52 +00:00
Robert Osfield
933baf5db4 Changed COLOUR to COLOR to be consistent with OpenGL spelling 2012-11-13 13:32:01 +00:00
Robert Osfield
92975a01fd Moved colour space conversion of volumes from the osgvolume example into osg/ImageUtils and added support for colorSpaceConversion="MODULATE_ALPHA_BY_LUMINANCE","MODULATE_ALPHA_BY_COLOUR","REPLACE_ALPHA_WITH_LUMINANCE" and "REPLACE_RGB_WITH_LUMINANCE" to .p3d <volume> tag 2012-11-13 13:16:10 +00:00
Robert Osfield
014f13f774 Refactored ImageSequence to better handle random access usage. 2012-11-08 11:19:31 +00:00
Robert Osfield
f9fd4342ba From Stephan Huber, "attached you'll find the latest versions of the QTKit + the AVFoundation-plugin, some changes to osgPresentation and a small enhancement für ImageIO.
I fixed some bugs and did some more tests with both of the video-plugins. I integrated CoreVideo with osgPresentation, ImageStream has a new virtual method called createSuitableTexture which returns NULL for default implementations. Specialized implementations like the QTKit-plugin return a CoreVideo-texture. I refactored the code in SlideShowConstructor::createTexturedQuad to use a texture returned from ImageStream::createSuitableTexture.

I did not use osgDB::readObjectFile to get the texture-object, as a lot of image-related code in SlideShowConstructor had to be refactored to use a texture.  My changes are minimal and should not break existing code.

There's one minor issue with CoreVideo in general: As the implementation is asynchronous, there might be no texture available, when first showing the video the first frame. I am a bit unsure how to tackle this problem, any input on this is appreciated.

Back to the AVFoundation-plugin: the current implementation does not support CoreVideo as the QTKit-plugin supports it. There's no way to get decoded frames from AVFoundation stored on the GPU, which is kind of sad. I added some support for CoreVideo to transfer decoded frames back to the GPU, but in my testings the performance was worse than using the normal approach using glTexSubImage. This is why I disabled CoreVideo for AVFoundation. You can still request a CoreVideoTexture via readObjectFile, though.
"
2012-10-24 10:43:01 +00:00
Robert Osfield
1796d55bea From Stephan Huber, OSX and iOS Video support via a QTKit plugin from OSX 10.7 and before, and an AVFoundation plugin for iOS and OSX10.8 and later. 2012-10-02 14:07:12 +00:00
Robert Osfield
03047f3e7f From Paul Martz, "This change to include/osg/GL correctly includes the OpenGL header on OSX 10.7 when building OSG trunk for GL3. It also adds some CPP defines for compatibility." 2012-09-26 08:42:04 +00:00
Robert Osfield
b3f8679b69 From Luc Frauciel, Added sRGB FrameBuffer string 2012-09-20 14:03:47 +00:00
Robert Osfield
01c7d87b1a From Farshid Lashkari, Added GLBeginEndAdapter::reset(), and _overallNormalAssigned, _overallColorAssigned flags to avoid the GLBeginEndAdapter adapter setting colour and normals when none has been assigned. 2012-09-20 11:18:19 +00:00
Robert Osfield
7fe5db073b Updated version after 3.1.3 dev release 2012-09-10 08:24:49 +00:00
Robert Osfield
f288f9e996 From Wojciech Lewandowski, "With current trunk I had an error while compiling osg/Image.cpp for IOS simulator / GLES2. Symbol GL_RGBA16 was missing. Adding #define GL_RGBA16 0x805B to Image header solves the problem. " 2012-09-07 14:55:09 +00:00
Robert Osfield
39dcea9ebb From Colin McDonald and Robert Osfield, converted Traits::sharedContext from GraphicsContext* to osg:observer_ptr<GraphicsContext> to prevent dangling pointer issues. 2012-09-05 21:03:41 +00:00
Robert Osfield
f5a3c40934 Moved the OSG_INIT_SINGLETON_PROXY macro into include/osg/Object to make it more generally useful and added it's usage into the RenderBinPrototypeList initialization. 2012-09-05 13:48:23 +00:00
Robert Osfield
fd2ee19b62 Updated SO version number to avoid collision with new additions to serializers 2012-09-05 09:30:33 +00:00
Robert Osfield
bc533022ae Added deprecated note to indices entry. 2012-09-05 08:42:14 +00:00
Robert Osfield
30c35cb407 Adjusted the #define's to help GLES2 build 2012-09-03 09:08:16 +00:00
Robert Osfield
583401970a Fixed typo 2012-08-22 16:39:47 +00:00
Robert Osfield
0a746faa2d Introduced Texture::Extensions::s/getPreferGenerateMipmapSGISForPowerOfTwo() flag that defaults to false for Radeon, true elsewhere.
This is used to workaround mipmapping bugs with ATI/AMD cards.
2012-07-12 16:41:53 +00:00
Robert Osfield
476dbf1c33 Fixed for including cmath before osg/Math. 2012-05-02 13:58:34 +00:00
Robert Osfield
d32160abde Added using base_class::set to the Matrix*Template class to enable the set() method from the base class to be used. 2012-04-27 09:43:25 +00:00
Robert Osfield
de05dd22a8 Restructed how the GL_SAMPLER_* #define's are placed to avoid build problems under GLES. 2012-04-19 14:58:35 +00:00
Robert Osfield
9f93b005cc From David Callu, "Here the fix for Matrix{2,3,4}x{2,3,4}{fd} defined in Uniform header.
My previous patch for Atomic Counter Uniform provide new template implementation
of Matrix{2,3,4}x{2,3,4}{fd}. This new implementation use Column-Major Matrix.
Original code define matrix as Row-Major matrix like other Matrix in OSG, and
my matrix implementation break compatibility with previous code.
For example osg_normalMatrix define in osg::State report by Roland Hill.
Thanks to Paul Martz to spot me when the bug appear."
2012-04-19 10:27:58 +00:00
Robert Osfield
01beb82041 From Mathias Froehlich, "Attached is a change to the slow path geometry dispatch tables that allows the
use of 3 component float color vectors."
2012-04-18 09:56:00 +00:00
Robert Osfield
b882467217 Updated version number 2012-04-18 09:50:23 +00:00
Robert Osfield
95cac0b549 From Ulrich Hertlein, Fix for MatrixTemplate compile errors 2012-04-06 10:42:17 +00:00
Robert Osfield
c0bd5cda99 From Magnus Kessler, typo and documentation fixes 2012-03-29 15:08:15 +00:00
Robert Osfield
68412a1784 From Magnus Kessler, "remove unecessary conversion from float in double precision method" 2012-03-29 09:57:47 +00:00
Robert Osfield
aab27e106c From David Callu, "Here an update of osg::Uniform :
- add non square matrix
- add double
- add all uniform type available in OpenGL 4.2
- backward compatibility for Matrixd to set/get an float uniform matrix
- update of IVE / Wrapper ReadWriter

implementation of AtomicCounterBuffer based on BufferIndexBinding

add example that use AtomicCounterBuffer and show rendering order of fragments,
original idea from geeks3d.com."
2012-03-29 09:43:12 +00:00
Robert Osfield
59d6931b59 Added int packing parameter to Image::readPixels(..) 2012-03-29 08:27:21 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
1e35f8975d For all OSG_GL*_FEATURE #defines changed 1's to true and 0's to false. 2012-03-21 16:02:32 +00:00
Robert Osfield
c3a0a8ddc3 Added Traits::getContextVersion(uint,uint) 2012-03-21 11:36:54 +00:00
Robert Osfield
cee53f6adc Updated version number 2012-03-21 11:26:09 +00:00
Robert Osfield
fc6fdeaa2c Updated version number for 3.1.1 dev release 2012-03-08 16:33:44 +00:00
Robert Osfield
fef2628d00 From Farshid Lashkari, "I've added support for reading contents of cubemap textures to the osg::Image::readImageFromCurrentTexture method. I added a new parameter to the method for specifying which face of the cubemap to read." 2012-03-08 16:05:17 +00:00
Robert Osfield
2c7b82b401 From David Callu, "I found a bug in osg::Program.
in osg::Program::PerContextProgram :

typedef std::vector<UniformModifiedCountPair> LastAppliedUniformList;
should be
typedef std::map<unsigned int, UniformModifiedCountPair> LastAppliedUniformList;

Intel driver can use index uniform value > 200000.
With a std::vector, this index uniform value generate an out of memory error

Nothing in OpenGL or GLSL specification define index uniform value rules.
And all other implementation that deal with uniform index in osg::Program
use a std::map.
This fix could have a little performance impact but this is the cost
to pay to work with
all driver."
2012-03-01 10:38:28 +00:00
Robert Osfield
2907284d00 Removed redudent spaces at ends of lines 2012-03-01 10:14:55 +00:00
Robert Osfield
84ca21655e Added build problem with using float Matrix. 2012-02-28 11:37:09 +00:00
Robert Osfield
48b9b25805 From Johannes Baeurele, "The osg::Image class now contains a 'supportsTextureSubloading()' method that is used inside the Texture2D::apply method. For now it only checks for the etc1 format in which case it returns 'false'. All other formats lead to a return value of 'true'.
Without the change the application does not work properly. First I get the notification that an OpenGL error occured. After some more of this error messages I see broken textures on the screen. With the changes attached to this message my application works as intended."

Note from Robert Osfield, changed the Image::supportsTextureSubloading() to be const and to be implemented in the .cpp rather than inline.
2012-02-20 12:03:14 +00:00
Robert Osfield
bd81dd5ff8 From Stephan Huber, attached you'll find a compile fix for the new introduced rowlength-feature on IOS/OpenGL ES builds 2012-02-10 15:57:51 +00:00
Robert Osfield
db49c23944 From Brad Christiansen, "The attached files add the ability to control when a paged child becomes eligible for expiry based on time and/or elapsed frames.
I found that some of the items that had been paged in were being expired on the first frame that they were not visible (as the cache was full). This resulted in excessive paging every time the view was moved. With the following changes I could only allow children to be expired if they had not been used for e.g. 30 seconds or 60 frames."
2012-02-06 12:06:40 +00:00
Robert Osfield
68f776e2cc From Paulk Martz, "Looks like the ClipNode::setReferenceFrame comment block came from LightSource. Fixing the comment block to refer to ClipNode instead of light source." 2012-01-24 17:40:31 +00:00
Robert Osfield
6d66e1abaa Added support for using GL_UNPACK_ROW_LENGTH in conjunction with texture's + osg::Image via new RowLength
parameter in osg::Image.  To support this Image::setData(..) now has a new optional rowLength parameter which
defaults to 0, which provides the original behaviour, Image::setRowLength(int) and int Image::getRowLength() are also provided.

With the introduction of RowLength support in osg::Image it is now possible to create a sub image where
the t size of the image are smaller than the row length, useful for when you have a large image on the CPU
and which to use a small portion of it on the GPU.  However, when these sub images are created the data
within the image is no longer contiguous so data access can no longer assume that all the data is in
one block.  The new method Image::isDataContiguous() enables the user to check whether the data is contiguous,
and if not one can either access the data row by row using Image::data(column,row,image) accessor, or use the
new Image::DataIterator for stepping through each block on memory assocatied with the image.

To support the possibility of non contiguous osg::Image usage of image objects has had to be updated to
check DataContiguous and handle the case or use access via the DataIerator or by row by row.  To achieve
this a relatively large number of files has had to be modified, in particular the texture classes and
image plugins that doing writing.
2012-01-24 14:34:02 +00:00
Robert Osfield
4e834dfc73 From Brad Christiansen, "Attached are some small changes to the ImageStream interface and the DirectShow and FFMPEG plugins to provide the current time being displayed in the image stream.
I don’t have access to an OSX or Linux dev machine to make the changes required to the quick time plugin. This plugin will just default to returning 0."
2011-12-23 16:27:25 +00:00
Robert Osfield
f6ace4a7d0 From Ulrich Hertlein, typo fixes 2011-12-23 16:14:51 +00:00
Robert Osfield
c86e2361d2 Moved the createSpotLightImage function into include/osg/ImageUtils 2011-12-19 09:37:57 +00:00
Robert Osfield
a548daa4be Added a check against OSX 10.6 to enable better selection of when to provide custom cosf etc. definition.
This change has been introduced to address recurcsion problems in 10.7 in the ac3d plugin.
2011-11-07 14:36:50 +00:00
Robert Osfield
9e903861a2 Fixed handling of Vec3dArray in GLBeginEdnAdapter/ArrayDispatchers. 2011-10-21 15:39:51 +00:00
Robert Osfield
d3cebab9a3 Added flipDepth() method 2011-10-21 10:59:42 +00:00
Robert Osfield
8a230d42ed From Luc Frauciel, "You'll find attached a new option that allow, when using LOD in USER_DEFINED_CENTER mode to expand the radius of the node by the radius of loaded objets.
Motivation ;
When using PagedLODs, you don't always know the real size of loaded children,
If it occurs that they  are out of predefined bounds, picking on the parts that are out of bound will fail
They also can be culled out too soon.
The problem often  occurs with long object (roads).
I've modified LOD and ProxyNode to include this option."

and later email:

"Attached the UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED version
There are impacts on some serializers (dae, osgWrapper).
I haven't modified deprecated osg, since it's deprecated"
2011-09-19 10:34:31 +00:00
Robert Osfield
420d8f6acf Added missing forward declaration 2011-09-14 10:22:04 +00:00