The texture in data/Images should be copied to osg-data. I created the texture myself with the help of an explosion generator, so no license issues there.
"
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg33967.html
, interpolating through HSV space gives a rainbow color effect which
does not mimic the simple RGB color interpolation that OpenGL does.
It's overkill and causes unexpected visual artifacts. In the attached
files I've removed the conversion to HSV so that interpolation happens
in RGB space."
osg::GraphicsContext, in order to give good integration with the
application's GUI toolkit. This works really well.
However, I need to share OpenGL texture resources with the standard
osgViewer GraphicsContext implementations, in particular the
PixelBuffers. This is essential for my application to conserve graphics
memory on low-end hardware. Currently the standard osg implementations
will not share resources with another derived osg::GraphicsContext,
other than the pre-defined osgViewer classes e.g. PixelBufferX11 is
hardcoded to only share resources with GraphicsWindowX11 and
PixelBufferX11 objects, and no other osg::GraphicsContext object.
To address this in the cleanest way I could think of, I have moved the
OpenGL handle variables for each platform into a small utility class,
e.g. GraphicsHandleX11 for unix. Then GraphicsWindowX11, PixelBufferX11
and any other derived osg::GraphicsContext class can inherit from
GraphicsHandleX11 to share OpenGL resources.
I have updated the X11, Win32 and Carbon implementations to use this.
The changes are minor. I haven't touched the Cocoa implmentation as
I'm not familiar with it at all and couldn't test it - it will work
unchanged.
Without this I had some horrible hacks in my application, this greatly
simplifies things for me. It also simplifies the osgViewer
implementations slightly. Perhaps it may help with other users'
desires to share resources with external graphics contexts, as was
discussed on the user list recently."
Notes from Robert Osfield, adapted Colin's submission to work with the new EGL related changes.
filenames starting with a dash "-" character from the (std::vector<std::string>&) version
of osgDB::readNodeFiles. Handling of argument strings is properly implemented in the
osgDB::readNodeFiles(osg::ArgumentParser& arguments,const Options* options)
variant, which most code uses. The (std::vector<std::string>&) version is only called by
the osgconv utility, which does its own argument handling and stripping prior to calling
readNodeFiles().
Also, documented this behaviour in the header comments.
I believe this code removal is a meritful change because leavign the code in causes an
unexpected and undocumented behaviour (ignoring any filename starting with a dash) that
could bite users in the future. This behaviour is not needed for existing functionality
because existing code uses other APIs to handle dash-prefixed arguments anyway.
"
only create 376, then the program would hang.
376 * 8MB stack per thread = 3008 MB
The stack size allocated per thread blew the process address stack.
To get more threads you have to specify a smaller per thread stack,
but while the Thread::start says it will limit the stack size to the
smallest allowable stack size, it won't let it be smaller than the
default. I included the limits.h header to use PTHREAD_STACK_MIN as
the minimum stack size.
As for the deadlock, if the pthread_create failed, the new thread
doesn't exist and doesn't call threadStartedBlock.release(), so the
existing thread deadlocks on threadStartedBlock.block(). Only block
if the thread was started."
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.
"
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)."
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.
Removed EXT postfix of FrameBufferObject functions, and added support for checking non EXT versions frame buffer object GL functions.
Introduced usage of OSG_GL*_FEATURES to avoid some #if #else #endif code blocks.
Using a submissions from Paul Martz as a guide added perliminary GL3 support to a range of OSG classes
* Refactore of RigGeometry to support hardware skinning
* Refactore of Timeline to split Action in differents files
* Add example how to use hardware skinning
* Change ref_ptr to observer_ptr to avoid cross reference and leak in Skinning
* Set invalidate to true to re run the check visitor in Skeleton
* Shallow copy Sampler in channel copy constructor
* Add accessor in VertexInfluence
* Remove dead code in Timeline.cpp
* Dont force linking in Bone::UpdateBone, the decision is done by the user or the manager
* Add offset in timeline stats to display each manager on the screen
* Add a flag in animation manager base to enable or not automatic link when modifying the manager
Added support for automatic aliasing of vertex, normal, color etc. arrays to Vertex Attribute equivelants.
Added new osg::GLBeginEndAdapter class for runtime conversion from glBegin/glEnd codes to vertex arrray equivelants.
Added automatic shader source conversion from gl_ to osg_ builtins.
of an osgWidget::Label with an osgText::String. I had to do this on a
project I'm working on, because I needed UTF-8 strings on my labels,
and using setLabel with std::string was not working.
"
It adds new PrimitiveSet constants for the specific geometry shader primitive types :
- LINES_ADJACENCY
- LINE_STRIP_ADJACENCY
- TRIANGLES_ADJACENCY
- TRIANGLE_STRIP_ADJACENCY
It also adds some missing features to the glsl reader plug'in.
"
The Texture Pool can be enabled by setting the env var OSG_TEXTURE_POOL_SIZE=size_in_bytes.
Note, setting a size of 1 will result in the TexturePool allocating the minimum number of
textures it can without having to reuse TextureObjects from within the same frame.
Finally, I have fixed TemplateTarget<osg::Quat>::lerp() as it was giving incorrect results when interpolating between some small rotations.
From Cedric Pinson, i renamed the method in channel to be more general. Adjusted the CubicBezier key constructor to use a single value as input.
Update Timeline.cpp to add current layer to the ActionVisitor, use correctly the priority
Add accessors in Action.cpp to retrieve protected data
Split files and rename them to classname
Change de default color of UpdateMaterial to FFOOFF to detect unset value
Add accessors in LinkVisitor instead of accessing data directly
Update osganimationtimeline example to fit the api callback
- Animations with equal priority are now weighted correctly relative to each other
- (minor) Channels no longer store their weight as the only time it's used is in update() when Animation can pass in the weight directly
From Cedric Pinson,
- I adjusted the quaternion blending to keep the commutativy property
osg::Animation::TemplateStepInterpolator::getValue the code tries to return
the result rather than assigning it to the result parameter reference.
The following patch fixes this."
Note from Robert Osfield, I've temporarily re-enabled the old focing of of color and depth attachment to avoid regressions on some OpenGL driver. We'll revist this once
we have a mechanism for controlling this override at runtime.
#define FORCE_COLOR_ATTACHMENT 1
#define FORCE_DEPTH_ATTACHMENT 1
dragger="box" or dragger="trackball"
and
technique="light" or technique="isosurface" or technique="iso" or technique="mip"
and
tf="transferfunctionfile.tf"
i.e.
<volume dragger="box">CardiacCT</volume>
<volume tf="colour.tf">CardiacCT</volume>
<volume technique="isosurface">CardiacCT</volume>
behind osgText::Text. I made it so the box would get drawn using
whichever BackdropImplementation was selected. However, I did not
implement STENCIL_BUFFER. In that case it defaults to drawing the
bounding box using POLYGON_OFFSET instead.
Also made it so the BOUNDINGBOX and FILLEDBOUNDINGBOX are drawn with a
settable color and margin size.
While I was at it I tightened up the values applied with DEPTH_RANGE
and POLYGON_OFFSET, not just for drawing the bounding box but also for
drawing backdrop text (these values must be coupled since the bounding
box has to be drawn deeper in Z than the backdrop text). The values
in use before seemed like overkill and I was seeing some z-clipping
with my background scenery in the case of DEPTH_RANGE. If there was a
good reason for the large values please let me know...."
GraphicsWindowCocoa-implementation, which enhances multithreaded
stability, it ensures that modifications to the size of an openglcontext
is done only from one thread.
"
Selection is now just a typedef of osg::MatrixTransform, and is deprecated
CommandManager is shell class that just sets values directly on Dragger, and is deprecated
Dragger now has list of DraggerCallback that takes over the roll of tracking changes to the Dragger, and
allows users to track the dragger in any way they wish.
Dragger now has a convinience method making MatrixTransforms track a dragger.
Selection and CommandManager are no longer required for use of osgManipulator and are kept around for backwards compatibility.
dependent on the complexity of the geometry. For complex scenes this
meant that it looked like you were "throwing" the display into molasses.
For simple geometry things get over-excited once thrown.
The fix is to factor in the frame rendering time to the caluclated
motion. I've implemented this for rotation and panning.
Now when things are thrown they maintain a rate very close to what was
happening when the mouse button was released."
Enclosed is include/osgParticle/Particle. I removed the const from the
return type of getSTexCoord. I also changed the name on the next
function to getTTexCoord so it is consistent with getSTexCoord. If you
prefer to change getSTexCoord to getSCoord you will need to change it in
ConnectedParticleSystem.cpp."
- osg::Texture sets GL_MAX_TEXTURE_LEVEL if image uses fewer mipmaps than
number from computeNumberOfMipmaps (and it works!)
- DDS fix to read only available mipmaps
- DDS fixes to read / save 3D textures with mipmaps ( packing == 1 is
required)
- Few cosmetic DDS modifications and comments to make code cleaner (I hope)
Added _isTextureMaxLevelSupported variable to texture extensions. It
could be removed if OSG requires OpenGL version 1.2 by default.
Added simple ComputeImageSizeInBytes function in DDSReaderWrites. In
my opinion it would be better if similar static method was defined for
Image. Then it could be used not only in DDS but other modules as well (I
noticed that Texture/Texture2D do similar computations).
Also attached is an example test.osg model with DDS without last mipmaps to
demonstrate the problem. When loaded into Viewer with current code and moved
far away, so that cube occupies 4 pixels, cube becomes red due to the issue
I described in earlier post. When you patch DDS reader writer with attched
code but no osg::Texture yet, cube becomes blank (at least on my
Windows/NVidia) When you also merge osg::Texture patch cube will look right
and mipmaps will be correct."