Commit Graph

765 Commits

Author SHA1 Message Date
Robert Osfield
1b36cfc928 Added save and restoring of the cull mask to Camera handling code 2007-08-02 08:50:39 +00:00
Robert Osfield
8fa79e8c7e Ported across Viewer's to use osgUtil::GLObjectOperation, added second option
in GLObjectOperation to handle cases when no subgraph is registered, in these
case the code now compile all Camera subgraphs.
2007-07-30 10:52:37 +00:00
Robert Osfield
59d3e0ceb7 From Andy Skinner, adding C includes to avoid issues when mixing C and C++ standard includes 2007-07-28 10:44:03 +00:00
Robert Osfield
6dec61842d Introduce Camera::s/getRenderer(). 2007-07-28 10:28:40 +00:00
Robert Osfield
8c60ea437f Commented out debug messages 2007-07-18 16:14:59 +00:00
Robert Osfield
1f0edca631 Added support into osg::RenderInfo for a stack of Cameras that allow querries
of which camera is currently active to be querried from within the draw traversal.
2007-07-14 17:07:59 +00:00
Robert Osfield
a28588a84c Introduce GraphicsOperation subclass from osg::Operation, and osgUtil::GLObjectOperation
for compiling subgraphs.
2007-07-13 17:25:35 +00:00
Robert Osfield
ecf0b58a19 Renamed include/osg/OperationsThread to OperationThread.
Created a new GraphicsThread subclass from OperationThread which allows the
GraphicsContext specific calls to be moved out of the base OperationThread class.

Updated the rest of the OSG to respect these changes.
2007-07-12 15:54:45 +00:00
Robert Osfield
691a49d0fa From Paul Melis, fixes to spelling mistakes/typos. 2007-07-11 15:51:17 +00:00
Robert Osfield
44c07b9fad Separated OperationsThread out from the GraphicsThread header and introduced
new OperationQueue class.
2007-07-09 19:04:36 +00:00
Robert Osfield
6931ae4878 Added include/osg/GLObjects + .cpp which provide osg::flush*DeletedGLObjects() methods.
Added and cleaned up DeleteHandler calls in osgViewer to help avoid crashes on exit.

Changed DatabasePager across to dynamically checcking osg::getCompileContext(..)

Updated wrappers.
2007-07-06 13:08:51 +00:00
Robert Osfield
e7d7c1dcc2 Changed the way that computeNearFar is computed to avoid inconsistencies when in stereo mode 2007-07-02 13:17:47 +00:00
Robert Osfield
bb94377f20 Added balancing of stack size on entry/exit from rendering nested camera. 2007-06-30 14:30:12 +00:00
Robert Osfield
79dddef778 From Sherman Wilcox, added check for Drawable cull callbck into apply(Billboard) 2007-06-30 09:27:11 +00:00
Robert Osfield
64b8e3062f Added temporary reset of the RenderLeaf pointer for any internal calls to other graphics contexts. 2007-06-27 20:34:29 +00:00
Robert Osfield
c0a8c9dd53 Added texture format into Traits. 2007-06-27 10:12:10 +00:00
Robert Osfield
8fea401d79 Fixed target setting bug in PixelBuffer RTT set up. 2007-06-27 09:44:35 +00:00
Robert Osfield
053ba0c543 From Wojciech Lewandowski, "I did few tests to see whether adding PreDraw callback would help us with SPI problems when using Viewer. Results were positive so I decided to give it a try and ask you to verify and maybe merge with existing codebase.
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 ;-)
"
2007-06-01 19:45:24 +00:00
Robert Osfield
f012e4516c From Sherman Wilcox, "The issue itself occurs when a model is tessellated
that has greater than unsigned short number of vertexes. An object
called vertexPtrToIndexMap contains vertexes and their indexes. This
std::map object can obviously hold a quantity that is greater than
unsigned short, however osg::DrawElementsUShort objects were being
created to reference these vertexes and their indexes.
osg::DrawElementsUShort can only hold indexes that are 16-bit
quantities.

...

proposed_patch_2\tessellator.cpp. This solution examines the size of
vertexPtrToIndexMap and selects 1 of 3 possible osg::DrawElements
objects: DrawElementsUByte, DrawElementsUShort, or DrawElementsUInt.
The main drawback of this particular solution is the code duplication.
However, the repair is straightforward."
2007-05-29 10:31:03 +00:00
Robert Osfield
005268e982 Fixes to help C# binding dev. 2007-05-26 15:49:35 +00:00
Robert Osfield
30a06a033e From Peter Hrenka, (note from Robert Osfield, renamed GenericPrimitiveFunctor mention below to TemplatePrimitiveFunctor).
"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).

"
2007-05-23 11:05:59 +00:00
Robert Osfield
9ba424e8b2 Added saving and restoring of the near/far planes during Camera setup 2007-05-17 13:20:32 +00:00
Robert Osfield
1e0af35900 Added code to better compute the view frustum that is appropriate for a traversed
subgraph.
2007-05-15 17:04:57 +00:00
Robert Osfield
e72ec7bb15 From Uwe Woessner, fixed handling of read/draw buffer in vertical interlaced stereo 2007-05-11 13:45:53 +00:00
Robert Osfield
5b9883516a Added CullSettings inheritance mask for LIGHTING_MODE and LIGHT 2007-05-08 10:02:07 +00:00
Robert Osfield
963cd837e3 Added s/getLightingMode and s/getLight to osg::View to allow control of the viewers
global light source.
2007-05-07 22:07:23 +00:00
Robert Osfield
a259e97634 From David Callu, fixed incorrect array usage. 2007-05-04 08:40:20 +00:00
Robert Osfield
3809d0dad0 Moved the OpenThreads link locally to each lib 2007-05-03 10:06:38 +00:00
Robert Osfield
40db1a8934 Moved VBO switching code into inline methods into osg::State to speed performance 2007-05-01 06:28:20 +00:00
Robert Osfield
4968eb7136 Further work on the new VBO support 2007-04-27 14:52:30 +00:00
Robert Osfield
5325653f30 Cleaned up numToTop method 2007-04-25 10:32:28 +00:00
Robert Osfield
f242570269 Unified the setup of version numbers so that they all are based on the version
number setup in the include/osg/Version header file.
2007-04-22 20:19:43 +00:00
Robert Osfield
4637b78bd1 From Jason Howlett, using suggestion from Robert Osfield, "CullVisitor.cpp was modified, beginning at line 1115. Code was added to
check if the camera inherits its cull mask. If not, the CullVisitor sets
its traversal mask to the camera's cull mask."
2007-04-16 19:40:36 +00:00
Robert Osfield
47add5a42c Cleaned up state management code 2007-04-16 12:20:42 +00:00
Robert Osfield
9db23e0b22 Fixed bug associated with complex RenderBin setup. 2007-04-16 12:18:56 +00:00
Robert Osfield
68a6882d04 Bumbped the version number up to 1.9, in preperation for using odd release numbers
for development releases, odd versions for stable releases.
2007-04-16 06:03:22 +00:00
Robert Osfield
2e6ee4bb39 Removed old gmake and VisualStudio build files 2007-04-10 13:10:25 +00:00
Robert Osfield
a78e8d2b6b Fixed the handle of triangle fan. 2007-04-06 19:51:20 +00:00
Robert Osfield
6d7b5e7ebd From Eric Wing, pedantic warning fixes 2007-04-06 15:36:13 +00:00
Robert Osfield
538a83dad4 Added support for flushing buffer objects 2007-04-04 09:07:46 +00:00
Robert Osfield
9b5bbe862d From Mike Wittman, C# build fixes 2007-04-04 08:05:23 +00:00
Robert Osfield
b419fa93ef From Luigi Calori, "when we link against something that comes out from a Find... we ususally have a variable <LINK_VAR_NAME>available like OPENTHREADS_LIBRARY,
so I' ve set up a macro that uses the variable name expanded for linking, and  test if a variable ${LINK_VAR_NAME}_DEBUG
like OPENTHREADS_LIBRARY_DEBUG exists and in case uses it for linking in debug mode.
I' ve also set up FindOpenThreads to set up these variables.
I had to edit the core libraries CMakeLists to add the calls to the macros used.
I' ve tested under MSVC"
2007-03-26 13:02:38 +00:00
Robert Osfield
db6f07f1d6 Ran dos2unx of CMakeLists.txt files 2007-03-08 15:31:36 +00:00
Robert Osfield
f50ed9667a From Eric Wing and others, first cut of CMake build support 2007-03-04 13:05:33 +00:00
Robert Osfield
becd84c2f3 Added the default setting of the SceneView's camera onto the RenderStage to
allow SceneView to automatically support FBO, PBuffers, image and texture copies and 
Camera post draw callbacks
2007-02-21 20:38:14 +00:00
Robert Osfield
228fd04a19 Removed the exclusion of CullSettings from the genwrapper.conf, and then changed the CullStack RefMatrix& methods to RefMatrix*
as the RefMatrix& versions caused the wrappers to fail.
2007-02-21 13:48:01 +00:00
Robert Osfield
808162d344 Added pushViewport/popViewport to CullVisitor::apply(Camera&) 2007-02-16 16:37:16 +00:00
Robert Osfield
990417c9d1 Fixed typo 2007-02-16 15:14:16 +00:00
Robert Osfield
3eb833c8b8 Twaaked comments 2007-02-15 14:47:06 +00:00
Robert Osfield
1eea407ee0 Added support for osg::State::DynamicObjectCount into the RTT codes 2007-02-14 20:44:17 +00:00