Commit Graph

485 Commits

Author SHA1 Message Date
Robert Osfield
70aa087f6e Added releaseGLObjects(State*) support into osg::FrameBufferObject, osg::RenderBin and osg::RenderStage
to ensure proper clean up of FBO's on closing a graphics context.
2011-04-20 11:45:01 +00:00
Robert Osfield
8ffa50a88e Added IncrementalCompileOperation::compileAllForNextFrame(uint) method and supporting
functionality that  tell the IncrementalCompileOperation to compile all pending objects during next draw traversal,
for specified number of frames.
2011-04-18 12:35:19 +00:00
Robert Osfield
e28f9a7d32 Added CullVisitor::Identifier to help with cull operations that require a consistent identifier for
cull traveresals when osgViewer::Renderer uses double buffering.
2011-03-17 13:54:14 +00:00
Robert Osfield
7cd74f0282 From Farshid Lashkari, "Another update. I added a LIMIT_NEAREST enum which implements your previous suggestion of rejecting bounding volumes further from the nearest existing intersection. I only implemented this for LineSegmentIntersector. I'd appreciate it if you could double check the math I added to LineSegmentIntersector::intersects() for checking if the bounding sphere is further away. The results of this are promising. I'm getting noticeable performance increase for line intersections with scenes containing many drawables.
"
2011-03-14 10:07:15 +00:00
Robert Osfield
f7718d2b7b From Farshid Lashkari, removal of redundent spaces at the end of lines. 2011-03-11 17:20:24 +00:00
Robert Osfield
d3d0859b4c From Piotr Gwiazdowski, "So there's config setting OSG_DISABLE_MSVC_WARNINGS which should
disable pragmas that turn off specific warnings for MSVC.
Unfortunately it's presence is only checked in osg/Export header,
making other Export headers disable warnings no matter what, which is
kind of incoherent.

My fix adds #include <osg/Config> to every Export header. I've also
unified checking whether to disable warnings to current osg/Export
way:
#if defined(_MSC_VER) && defined(OSG_DISABLE_MSVC_WARNINGS).

Attachment contains all changed Export files in their original locations."
2011-03-09 14:15:04 +00:00
Robert Osfield
4b4754c3cf Implementated experimental reuse of PBO's after download 2011-02-07 14:19:58 +00:00
Robert Osfield
6496e35421 Moved GraphicsCostEstimator ref pointer into osg::State 2011-02-03 12:42:23 +00:00
Robert Osfield
88ce98b47d Moved GraphicsCostEstimator from osgUtil into core OSG library 2011-02-03 12:22:09 +00:00
Robert Osfield
99fc347212 Added experimental timing and PBO usage into ICO+GCE classes 2011-02-01 12:18:22 +00:00
Robert Osfield
373f3931e9 Implement first pass at texture compile estimation 2011-01-26 18:47:55 +00:00
Robert Osfield
a4f2cbe577 Replaced CompileStats with GraphicsCostEstimator 2011-01-26 16:47:40 +00:00
Robert Osfield
9df072ce05 Moved GraphicsCostEstimator into osgUtil. 2011-01-26 12:51:46 +00:00
Robert Osfield
11cd5a89ed Implemented better coupling of DatabasePager and IcrementalCompileOperation,
removing functional duplication and opening the door to dynamic enabling/disabling
of pre compile based on load.
2011-01-17 17:17:19 +00:00
Robert Osfield
0d814bb6b8 Refactored IncrementalCompileOperation to make it more flexible. 2010-12-24 19:19:48 +00:00
Robert Osfield
410b4fd109 Converted FrameStamp::g/setFrameNumber from int to uint 2010-12-22 20:11:05 +00:00
Robert Osfield
017a03ffe5 Refactor of DatabasePage/IncrementalCompileOperation to use the IncrementalCompileOperator for compiling objects 2010-12-10 15:27:19 +00:00
Robert Osfield
b2cf978ae3 Renamed YES and NO enums with more description names that don't overlap with iOS #define's 2010-12-06 10:35:02 +00:00
Robert Osfield
147fdd0430 From Sukender, "1. More handled cases in MergeGeometryVisitor
- Algorithm doesn't try to merge double and single precision arrays together
- Algorithm doesn't try to merge incompatible geometries (ex: one with "vertices + texoords", and another with only vertices)

2. Better TextureAtlasBuilder
Algorithm is still sub-optimal, but it now tries to fill more blanks, using "unused space in the current line".
(Don't know if I already submitted it, but I guess not)
One day, someone should try to find a good solution to this NP-problem... For instance : http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.140.200&rep=rep1&type=pdf
"
2010-11-05 17:04:08 +00:00
Robert Osfield
9978516bf7 Added number of primitive sets to on screen stats 2010-10-25 13:42:01 +00:00
Robert Osfield
f91944fbbf Added paging support to osganalysis example 2010-10-22 12:19:22 +00:00
Robert Osfield
1a292ad8e3 Integrated IncementalCompileOperation into DatabasePager.
Improved various facilities in IncrementalCompileOperation.
2010-10-21 16:29:23 +00:00
Robert Osfield
6ed74470b2 Introduction of IncrementalCompileOperation support to DatabasePager. 2010-10-14 18:16:03 +00:00
Robert Osfield
b55f75111e Added support for using a custom osg::Geometry that attempts to force the OpenGL driver
to download the texture object to graphics card.

Calling IncrementalCompileOperation::assignForceTextureDownloadGeometry() assigns a geometry
to the job.
2010-10-13 15:03:02 +00:00
Robert Osfield
d23ce985a1 Introduced osg namespace to new local GLU functions 2010-10-07 11:53:28 +00:00
Robert Osfield
89f7726383 Copied libutil and libtess implementations in form Mesa 7.9/src/glu into the src/osg/glu,
changed extensions from .c to .cpp and got compiling as C files as part of the osg core library.

Updated and cleaned up the rest of the OSG to use the new internal GLU.
2010-10-06 14:44:52 +00:00
Robert Osfield
cbc43841e1 From Roland Smeenk, "this submission adds a "Fast Drawable" line to the camera scene statistics.
It shows the total number of sorted and unsorted drawables that use the fastpath for rendering."
2010-09-09 10:03:58 +00:00
Robert Osfield
acbaf3962c Cleaned up the inline methods 2010-08-09 16:14:25 +00:00
Robert Osfield
075b1b769c Beginning of crease angle support for SmoothingVisitor to all it duplicate vertices are creases
thus enabling separate normals for triangles adjacent to the creases.
2010-07-30 19:39:38 +00:00
Robert Osfield
7c38643a77 From Tim Moore, "I noticed that the "Materials" statistic in the camera scene stats display seemed to be identical to the number of drawables. In fact, it displays the nummat member of osgUtil::Statistics, but that variable has nothing to do with materials. nummat tracks the number of matrices associated with Drawable objects in a RenderBin; as I understand it, Drawables pretty much always have a model-view matrix tied to them in RenderBins, so this statistic doesn't seem very useful. So, I added statistics for the number of StateGraph objects in RenderBins and also for the number of Drawables in the "fine grain ordering" of RenderBins. The latter corresponds to the number of Drawables in the scene that are sorted by some criteria other than graphics state; usually that is distance for semi-transparent objects, though it could be traversal order. These two statistics give an idea of the number of graphic state changes happening in a visible scene: each StateGraph implies a state change, and there could be a change for each sorted object too. You can also subtract the number of sorted Drawables from the total number of Drawables and get an idea of how many Drawables are being drawn for each StateGraph.
"
2010-04-20 10:59:44 +00:00
Robert Osfield
b1658ee6df From Farshid Lashkari, "I noticed that osg::State::getInitialViewMatrix returns the monocular view matrix when rendering in stereo. I've made some changes to osgUtil::RenderStage & SceneView so that it will return the correct view matrix depending on which eye is currently being rendered." & "I made a small change to the previous patch so that osg::State::getInitialViewMatrix works correctly with pre/post render stages as well." 2010-04-19 14:49:42 +00:00
Robert Osfield
7a44b43474 From Time Moore, "This submission implements 3 optimizations for meshes. INDEX_MESH turns DrawArrays style geometry into DrawElements, uniquifying the vertices in the process. This is useful for certain loaders, like ac3d, which just spit out DrawArrays. VERTEX_POSTTRANSFORM and VERTEX_PRETRANSFORM optimize mesh triangle and vertex order for the caches on a modern GPU, using Tom Forsyth's algorithm. I describe this and the big difference it makes (38% improvement on a very large mesh) in my blog,
http://shiny-dynamics.blogspot.com/2010/03/vertex-cache-optimization-for-osg.html."
2010-03-11 18:15:20 +00:00
Robert Osfield
6c07be375c Clean up of initialization of statics/use of getenv 2010-03-11 16:46:01 +00:00
Robert Osfield
86f491e649 Replaced use of unsigned int/enum mask combinations with int/enum mask combinations to avoid the need for casting enums to unsigned ints,
and to avoid associated warnings.

Update wrappers to reflect these changes.
2010-03-05 12:55:08 +00:00
Robert Osfield
88474271e3 From Fabien Lavignotte, "In order to compile on Windows with Wrappers ON, some exports are still missing on osgPresentation::AnimationMaterialCallback and osgUtil::IncrementalCompileOperation::CompileSet." 2010-02-19 14:30:01 +00:00
Robert Osfield
f795770fed Added support for passing on slave Camera's StateSet's to the rendering backend. 2010-01-21 10:24:48 +00:00
Robert Osfield
68b661c93b Cleaned up the #define's for when GLU is not available 2009-10-08 09:27:54 +00:00
Robert Osfield
2d26cbe7ab Introduced optional build against the GLU library, using optional compile paths to enable/disable GLU related function.
To toggle the use of the GLU library adjust the OSG_GLU_AVAILABLE variable via ccmake . or CMakeSetup.
2009-10-07 19:42:32 +00:00
Robert Osfield
3f65f4f80b From Wojciech Lewandowski, support for FBO's without colour or depth attachments.
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
2009-08-21 09:34:48 +00:00
Robert Osfield
a09353f931 Fixed doc message 2009-06-08 12:44:23 +00:00
Robert Osfield
aa69137fb8 Added collateReferencesToDependentCameras() and clearReferencesToDependentCameras() methods into RenderStage and SceneView, and use
of these methods in src/osgViewer/Renderer.cpp to make sure that the draw thread keeps references to all in scene graph Cameras
that are being used by the drawing threads, to keep the Camera's alive even when the main thread removes these Cameras from the scene graph.
2009-06-05 19:05:37 +00:00
Robert Osfield
45ec1a163c Added support for RenderBin::SortMode::TRAVERSAL_ORDER to enable rendering of scene graph drawables in the order that they were traversed in. 2009-05-27 09:54:17 +00:00
Robert Osfield
48a9b90dc5 Added suggestion of IntersectionVisitor instead. 2009-04-24 17:51:23 +00:00
Robert Osfield
619be4ced0 Changed doxygen docs to say deprecated 2009-04-24 17:49:34 +00:00
Robert Osfield
00ee3b0a20 Cleaned up interface 2009-03-23 15:38:30 +00:00
Robert Osfield
1fd5eefbcf From Maciej Krol, "As promised to Roland I assembled simple shader generator. ShaderGenVisitor converts accumulated fixed function pipeline state sets to ones with shader programs. Generated state sets are attached to geometries and stored in ShaderGenCache for reuse.
Very simple cases of state configuration are supported (all the ones I really need):
- single per pixel not attenuated non spot light source ON/OFF
- exp2 fog ON/OFF
- diffuse texture in rgb + optional specular gloss in alpha (Texture unit 0) ON/OFF
- normal map texture (Texture unit 1 and Tangent in VertexAttribArray 6) ON/OFF
- blending and alpha testing (not in shader pipeline)

To view fixed function pipeline files and paged databases simply run >osgshadergen myfile.osg"
2009-03-23 11:53:06 +00:00
Robert Osfield
e60db47c1b Inroduced simple PrintVisitor class for helping debug scene graph structures 2009-03-19 11:11:51 +00:00
Robert Osfield
7b5f3ec92a Moved IncrementalCompileOperation out of include-src/osgUtil/GLObjectVisitor into their own files.
Added support to IncrementCompileOperation for controlling how much time is alloted to compilation and flush
2009-03-12 15:21:04 +00:00
Robert Osfield
0669107287 From Roland Smeenk, "While working on the Collada plugin I noticed that all geometry created by the dae reader result in slow path geometry.
Because there already exists the option to convert slow path geometry to the fast path by computing an internal fast path alternative, I added a new optimizer option that automatically does this. To check the results I also made some changes to the statistics gathering and rendering.

Somewhat unrelated, but also part of the optimizer I disabled removal of CameraView nodes during RemoveRedundantNodes optimization.
As discussed on the ML, CameraViews were removed from the scenegraph. This solves that issue.

Summary:
-Geometry::areFastPathsUsed now also looks at internalOptimizedGeometry
-Added Optimize option to make all slow path geometry compute their internal fast path alternative
-Added fast geometry counter to the statistics
-Disabled removel of CameraViews in optimizer
"
2009-03-10 14:15:59 +00:00
Robert Osfield
99477fa422 Tweaked API to get wrappers to build 2009-03-09 16:53:57 +00:00