I added _preDrawCallback member and neccessary access methods plus modified osgUtil RenderStage.cpp to invoke it before all drawInner calls are made. I tried to maintain symmetry with postDrawCallback but you know better where is a proper place for this call ;-)
"
"Since we desperately needed a means for picking Lines
and Points I implemented (hopefully!) proper geometrical tests
for the PolytopeIntersector.
First of all I implemented a new "GenericPrimiteFunctor"
which is basically an extended copy TriangleFunctor which also
handles Points, Lines and Quads through suitable overloads of
operator(). I would have liked to call it "PrimitiveFunctor"
but that name was already used...
I used a template method to remove redundancy in the
drawElements method overloads. If you know of platforms where
this will not work I can change it to the style used
in TriangleFunctor.
In PolytopeIntersector.cpp I implemented a
"PolytopePrimitiveIntersector" which provides the needed
overloads for Points, Lines, Triangles and Quads to
the GenericPrimitiveFunctor. This is then used in the
intersect method of PolytopeIntersector.
Implementation summary:
- Points: Check distance to all planes
- Lines: Check distance of both ends against each plane.
If both are outside -> line is out
If both are in -> continue checking
One is in, one is out -> compute intersection point (candidate)
Then check all candidates against all other polytope
planes. The remaining candidates are the proper
intersection points of the line with the polytope.
- Triangles: Perform Line-Checks for all edges of the
triangle as above. If there is an proper intersection
-> done.
In the case where there are more than 2 polytope
plane to check against we have to check for the case
where the triangle encloses the polytope.
In that case the intersection lines of the polytope
planes are computed and checked against the triangle.
- Quads: handled as two triangles.
This is implementation is certainly not the fastest.
There are certainly ways and strategies to improve it.
I also enabled the code for PolytopeIntersector
in osgkeyboardmouse and added keybindings to
switch the type of intersector ('p') and the picking
coordinate system ('c') on the fly. Since the
PolytopeIntersector does not have a canonical
ordering for its intersections (as opposed to
the LineSegementIntersector) I chaged the
implementation to toggle all hit geometries.
I tested the functionality with osgkeyboardmouse
and several models and it seems to work for
polygonal models. Special nodes such as billboards
do not work.
The next thing on my todo-list is to implement
a an improved Intersection-Structure for the
PolytopeIntersector. We need to know
which primitives where hit (and where).
"
selectively set the pixel format for windows that are inherited, following
some discussions on the mailing list last week.
This is implemented through a new traits flag
(setInheritedWindowPixelFormat) with a default state of false (to avoid
breaking existing applications). When set to true, the pixel format of the
inherited window will be set according to the traits specifications.
"
setActiveTextureUnit methods of osg::State so they return false if the
texture unit is outside the range of allowable units for the driver.
Currently, the functions would return true even if the units are
invalid. This would cause the osg::State to become out of sync with
the actual driver state, which can cause some bugs in certain cases.
The change I made would verify that the unit passed to
setClientActiveTextureUnit is below GL_MAX_TEXTURE_COORDS, and the
unit passed to setActiveTextureUnit is below
max(GL_MAX_TEXTURE_COORDS,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS). I
modeled this behavior from the OpenGL docs for these commands which
can be found here:
http://www.opengl.org/sdk/docs/man/xhtml/glClientActiveTexture.xmlhttp://www.opengl.org/sdk/docs/man/xhtml/glActiveTexture.xml
"
"Attached are updates of src/osg/Sequence.spp and include/osg/Sequence.
I've taken _sbegin/_send/_ubegin/_uend and _step our of the include file
and made them local variables in whatever method might need them.
I got rid of the _recalculate method as it was only getting used in
one place.
I also found a cut/paste bug in setMode's START case."
Note from Robert Osfield, Also includes some guards against crashes that was occuring in this new
code when handling empty Sequences.
return the length of the stream.
Implemented the virtual methods in QuicktimeImageStream, (getLength,
getReferenceTime, setTimeMultiplier), to return valid value for each.
"
it to be assigned as a vertex attribute array to an osg::Geometry.
Removed the osgTerrain::ArrayLayer as its no longer required thanks to the above change
which makes the osgTerrain::HeightFieldLayer more flexible.
Updated wrappers
multithreaded-opengl-engine on os x or not. I set its default to false,
perhaps other os x users can test this setting with their data/apps, to
see if we can enable it by default.
I changed also the borderless-window-type, so expos?works correctly."
retain objects for several frames before deleting them. Also added RenderStageCache
into CullVistor.cpp that is used for handling RTT osg::Camera's that are being
used in double buffered SceneView usage.
related support into osgViewer::Viewer and osgViewer::StatsHandler.
Added lazy updating of text in StatsHandler HUD to minimize the impact of
slow text updating on observed frame rates.
Added setting of osg_SimulationTime and osg_DeltaSimulationTime to the uniforms set by SceneView
Added frame(double simulationTime) and advance(double simulationTime) parameters to
osgViewer::SimpleViewer, Vewer and CompositeViewer.
Updated various examples and Nodes to use SimulationTime where appropriate.
Added s/getStats() to osg::View and osg::Camera.
Added population of View::getStats() with frame stats in osgViewer/Viewer.
Added Basic StatsHandler to osgviewer example.
as osg::GraphicsOperation. Unpdated parts of OSG depending upon these.
Added a virtaul bool valid() method to osg::GraphicsContext to allow apps to
test whether a valid graphis context has been created or not.
added frame stamp updating and update traversal to osgViewer::Scene/Viewer.
Updated osgcamera example to use new Viewer API calls instead of using local
rendering calls.
Performance tests on big models did not indicate any performance penalty in using doubles over floats,
so the move to doubles should mainly impact precision improvements for whole earth databases.
Also made improvements to osgUtil::PlaneIntersector and osgSim::ElevationSlice classes
handle scenes with multiple views with elements that need coordinating on a per view basis.
Added beginings of new osgText::FadeText class (not functionality yet).
"I've made some changes to osg which I think make it easier to control
the render order of CameraNode's. Instead of using the built-in orders
(PRE_RENDER, POST_RENDER, NESTED_RENDER), you can specify an integer
order. Values less than zero are pre rendered in order. Values greater
than zero are post rendered in order. And a value of 0 is equivalent
to NESTED_RENDER.
The changes should be fully backward compatible. Also, I changed the
RenderStageList type from a vector to a list because I needed to be
able to insert values anywhere in the list.
The reason I made these changes was because I wanted to be able to set
the render order of a CameraNode at runtime without having to reorder
it in the scenegraph."
and later in the final submission message (relating to what has been finally been merged) :
"I've rethought my implementation and came up with something a little
better. The setRenderOrder will continue to take an enum, but will
have an optional orderNum parameter which can be both positive and
negative. I think this method is more intuitive and flexible."
"I was experiencing hard crashes of my application when using PBO's on
machines that don't support PBO's. I think osg incorrectly checks if
PBO's are supported.
I added a new method to the BufferObject::Extensions class which
returns if the "GL_ARB_pixel_buffer_object" string is supported. This
fixes the problem on my end. Machines without PBO support will
continue to work and machines with PBO support will still be able to
use it."
think it can be simplified quite a bit. The old code includes
<cmath> for pre-10.2 and anything using something other than g++ 4
and then uses std::isnan. For the most current version, it leaves
out cmath and uses isnan(). std::isnan and cmath work for the
current version, so I just made it include cmath if __APPLE__ is
defined and removed the ifdef between versions of OS X for isnan
related things.
This way the code is all the same, and it's not fragile to someone
including <cmath> prior to including osg/Math."
in incorrect texture assignment. Solution was to a compareTextureObjects() test to the Texture*::compare(..) method that
the osgUtil::Optimizer::StateSetVisitor uses to determine uniqueness.
setFactorAndUnitMultipliersUsingBestGuessForDriver() static methods to
osg::PolygonOffset to help implement workarounds for lack of portablity of
settings between different hardware.
make it consistent with the constructor and prevent the
BlendFuncSeparate path being called. This patch fixed the artifact
with the osgpointsprite demo on ATI cards reported by Mike Weiblen."
"Attached is some fixes for Image::readImageFromCurrentTexture. It was
failing when used with a new Image object (some of the fields were
not set before they were used, and some were set to the wrong values).
A new optional parameter was added to give the desired data type, which
defaults to GL_UNSIGNED_BYTE, so programs should only need a recompile
to work properly."
when the binding mode changes, thereby avoiding uncessary calls to dirtyDisplayList.
Note, from Robert Osfield, moved bodies of set*Binding() into Geometry.cpp to avoid
clutter in the header.
that removeChild(Node*), removeChild(uint) and equivilant Geode methods are
now inline methods, not designed to be overriden, and seperated out the
multiple remove method to be called removeChildren(uint, uint) which is
now the only virtual method. There removeChildren is now the method to
override in subclasses.
This reorganisation requires some call code to be rename removeChild usage
to removeChildren.
osg::DisplaySettings class. OsgCameraGroup will now read the setting
from the DisplaySettings instead of hardcoding the value. I added the
following commandline option to be able to set the multisample value:
--samples <num>
One thing to note, OsgCameraGroup would previously check if the
computer is an SGI and set multisample to 4. I retained this check in
DisplaySettings to be backwards compatible."