The patched loader also complains more loudly if a material library file wasn't found or if a referenced material wasn't found in the material library."
was able to follow the problem until following addition to Texture.cpp:
// GLES doesn't cope with internal formats of 1,2,3 and 4 so map them to
the appropriate equivilants.
if (_internalFormat==1) _internalFormat = GL_ALPHA;
if (_internalFormat==2) _internalFormat = GL_LUMINANCE_ALPHA;
if (_internalFormat==3) _internalFormat = GL_RGB;
if (_internalFormat==4) _internalFormat = GL_RGBA;
The problem is that internal format "1" corresponds to GL_LUMINANCE, not
GL_ALPHA. I double checked this from the Red Book. Fixed version is
attached to the email."
I've needed to run a recorded simulation offscreen and save it to a sequence of images, and the ScreenCaptureHandler seemed to be the simplest way to do that, and with this change it's possible.
Another change: I've also added the ability to specify continuous capture of all frames, or a certain number of frames. ScreenCaptureHandler now has a setFramesToCapture(int) method. The argument will be interpreted as:
0 : don't capture
<0 : capture continuously
>0 : capture that number of frames then stop
I also added startCapture() and stopCapture() methods so that user code can start capturing (either continuously or the given number of frames) at a given point in their program. setFramesToCapture() won't start capturing, you have to call startCapture() afterwards. The handler also now has another key to toggle continuous capture (defaults to 'C').
Note that continuous capture will of course only work if the CaptureOperation writes to different files (for example, a WriteToFile with SEQUENTIAL_NUMBER mode) or does something different each time... Otherwise it will just overwrite of course. :-)
I've also taken the chance to refactor the addCallbackToViewer() method a bit too, since finding the right camera is needed in two places now.
I've tested all cases (I think). If you want to try, in osgviewer.cpp and replace the line
// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
with
// add the screen capture handler
osgViewer::ScreenCaptureHandler* captureHandler = new
osgViewer::ScreenCaptureHandler(
new osgViewer::ScreenCaptureHandler::WriteToFile(
"screenshot", "jpg",
osgViewer::ScreenCaptureHandler::WriteToFile::SEQUENTIAL_NUMBER),
-1);
viewer.addEventHandler(captureHandler);
captureHandler->startCapture();
And vary the "-1" (put 0, 10, 50) and then use the 'c' and 'C' keys and see how it reacts.
"
terrain. The triangulator is quite tricky to use properly but works
quite well, constraint triangulation is not an easy task... I have
encounter some crash during the development that the following patch
fix.
The two fixes are :
- Fix in removeVerticesInside() : needs to take into account UByte and
UShort version of DrawElements to avoid a crash later
- Fix a crash in triangulate() : detect degenerate adjacency case to
exit early form the adjacent triangle traversal loop to avoid a crash
later"
DisplaySettings now define COLOR and DEPTH as defaults for implicit buffers. Consequently Camera by default uses the same defaults through USE_DISPLAY_SETTINGS_MASK. However, particular Camera mask can be easily overriden through Camera::setImplicitBufferAttachmentMask method. I hope, that in this way we can have global control over implicit buffer defaults, and we can still retain fine grained control at Camera level.
I have also replaced original unsigned ints used to store masks to signed ints because complier resolves enums as signed integer (I got a number of warnings with unsigned int)."
makes smoothing optional for verticies which do not have a normal
associated with them in the OBJ input file. The previous behavior was
to always smooth at all verticies which did not have surface normals.
In this new implementation smoothing is on by default to be compatible
with previous behavior. The user can now specify the "generateFacetNormals"
option to the reader to use facet normals for verticies where the OBJ
file does not specify a normal."
Note from Robert Osfield, changed "noSmoothing" naming used by Lee to "generateFacetNormals".
settimeofday), OSG animations will freeze your application because
osg::Timer uses gettimeofday internally on non-Win32 platforms. This
is wrong and should be replace with times(2) or clock_gettime(2).
The attached patch fixes the issue in a binary-compatible way by using
clock_gettime when it's available, and falling back to gettimeofday
when it's not."
Most notable the __hpux define stuff. The __hpux__ variant seems to be not
defined which resulted in a compile error at this time. Consequently I have
replaced all occurances of __hpux__ with __hpux. And huge surprise: now osg
plugins are found and loaded correctly ...
The next notable one is the MSVC_IDE fix which makes the nmake Makefiles cmake
generator target behave like the ide one. Showed up because I started to do
scripted builds with nmake instead of devenv...
The rest is the usual bunch of stuff that just happens during normal
coding ..."
Fixed to osg::Texture for GLES support.
Added automatic GLenum mode mappings in osg::PrimitiveSet to provide a fallback for non support glDrawArray/glDrawElement modes.
Added finer gained error checking during StateSet::compile().
Moved the handling of DisplaySettings into Traits constructor.
Added support for s/getGLContextVersion(), s/getGLContextFlags() and s/getGLContextProfileMask() to osg::DisplaySettings.
Added command line and env var support for setting the GLContextVersion, GLContextFlags and GLContextProfileMask to osg::DisplaySettings.