Commit Graph

1901 Commits

Author SHA1 Message Date
Robert Osfield
a5478cf910 From Nico Kruithof, "There is a small typo in the ShapeDrawable code for a sphere. There was a gl.Begin(GL_QUAD_STRIP) that was never closed, nor used.
"
2012-09-05 10:19:01 +00:00
Robert Osfield
5c9a302beb Added GL_RGBA8 and GL_RGBA16 entries to the Image::computePixelFormat() and improved he readability of the method by inserting line spacing. 2012-09-05 09:08:25 +00:00
Robert Osfield
e489767f71 Fixed bug in GLBufferObjectSet::discardAllDeletedGLBufferObjects() and GLBufferObjectSet::flushDeletedGLBufferObjects(double currentTime, double& availableTime)
where the NumberActiveGLBufferObjects was errneously being incremented by numDiscarded.

M    osg/BufferObject.cpp
2012-08-23 15:06:27 +00:00
Robert Osfield
42cb311f41 Added FireGL to prefernce list for use glGenerateMipMap 2012-07-24 09:05:04 +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
a821a1cbbc Restructed the way that the global notify variables are initialized to avoid problems with multi-threaded initialization of these variables. 2012-06-22 16:21:08 +00:00
Robert Osfield
c1a3ab2a5b Commented out the disabling of use of PBO's in ImageStream, and disabled the use ClientStoreHint in Present3D. 2012-06-12 10:31:50 +00:00
Robert Osfield
9045813aab Added missing getUniformBlocks implmentation 2012-04-19 10:10:26 +00:00
Robert Osfield
97e4ad473b Refactored the handling of GLES adaptations of the 1,2,3,4 internal formats and added handling of GL_RGB8_OES and GL_RGBA8_OES. 2012-04-18 10:16:09 +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
96effb3690 From Martin Naylor, "Please find attached a fix for the STD library(tested under Windowsx64
VS2008) when atomiccounter is found but not used."
2012-04-06 11:29:29 +00:00
Robert Osfield
95cac0b549 From Ulrich Hertlein, Fix for MatrixTemplate compile errors 2012-04-06 10:42:17 +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
c3a0a8ddc3 Added Traits::getContextVersion(uint,uint) 2012-03-21 11:36:54 +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
84ca21655e Added build problem with using float Matrix. 2012-02-28 11:37:09 +00:00
Robert Osfield
67ce0d5244 Fixed erroneous use #if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES) which should have been #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) 2012-02-21 10:38:12 +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
4457d2a145 From Colin McDonald, "Upgrading to OpenSceneGraph 3.0.1, texture mip mapping stopped
working on some junk low-end graphics cards which I still have to
support.  They worked ok with osg 2.8 and earlier.

The problem turned out to be with gl proxy textures, which are
unreliable on those devices.  Proxy textures are used by the glu
mipmap build routines to determine if a texture size is
supported. The external glu library had a nice fallback
behaviour, so that if proxy textures didn't work then the mipmap
texture was still created.  But in the work on the new embedded
glu routines that fallback behaviour has been inadvertently
lost.  I have restored the fallback in
src/osg/glu/libutil/mipmap.cpp.  It doesn't add any extra
complexity."
2012-02-10 17:20:43 +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
5743d30dc1 From Olaf Flebbe, "there are two ocurrences where pointer to bool is mixed with bool. Fixes warnings on MacOSX with llvm.
diff --git a/src/osg/State.cpp b/src/osg/State.cpp
index 0b88d63..2137bbd 100644
--- a/src/osg/State.cpp
+++ b/src/osg/State.cpp
@@ -109,7 +109,7 @@ State::State():
        }
    }

-    _abortRenderingPtr = false;
+    _abortRenderingPtr = NULL;

    _checkGLErrors = ONCE_PER_FRAME;

@@ -689,7 +689,7 @@ bool State::getLastAppliedTextureMode(unsigned int unit,Stat

 const StateAttribute* State::getLastAppliedTextureAttribute(unsigned int unit,S
 {
-    if (unit>=_textureAttributeMapList.size()) return false;
+    if (unit>=_textureAttributeMapList.size()) return NULL;
    return getLastAppliedAttribute(_textureAttributeMapList[unit],type,member);
 }

"
2012-02-09 15:54:13 +00:00
Robert Osfield
1432d4d54b Fixed build issues when compile with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF. 2012-02-07 16:14:13 +00:00
Robert Osfield
a9baf19f32 From Alexander Irion, "Added missing format GL_ALPHA to Image::computeFormatDataType()." 2012-02-07 12:37:48 +00:00
Robert Osfield
4d69577228 From Johannes Baeuerle, "The first problem is wrong value of the block size of etc1 textures in the getCompressedSize call in Texture.cpp. With the current block size of 16 the target application crashes with a GL_INVALID_VALUE. The reason is that the calculated size passed to OpenGL does not match the size of the passed data(data pointer,texture width,texture height,spec of etc1).
With a block size of 8 in the getCompressedSize call this error dissapears."
2012-02-07 12:02:04 +00:00
Robert Osfield
0775483b7c From Lionel Lagarde, "The setNormal method of osg::Billboard has side effects (it calls updateCache and update the normal to Z rotation matrix). When cloning billboards, copying the normal vector is not enough. In the correction, the copy constructor calls setNormal to update the internal members." 2012-02-07 11:21:11 +00:00
Robert Osfield
89417ee47f From Rudolf Wiedemann, "the file attached fixes the incomplete implementation of "osg::DefaultUserDataContainer"'s copy constructor.
Copying user objects was missing."

Note from Robert Osfield, in submission changed
    _objectList.push_back((*itr)->clone(copyop));
to
    _objectList.push_back(copyop(*itr));
2012-02-07 10:40:04 +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
fe61dcac69 From Colin McDonald, "I have an application with multiple windows. They share GL objects
between the contexts, using the GraphicsContext::Traits sharedContext
and setting the same contextID.

When one of these shared contexts is closed, GraphicsContext::close
deletes all GLObjects for that contextID, regardless of the fact that
they are shared.  This means that all of the other contexts sharing the
objects have to recompile them.

The attached tweak makes GraphicsContext::close a bit less brutal for
shared contexts.  I have also changed a misleading diagnostic message.
"
2012-02-01 17:42:42 +00:00
Robert Osfield
5feb203d79 From Luc Frauciel, "Ati FirePro is as much crippled as other Ati drivers.
This patch add "FirePro" to the black list of renderers in State.cpp / initializeExtensionProcs

It allows to avoid an OpenGL error on Viewer initialization.
Tested on FirePro  M7740 / Windows7 x64  Driver 8.85.7.2"
2012-01-25 17:31:07 +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
b828f5c083 From Farshid Lashkari, "Attached is a simple fix to osg::Sequence that allows it to load properly with the serializer formats (osgt/osgb). The problem was that the internal _nrepsRemain member was not being initialized properly if the number of repeats was equal to the default value of -1. When the number of repeats is explicitly set using setNumRepeats(), _nrepsRemain is set to the same value. However, in the constructor of osg::Sequence, it was not being initialized to the same value as _nreps. This fix simply changes the initial value of _nrepsRemain to the same as _nreps." 2012-01-02 16:54:05 +00:00
Robert Osfield
f3ce66aa8b From Glenn Waldron, "Attached is a change to ClusterCullingCallback to make it work properly under an RTT camera with an INHERIT_VIEWPOINT reference frame." 2011-12-23 17:15:06 +00:00
Robert Osfield
0af31eff5d Removed inappropriate static usage 2011-12-19 16:18:18 +00:00
Robert Osfield
c86e2361d2 Moved the createSpotLightImage function into include/osg/ImageUtils 2011-12-19 09:37:57 +00:00
Robert Osfield
bbf081695b Changed the setting of Traits::sampleBuffers so that it's set to 1 when DisplaySettings::getMultiSamples() is set to a non zero value. 2011-10-28 11:00:08 +00:00
Robert Osfield
20ffed1fa1 Removed OSX codepath for setting the depth value to 32 as this turned out to be unneccesary. 2011-10-28 09:45:51 +00:00
Robert Osfield
4b655d9c46 Added hack of using a 32bit depth buffer default setting for Traits when compiling under Apple. 2011-10-25 15:31:46 +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
6e01f05853 Added removal of [..] from names returned from glGetActiveUniform results to avoid issues with name lookups when the driver add the [..] for uniform arrays. 2011-09-19 10:12:53 +00:00
Robert Osfield
c1af863f78 From Morten Hauknes, "I have been using the getLastVisiblePixelCount on pre 3.0 osg. I believe maybe this was a private function that we made public in our side. I use(d) this method to make a simple algorithm to tell how much visible an object was in percent.
So with the 3.0 api change we propose the following change:
- put OSG_EXPORT on the QueryGeometry class so that we get access to the getNumPixels method.
- Create a function called getQueryGeometry that returns a casted _queryGeode->getDrawable(). Or a function called getQueryGeode that returns _queryGeode."
2011-09-13 13:38:26 +00:00
Robert Osfield
408c2a2267 From Paul Martz, "Here's my proposed change regarding the osg-users post "small feature culling threshold". I've updated the comments and brought the default values into agreement, but didn't bother to add the environment variable support." 2011-09-13 09:59:21 +00:00
Robert Osfield
698a284da8 From Sukender, "I added a tiny check to avoid an integer divide-by-zero, when image is invalid (ie. all values are 0)." 2011-09-13 09:46:22 +00:00
Robert Osfield
04ffdf1801 Added missing assignement of _simulationTime. 2011-08-15 14:37:16 +00:00
Robert Osfield
dcaf9b02ce Reverted the change to the default setting of _resizeNonPowerOfTwoHint back to true for all platforms to ensure the
same behaivour across platforms, something that can be achieved now thanks to the integrated GLU library.

Corrected the default of the ResizeNonPowerOfTwoHint to true to reflect the actual default setting set by the
Texture default constructor.
2011-07-28 11:05:10 +00:00
Robert Osfield
8d77126e2e From Alexander Irion, "Texture borders are not supported in ES.
_isTextureBorderClampSupported is set to "TRUE" in Texture.cpp, because of the version number check (GL VERSION >= 1.3).

This leads to an invalid enum error, when GL_TEXTURE_BORDER_COLOR is tried to set.
"
2011-07-22 09:27:41 +00:00
Robert Osfield
eed9e9f7e1 Fixed memory growth issue when using Texture2D::SubloadCallbacks that don't set the TextureObjects sizes. 2011-06-25 11:00:33 +00:00