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"
Added handling of Image::getPixelAspectRatio() in geometry sizing.
Added scaling of the projection matrix to ensure that aspect ratio is honoured with running in fullscreen mode
"Summary of changes:
From Roland
-Added MorphGeometry
-Bone Bindmatrix is only calculated if needed
-osgAnimation plugin now supports all available channel types (before only linear vec3 or quat channels)
-osgAnimation plugin now supports MorphGeometry
-osgAnimation plugin now supports animation and channel weights, animation playmode, duration and starttime
-removed osgAnimationManager.cpp from CMakeList
From Cedric
-fixed the last_update field (it was only updated at the first update) in BasicAnimationManager.cpp
- Refactore some part of MorphGeometry minor changes
- Add osganimationmorph as example
"
DisplaySettings.cpp: OSG_COMPIlE_CONTEXTS -> OSG_COMPILE_CONTEXTS
AnimtkViewer.cpp: is a 3d poker game client -> is an example for viewing
osgAnimation animations"
equivalent to the GLSL shaders sample) that displays the forest with
shaders on Intel 945 GM hardware. This card supports OpenGL 1.4 and
ARB_fragment/vertex_program only.
I would be pleased if this change made it into the official set of
examples, as it illustrates the use of ARB shaders quite nicely. I did
not find any other example covering this topic."
osgAnimation.
- Animation : removed the _name attribute that is never used.
- BasicAnimationManager : fix a crash on Windows with the example
osganimationviewer. The _lastUpdate attribute was not initialized when
using copy constructor.
- CMakeLists.txt : add RigGeometry to the headers list"
LD_LIBRARY_PATH so the XUL libs would be found) I noticed that although
the gecko plugin was found it could not be loaded. But this did not
trigger any visible warning/error message (at least not without INFO
notify level). Would you mind if we change the notify level for a
dlerror() to WARNING? This will also make it more explicit for the case
when a plugin isn't actually found, which seems to come up a lot for
novice users (e.g. no freetype on win32, so no freetype plugin, etc).
Also, the current error message is misleading ("Warning: Could not FIND
plugin to ...") because the it's not always a case of not finding the
plugin. I slightly enhanced the situation of not finding a plugin versus
finding it but not being able to load it.
Here's also a few fixes to some of the examples:
- osgfont: make usage help line more in line with the actual behaviour
- osgcompositeviewer: complain when no model file was provided
- osgmovie: don't include quicktime-dependent feature on Linux
- osgocclussionquery: comment addition (as I was surprised that lines
were being drawn in a function called createRandomTriangles())"
the workaround we discussed for adding/removing views in a composite
viewer at runtime. A dummy view is added to the viewer to always keep
it live.
Also, I added a #define to the Qt event relay methods to not override
them on a Windows system. This fixes the bug where duplicate events
are being sent and making it impossible to throw the trackball."
- The text and dark background rectangles are now correctly placed, and
slightly resized here and there.
- All counters (vertices, etc) now use a fixed formatting with 0 digits
precision, to prevent the text from being shown in scientific notation
when the number get large (e.g. 6.34344e+6). I tested with a scene
containing roughly 4 million vertices, to make sure its stats would
display correctly.
I also made slight changes to osgcompositeviewer (attached) to aid in
testing the stats display, specifically displaying of camera and view
names."
examples/osganimationviewer/AnimtkViewer.cpp:
- add option to display bone (--drawbone)
- dont crash if the file does not contains a AnimationManagerBase, display the content only
examples/osganimationviewer/AnimtkViewerGUI.cpp:
- adjust the path of image for the gui
include/osgAnimation/Interpolator:
- add warn message instead of old assert
include/osgAnimation/Bone:
src/osgAnimation/Skeleton.cpp:
- change a method name to fit better with what it does. setMatrixInSkeletonSpace instead of setBoneInSkeletonSpace
include/osgAnimation/Skinning:
src/osgAnimation/RigGeometry.cpp:
- add patch from Fabien Lavignotte to compute normal correctly
include/osgAnimation/Sampler:
- adjust behviour without assert, return 0 instead of crashing
"
address some OS X issues. Most of these fixes were previously submitted by Julian Scheid. However, this patch however should not break the example for non-OS X builds and has been tested on 64-bit Linux as well as Mac OS X 10.5.
o The value returned by QWidget::winId() is not usable as input for
WindowData under OS X the way it is for both Windows and Unix. Julian's fix
for this uses the Carbon API. Since the fix for X11 in unknown, it is now
assumed that OSG has been built with OSG_WINDOWING_SYSTEM='Carbon' for this
example to work at all when running under OS X.
o The CompositeViewer version would hang on exit with the original timer start
argument. Changing the argument value to match the non-composite version
seemed to cure the hanging.
o Julian's patch altered the setGeometry position to 30/30 in order to see any
window decorations. I did not have this problem, but left his changes intact.
o The non-composite viewer needed it's camera initialization defered until
after the ViewerQOSG's Qt base class had been initialized. Otherwise, the view
did not cover the entire window.
"
* When used PDS RenderStage::runCameraSetUp sets flag that FBO has already stencil,depth buffer attached. Prevents adding next depth buffer.
* Sets correct traits for p-buffer if used PDS and something goes wrong with FBO setup or p-buffer is used directly.
* Adds warning to camera if user add depth/stencil already attached through PDS.
* Sets blitMask when use blit to resolve buffer.
There is also new example with using multisampled FBO."
Example:
osgsidebyside -o cow.dae cow.osg
This example will read cow.osg, write cow.dae, read cow.dae and display cow.osg on the left side and cow.dae on the right side of the view.
Possible interactions:
KEY_UP Speedup DOF animation
KEY_DOWN SlowDown DOF animation
KEY_RIGHT Toggle all MultiSwitches"
" The code below is to show how a heirarchy of objects can be made within a scenegraph.
In other words, how there can be a parent/child relationship between objects such
that when a parent is rotated or translated, the children move is respect to it's
parent movement. A robotic arm is used in this example because this is what I'm
using OSG for."
I have found some errors on the example osgGeometryShaders. It's about the varying in the geometry shader.
take a look at the varying vec4 v_color.
In the vertex shader, v_color is initialized to gl_vertex
then in the geometry shader v_color is initialized to gl_PositionIn[0]
and in the fragment shader v_color is used as the fragment color.
Try to initialized v_color to vec4(1.0, 0.0, 0.0, 1.0) in the vertex shader and comment the line :
" v_color = v;\n" in the geometry shader, and you will see the lines as black !
It's because you have to use keywords in and out.
extract from : http://www.opengl.org/registry/specs/EXT/geometry_shader4.txt :
in - for function parameters passed into a function or for input varying
variables (geometry only)
out - for function parameters passed back out of a function, but not
initialized for use when passed in. Also for output varying variables
(geometry only).
Then for a geometry shader, a varying must be an array :
extract from : http://www.opengl.org/registry/specs/EXT/geometry_shader4.txt :
Since a geometry shader operates on primitives, each input varying variable needs to be
declared as an array. Each element of such an array corresponds to a
vertex of the primitive being processed. If the varying variable is
declared as a scalar or matrix in the vertex shader, it will be a
one-dimensional array in the geometry shader. Each array can optionally
have a size declared. If a size is not specified, it inferred by the
linker and depends on the value of the input primitive type.
Here is a patch based on the svn version of osg that correct that.
"
set.
The optimization is based on the observation that matrix matrix multiplication
with a dense matrix 4x4 is 4^3 Operations whereas multiplication with a
transform, or scale matrix is only 4^2 operations. Which is a gain of a
*FACTOR*4* for these special cases.
The change implements these special cases, provides a unit test for these
implementation and converts uses of the expensiver dense matrix matrix
routine with the specialized versions.
Depending on the transform nodes in the scenegraph this change gives a
noticable improovement.
For example the osgforest code using the MatrixTransform is about 20% slower
than the same codepath using the PositionAttitudeTransform instead of the
MatrixTransform with this patch applied.
If I remember right, the sse type optimizations did *not* provide a factor 4
improovement. Also these changes are totally independent of any cpu or
instruction set architecture. So I would prefer to have this current kind of
change instead of some hand coded and cpu dependent assembly stuff. If we
need that hand tuned stuff, these can go on top of this changes which must
provide than hand optimized additional variants for the specialized versions
to give a even better result in the end.
An other change included here is a change to rotation matrix from quaterion
code. There is a sqrt call which couold be optimized away. Since we divide in
effect by sqrt(length)*sqrt(length) which is just length ...
"
Notes from Robert Osfield, I've merged osgWidget trunk, and added/changed CMakeLists.txt file to make it suitable for inclusion in the core OSG, and moved imagery/scripts/shaders out into OpenSceneGraph-Data
- Added osgviewerCocoa example to APPLE builds
- Fixed corrupt Xcode project generation with CMake 2.6 dealing with ADD_DEFINITIONS and CMake Policy CMP0005 on Leopard
- Resolved CMP0006 warning for examples and programs by setting BUNDLE DESTINATION to same as RUNTIME DESTINATION with CMake 2.6
- Fixed freetype plugin on Leopard to avoid OpenGL linking problem
- Figured out how to use a custom Info.plist included in the project (see osgviewerCocoa application CMakeLists.txt)"
* I split the mouse handling from a monolithic method to separate ones, slightly cleaner than a whole bunch of if()'s, especially with another case of the mouse entering the canvas.
* I changed the EVT_KEY_DOWN handler to an EVT_CHAR handler, although that now makes the up and down handler assymetric. The new down-handler returns translated key codes, so when you press the S key (without anything else), it actually returns 's' and not 'S' as the EVT_KEY_DOWN did. This means that statistics can be called up in the viewer window, while the example previously only printed a "Stats output:" line to the console. I'm not truly happy that the up handler returns _untranslated_ key codes. But solving this completely would probably mean adding some table that translated from wxWidgets' untranslated key codes to OSG's internal ones. This might be interesting to add, as anyone using OSG + wxWidgets in any serious manner would also have to add this.
* I commented out the evt.Skip()'s in the keyboard handlers as these would only be necessary if there were some key events that are not handled. But currently all key events are simply forwarded.
* I changed the handling of a mouse drag to a more general mouse move"