Commit Graph

1783 Commits

Author SHA1 Message Date
Robert Osfield
29a8ea2e88 Moved osgbrowser into svn/trunk. 2010-12-13 17:50:00 +00:00
Robert Osfield
a4b0ca0310 Move osgcegui into deprecated 2010-12-13 17:49:37 +00:00
Robert Osfield
eb9510eb72 Moved GraphicsWindowQt from osgviewerQtContext into osgQt. 2010-12-13 16:25:50 +00:00
Robert Osfield
c4fded0629 Fixed warnings 2010-12-13 13:41:42 +00:00
Robert Osfield
1402583d17 From Wang Rui, "Attachment is an example of rendering 3D scenes to high resolution screenshots.
I uses a queue of Camera objects to do offscreen rendering with the Camera::attach() function. The entire picture is split into many tiles and it will take a few seconds while attaching and detaching cameras with tiles. You may select to output every tile as an image file, or combine them together to create a large poster, for example, a 12800 x 9600 image.

Start the program like this:

./osgposter --output-poster --poster output.bmp --tilesize 800 600 --finalsize 8000 6000 cow.osg

Adjust the scene camera to a suitable position and press 'p' or 'P' on the keyboard. Wait until sub-cameras dispatching is finished. And the poster file will be created while closing window. A 8000 x 6000 output.bmp will be created to show a fine-printed cow. :)

The command below may also help:

./osgposter --help
 "
2010-12-13 13:37:37 +00:00
Robert Osfield
a345a04254 From Wang Rui, "I implemented a customized viewer event traversal here to read state
changes from the DirectInput devices and add events to the event
queue. I've tested with the keyboard and joystick supports. Because of
only having a very old 6-button gamepad, I can't do more experiments.
Hope this will bring more ideas to those who face similar problems,
especially simulation game designers. :)

I didn't map all DirectInput key values to GUIEventAdapter key
symbols. Users may add more in the buildKeyMap() function freely. The
mouse handling operations are also ignored, but will be easily
improved in the same way of creating keyboard and joystick devices.

Please add a line:

FIND_PACKAGE(DirectInput)

in the CMakeLists of root directory. And in the examples/CMakeLists.txt:

IF(DIRECTINPUT_FOUND)
   ADD_SUBDIRECTORY(osgdirectinput)
ENDIF(DIRECTINPUT_FOUND)

DirectX SDK 2009 is used here, but an older version like DX8 should
also work in my opinion.
"
2010-12-13 11:34:33 +00:00
Robert Osfield
14a12afb6c From Eduardo Poyart, "The attached patch fixes a race condition that caused OSG to try to render the scene before the window is realized. It works ok in my osgviewerWX-derived application under Linux." 2010-12-13 10:46:18 +00:00
Robert Osfield
c040b25699 Build fixes to keep up with changes in head inclusions/API in osgDB 2010-12-10 13:22:21 +00:00
Robert Osfield
8707758429 Added handling of CoordinateSystemNode when they decorate a loaded model, copying the contents of the CoordinateSystemNode across to the Terrain node 2010-12-09 12:16:11 +00:00
Robert Osfield
0754a78ddb From Ulrich Hertlein, "Attached; here's a summary of the changes:
- CMakeLists.txt
-- don't look for GL when compiling for iOS (device or simulator), look for OGLES instead
-- use architecture i386 for simulator
-- removed iphoneos-version-min for simulator

- examples/osgviewerIPhone/CMakeLists.txt
-- added build dependencies for osgdb_osg, osgdb_freetype, osgdb_imageio
-- added framework QuartzCore link dependency

- src/osgDB/CMakeLists.txt
-- don't link against Carbon on iOS (device or simulator)

- src/osgPlugins/freetype/CMakeLists.txt
-- don't link against OpenGL on iOS device or simulator

- src/osgViewer/CMakeLists.txt
-- link against OpenGLES on iOS (device or simulator)

- src/osgPlugins/imageio/CMakeLists.txt
-- compile ReaderWriterImageIO_IOS.cpp as Objective-C++

"
2010-12-02 14:20:52 +00:00
Robert Osfield
65aee287e7 From Mathias Froehlich, "Attached are most of the fixes that are required to build osg on solaris and
hpux. I have skipped irix this time as irix is too dead to keep osg building
there.

As usual, solaris does not like member templates in stl containers.
Some headers missing and link problems due to missing libraries."
2010-12-02 14:13:54 +00:00
Robert Osfield
e26eab96f4 Ran dos2unix to fix line endings 2010-12-02 14:01:54 +00:00
Robert Osfield
a38f5140ff From Jason Daly, "OK, I dug a bit into the CMake scripts and found a fairly obvious solution to the QtWebkit issue on RHEL 6 (see my other message on osg-users). I just moved the osgQtWidgets example in examples/CMakeLists.txt under the check for QtWebKit.
Fix is attached:"
2010-12-01 19:49:03 +00:00
Robert Osfield
5723050580 From Ulrich Hertlein and Stephan Huber, improves to iOS build 2010-11-30 09:26:18 +00:00
Robert Osfield
e5a9eaa711 From Tim Moore, "Here is initial support for uniform buffer objects. The binding between a buffer object and an indexed target is implemented as a new StateAttribute, UniformBufferBinding. I've included an example program based on the code in the ARB_uniform_buffer_object specification.
A few things remain to do:
* The binding between a uniform block in a shader program and a buffer indexed target number is fixed, like a vertex attribute binding. This is too restrictive because that binding can be changed without relinking the program. This mapping should be done by name in the same way that uniform values are handled i.e., like a pseudo state attribute;

* There's no direct way yet to query for the offset of uniforms in uniform block, so only the std140 layout is really usable. A helper class that implemented the std140 rules would be quite helpful for setting up uniform blocks without having to link a program first;

* There's no direct support for querying parameters such as the maximum block length, minimum offset alignment, etc. Having that information available outside of the draw thread would make certain instancing techniques easier to implement."
2010-11-29 17:43:27 +00:00
Robert Osfield
b523cb15c1 From Tomas Holgarth and Stephan Huber, "
attached you'll find the second part of the IOS-submission. It contains

* GraphicsWindowIOS, which supports external and "retina" displays,
 multisample-buffers (for IOS > 4.0) and multi-touch-events
* an ios-specific implementation of the imageio-plugin
* an iphone-viewer example
* cMake support for creating a xcode-project
* an updated ReadMe-file describing the necessary steps to get a
 working xcode-project-file from CMake

Please credit Thomas Hogarth and Stephan Huber for these changes.

This brings the ios-support in line with the git-fork on github. It
needs some more testing and some more love, the cmake-process is still a
little complicated.

You'll need a special version of the freetype lib compiled for IOS,
there's one bundled in the OpenFrameworks-distribution, which can be used."

Notes, from Robert Osfield, modified CMakeLists.txt files so that the IOS specific paths are within IF(APPLE) blocks.
2010-11-26 18:19:28 +00:00
Robert Osfield
8a929ea923 From Magnus Kessler, "Typo in usage string of examples/osganalysis
please specifies -> please specify"
2010-11-26 10:31:34 +00:00
Robert Osfield
1a227bf35e From Jean-Sebastien Guay, build fixes for windows. 2010-11-24 20:20:57 +00:00
Robert Osfield
0ee0aad0fe Moved TextNode from osgText into example/osgtext3D in prep for 3.0 2010-11-23 17:33:43 +00:00
Robert Osfield
04b6a0888b Build fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF 2010-11-22 19:38:18 +00:00
Robert Osfield
9b70348ced Fixed typo of commercial 2010-11-22 11:22:03 +00:00
Robert Osfield
a9b90b9652 Added texture pool handler to print out results from texture pool 2010-11-17 10:19:25 +00:00
Robert Osfield
c358c48db9 Added quite size test. 2010-11-17 10:16:45 +00:00
Robert Osfield
bda7ef8179 From Wang Rui, "I've finally completed the static build support for dotosg wrapper and
serialization libraries. My submission mainly includes:
1. Add two new macros USE_DOTOSGWRAPPER_LIBRARY and
USE_SERIALIZER_WRAPPER_LIBRARY. Applications using static OSG must
include corresponding static-link libraries and use these two macros
to predefine native format wrappers. Please see osgstaticviewer and
present3D in the attachment for details.

2. Add a LibraryWrapper.cpp file in each
osgWrappers/deprecated-dotosg/... and osgWrappers/serializers/...
subfolder, which calls all USE_...WRAPPERS macros inside. The
LibraryWrapper file is automatically generated by the
wrapper_includer.cpp (with some slight fixes), which is also attached
for your reference. The deprecated-dotosg/osgAnimation is not included
because it doesn't us REGISTER_DOTOSGWRAPPER to define its wrappers.

3. Modify the ReaderWriterOSG.cpp to prevent calling loadWrappers()
when static build.

4. An uncorrelated fix to Serializer and ObjectWrapper.cpp, which
ensures version variables of serialziers are initialized, and
serializers out-of-version are not written to model files.
"
2010-11-11 11:47:24 +00:00
Robert Osfield
be583ef0d6 From Jean-Sebastien Guay, "As promised, here is the fix for the background size. I also added another instance variable _lineHeight to clean up the code a bit more.
Also I've done the osguserstats example. I've kept the "toy example" that was in the modified osgviewer.cpp I had sent you, because they show different uses of custom stats lines (a value displayed directly, a value without bars and a value with bars and graph). I also added a function and a thread that will sleep for a given number of milliseconds and record this time in the stats. I think it clearly shows how to record the time some processing takes and add that to the stats graph, whether the processing takes place on the same thread as the viewer or on another thread.

BTW, feel free to modify the colors I've given to each user stats line... I'm not very artistic. :-)

I've also added more doc comments to the addUserStats() method in ViewerEventHandlers, so hopefully the arguments are clear and the way to get the results you want is also clear. Maybe I went overboard, but the function makes some assumptions that may not be obvious and has many arguments, so I preferred to be explicit."
2010-11-08 12:28:31 +00:00
Robert Osfield
286d4bceaa From Jan Klimke, "I did recently some work understanding the osgAnimation classes. Here the osganimationsolid example seems not to be very helpful at the moment. There are basically no comments in it and additionally there is a second animation defined which was simply not working (wrong channel type for angle animation). I added some comments and fixed the example to contain 2 working animations by now. I think this could help others who are trying to understand the osgAnimation plugin.
"
2010-11-04 15:24:00 +00:00
Robert Osfield
2d28026654 From David Fries, "Fix remote X11 crash querying GL_NUM_EXTENSIONS
In osg::isGLExtensionOrVersionSupported in src/osg/GLExtensions.cpp when
using indirect X11 rendering,
glGetIntegerv( GL_NUM_EXTENSIONS, &numExt );
is leaving numExt uninitilized causing the following glGetStringi to
return NULL when the extension number isn't present.  Passing NULL to
std::string() then crashes.  This is with the following nVidia driver.
OpenGL version string: 3.3.0 NVIDIA 256.35

I went ahead and initialized some of the other variables before
glGetInitegerv in other files as well.  I don't know for sure
which ones can fail, so I don't know which are strictly required.
"
2010-11-03 09:28:28 +00:00
Robert Osfield
2ce4b9d8e9 From Jean-Sebastien Guay, osgDB functions to expand wildcards - required to aid windows consule usage as this doesn't not automatically expand * usage. 2010-11-01 11:06:12 +00:00
Robert Osfield
862a0c68e3 From Mathias Goldau, "Added very brief documentation when to use the triangle mesh class. I
generated the make doc_openscenegraph target to verify that this change does
not break something.
"
2010-11-01 10:31:30 +00:00
Robert Osfield
e47946086b 2010-10-29 09:35:54 +00:00
Robert Osfield
13a8e92043 Added command line options:
--tristripper
--no-tristripper
--smoother
--no-smoother

--remove-duplicate-vertices / --rdv
--optimize-vertex-cache / --ovc
--optimize-vertex-order / --ovo
2010-10-26 14:59:12 +00:00
Robert Osfield
9978516bf7 Added number of primitive sets to on screen stats 2010-10-25 13:42:01 +00:00
Robert Osfield
30dbcf1c72 Added -o postfile option to allow the output of processed files
Disabled tri-stripping when simplifing to fix performance issue that introduces.
2010-10-23 09:51:11 +00:00
Robert Osfield
a2d99fc805 Added StateSetManipulator usage 2010-10-22 16:44:52 +00:00
Robert Osfield
123c0a36c4 Added support for enable VBO's and doing simplification. 2010-10-22 16:35:28 +00:00
Robert Osfield
89d09d7712 Cleaned up main loop, so it's more readable, seperating out the paging and non paging implementations 2010-10-22 12:28:50 +00:00
Robert Osfield
f91944fbbf Added paging support to osganalysis example 2010-10-22 12:19:22 +00:00
Robert Osfield
2014e85259 Added new osganalysis example as a testbed for profiling peformance of various aspects of OSG/OpenGL and scene graphs. 2010-10-21 16:28:23 +00:00
Robert Osfield
2aa231cd11 Disabled the build of Qt examples when building against GLES1 & 2 as Qt GL includes OpenGL headers itself that cause conflict. 2010-10-08 18:13:10 +00:00
Robert Osfield
078b21fa1e Build fixes for GLES1, GLES2 and GL3 2010-10-08 17:13:59 +00:00
Robert Osfield
d23ce985a1 Introduced osg namespace to new local GLU functions 2010-10-07 11:53:28 +00:00
Robert Osfield
12e6a23451 Introduced new gluScaleImage function that uses a PixelStorageModes structure to pass in details on image packing,
rather than relying upon glGet's to get the values.
2010-10-07 10:51:22 +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
b069b32c64 Added checks for NULL images to prevent crashes when no valid images are created 2010-10-04 11:19:41 +00:00
Robert Osfield
e5bc43f04c From Magnus Kessler, "After a closer look at this particular issue, I used some grep and sed magic
to fix all occurrences of "macro's" and "paramter".
"
2010-09-30 16:57:02 +00:00
Robert Osfield
dab1c79127 Moved handling of character aspect ratio into osgText::Style. 2010-09-29 12:45:35 +00:00
Robert Osfield
9bde24d3d2 Added command line option for writing out the scene graph to file. 2010-09-29 12:38:56 +00:00
Robert Osfield
f8b44c3b33 Added support for osgText::Style into osgText::Text3D.
Refactored Text3D implementation to use new GlyphGeometry class.
Implemented GlyphGeometry backend and cleaned up Glyph3D interface.
2010-09-27 16:18:20 +00:00
Robert Osfield
5ecc2b9880 From Wang Rui, reverted changes to osgPartcile that caused problems with osgparticleeffects. 2010-09-20 11:50:24 +00:00
Robert Osfield
4daad70d17 Build fixes for when OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION is disabled 2010-09-17 13:33:09 +00:00
Robert Osfield
7cc2d90725 From Ulrich Hertlein, "I've added a command line switch '--testOcclusion' that enables display of other models in
front and behind the outlined object."
2010-09-17 11:20:11 +00:00
Robert Osfield
d606bf0ba2 Fixed warning 2010-09-15 13:04:35 +00:00
Robert Osfield
cc471b1103 From Magnus Kessler, "Attached are a number of files where I have tried to fix up some of the
documentation. I have accumulated them over some time, but rebased onto the
subversion trunk."
2010-09-15 12:00:12 +00:00
Robert Osfield
b4789863ac Form Wang Rui, "An initial GLSL shader support of rendering particles. Only the POINT
type is supported at present. The attached osgparticleshader.cpp will
show how it works. It can also be placed in the examples folder. But I
just wonder how this example co-exists with another two (osgparticle
and osgparticleeffect)?

Member variables in Particle, including _alive, _current_size and
_current_alpha, are now merged into one Vec3 variable. Then we can
make use of the set...Pointer() methods to treat them as vertex
attribtues in GLSL. User interfaces are not changed.

Additional methods of ParticleSystem are introduced, including
setDefaultAttributesUsingShaders(), setSortMode() and
setVisibilityDistance(). You can see how they work in
osgparticleshader.cpp.

Additional user-defined particle type is introduced. Set the particle
type to USER and attach a drawable to the template. Be careful because
of possible huge memory consumption. It is highly suggested to use
display lists here.

The ParticleSystemUpdater can accepts ParticleSystem objects as child
drawables now. I myself think it is a little simpler in structure,
than creating a new geode for each particle system. Of course, the
latter is still compatible, and can be used to transform entire
particles in the world.

New particle operators: bounce, sink, damping, orbit and explosion.
The bounce and sink opeartors both use a concept of domains, and can
simulate a very basic collision of particles and objects.

New composite placer. It contains a set of placers and emit particles
from them randomly. The added virtual method size() of each placer
will help determine the probability of generating.

New virtual method operateParticles() for the Operator class. It
actually calls operate() for each particle, but can be overrode to use
speedup techniques like SSE, or even shaders in the future.

Partly fix a floating error of 'delta time' in emitter, program and
updaters. Previously they keep the _t0 variable seperately and compute
different copies of dt by themseleves, which makes some operators,
especially the BounceOperator, work incorrectly (because the dt in
operators and updaters are slightly different). Now a getDeltaTime()
method is maintained in ParticleSystem, and will return the unique dt
value (passing by reference) for use. This makes thing better, but
still very few unexpected behavours at present...

All dotosg and serialzier wrappers for functionalities above are provided.

...

According to some simple tests, the new shader support is slightly
efficient than ordinary glBegin()/end(). That means, I haven't got a
big improvement at present. I think the bottlenack here seems to be
the cull traversal time. Because operators go through the particle
list again and again (for example, the fountain in the shader example
requires 4 operators working all the time).

A really ideal solution here is to implement the particle operators in
shaders, too, and copy the results back to particle attributes. The
concept of GPGPU is good for implementing this. But in my opinion, the
Camera class seems to be too heavy for realizing such functionality in
a particle system. Myabe a light-weight ComputeDrawable class is
enough for receiving data as textures and outputting the results to
the FBO render buffer. What do you think then?

The floating error of emitters
(http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-May/028435.html)
is not solved this time. But what I think is worth testing is that we
could directly compute the node path from the emitter to the particle
system rather than multiplying the worldToLocal and LocalToWorld
matrices. I'll try this idea later.
"
2010-09-14 15:47:29 +00:00
Robert Osfield
77c35eabde From Jean-Sebastien Guay, "I've added a second ctor where no argument is optional, and documented that it's meant to be used when the InteractiveImage is going to be used in a fullscreen HUD.
"
2010-09-09 09:47:31 +00:00
Robert Osfield
d1ee7bca8d Removed files that have been moved into osgText. 2010-09-07 19:55:41 +00:00
Robert Osfield
50be800787 Moved TextNode into osgText.
Cleaned up freetype plugin so it no longer does tesselation - instead Glyph and TextNode do this.
2010-09-07 18:18:35 +00:00
Robert Osfield
a6abbb545e Further work on new 3D text support 2010-09-06 15:43:59 +00:00
Robert Osfield
32db4d6a98 Added basic wiring up of TextTechnique to 3D glyph code 2010-09-03 15:03:42 +00:00
Robert Osfield
8c3e3055e7 Refactored osgText::Font so that it now supports both 2D and 3D glyphs.
Added TextNode.h and TextNode.cpp to examples/osgtext3D in prep for introducing the new node to osgText library
2010-09-03 08:26:46 +00:00
Robert Osfield
0a429e97f7 Changed --flat to --flat-shaded to avoid conflict with oiginal --flat ratio control. 2010-08-25 14:34:08 +00:00
Robert Osfield
2ee999fb6e Cleaned up main and introduced --samples <num>, --flat, --smooth command line controls.
Add StatsHandler to viewer to enable review of different settings on number vertices/triangles.
2010-08-25 11:07:30 +00:00
Robert Osfield
6049f67a48 Implemented the shell geometry code 2010-08-24 16:08:50 +00:00
Robert Osfield
f3617062a0 Refactored 3d text geometry creation code so that the text is all placed in one osg::Geometry. 2010-08-24 14:22:58 +00:00
Robert Osfield
e4d8e560b0 Implemented generation of front, back and bevel geometries to complete the 3d glyphs. 2010-08-19 16:24:08 +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
9296391f1e Added bevel geometry 2010-07-26 11:12:45 +00:00
Robert Osfield
63ea6ae979 Clean up boudnary code 2010-07-26 11:06:45 +00:00
Robert Osfield
35fbe3ffb4 Implemented boundary polygon creation based on the refined boundary segments 2010-07-20 10:46:27 +00:00
Robert Osfield
0290405166 Added boundary bisector computation, bisector intersection thickness and segment removal. 2010-07-19 20:34:15 +00:00
Robert Osfield
41157e4dd8 Added computeIntersectionPoint and computeBisectorNormal functions 2010-07-17 12:03:17 +00:00
Robert Osfield
f2de3468ef Added handling of duplicate vertices 2010-07-15 11:32:31 +00:00
Robert Osfield
777763bc55 Added raw primitive and vertex data into the osgText::Font3D and FreeTypePlugin to aid development of new 3D text functionality.
Added new test for original 3D text support and new experimental code for exploring approaches to new 3D text support.
2010-07-14 18:50:41 +00:00
Robert Osfield
00f004fc38 From Mathias Froehlich, "I have now put together what I have for the order independent transparency or
short oit. This rendering technique is also known as depth peeling.

Attached is the example that makes depth peeling work with the fixed function
pipeline. Ok, this is 'old fashioned' but required for our use case that
still has to work on older UNIX OpenGL implementations as well as together
with a whole existing application making use of the fixed function pipeline.
I can imagine to add support for shaders when we have that shader composition
framework where we can add a second depth test in a generic way.

This does *not* implement the dual depth peeling described in a paper from the
ETH Zurich.

This example could serve as a test case for the feature that you can on the
fly remove pre render cameras that you made work a few time ago.
It is also a test case for the new TraversalOrderBin that is used to composite
the depth layers in the correct blend order.
This example also stresses your new texture object cache since you can change
some parameters for the oit implementation at runtime.

You can just load any model with osgoit and see how it works.
Use the usual help key to see what you can change.

There is already an osgdepthpeeling example that I could not really make sense
of up to now. So I just made something new without touching what I do not
understand."
2010-07-12 11:30:15 +00:00
Robert Osfield
64b26ebeb5 Added debug State::print(std::ostream&) method and extra debug messages in ShaderComposer and ShaderAttribute.
Added better shader composition testing in the osgshadercomposition example.
2010-07-10 17:14:59 +00:00
Robert Osfield
d50bf88bc0 Added some debugging to investigate issue of global default ShaderAttribute not being automatically assigned. 2010-07-07 11:02:15 +00:00
Robert Osfield
46b221a832 Added compile/release and resize of GL objects to ShaderAttribute.
Removed the StateAttribute::compose() method.

Fixed the default type value in ShaderAttribute
2010-07-06 12:19:26 +00:00
Robert Osfield
74ae526bb5 Added support for passing on uniforms from StateAttribute 2010-07-06 10:55:54 +00:00
Robert Osfield
751b0498fe Added basic code injection fields to osg::Shader,
creation of main shader to ShaderComposer and
collection of ShaderComponent to osg::State.
Also added very basic shader set up in osgshadecomposition example.
2010-07-05 16:32:58 +00:00
Robert Osfield
a55c4b7d70 Added basic ShaderComponent class and beginnings osgshadercomposition example 2010-07-02 12:04:20 +00:00
Robert Osfield
83ea076d8b Fixed typo 2010-06-24 15:43:33 +00:00
Robert Osfield
d138f99cf1 Renamed osgshadercompositor to osgvirtualprogram. 2010-06-24 14:03:51 +00:00
Robert Osfield
422a5e7058 Removed osgIntrospection as it's now available as a seperate osgIntrospection project that can be checked out thus:
svn co http://www.openscenegraph.org/svn/osg/osgIntrospection osgIntrospection
2010-06-23 13:28:19 +00:00
Robert Osfield
3ecccc4a50 From Nguyen Van Truong, introduced the use of the ScratchPad when distributing the master killed message 2010-06-17 14:36:11 +00:00
Robert Osfield
776c03b9e3 From Nguyen Van Truong, fix for passing of events to slaves 2010-06-17 14:28:16 +00:00
Robert Osfield
8fae9c5779 Added event handling 2010-06-17 14:18:11 +00:00
Robert Osfield
6cbce93aa4 From Jean-Sebastien Guay, "I've been working in the last few days
to get QWidgetImage to a point where it can fill a need we have: to be
able to use Qt to make HUDs and to display widgets over / inside an OSG
scene.

---------------
Current results
---------------
I've attached what I have at this point. The modified QWidgetImage +
QGraphicsViewAdapter classes can be rendered fullscreen (i.e. the Qt
QGraphicsView's size follows the size of the OSG window) or on a quad in
the scene as before. It will let events go through to OSG if no widget
is under the mouse when they happen (useful when used as a HUD with
transparent parts - a click-focus scheme could be added later too). It
also supercedes Martin Scheffler's submission because it adds a
getter/setter for the QGraphicsViewAdapter's background color (and the
user can set their widget to be transparent using
widget->setAttribute(Qt::WA_TranslucentBackground) themselves).

The included osgQtBrowser example has been modified to serve as a test
bed for these changes. It has lots more command line arguments than
before, some of which can be removed eventually (once things are
tested). Note that it may be interesting to change its name or split it
into two examples. Though if things go well, the specific QWebViewImage
class can be removed completely and we can consolidate to using
QWidgetImage everywhere, and then a single example to demonstrate it
would make more sense, albeit not named osgQtBrowser... You can try this
path by using the --useWidgetImage --useBrowser command line arguments -
this results in an equivalent setup to QWebViewImage, but using
QWidgetImage, and doesn't work completely yet for some unknown reason,
see below.

----------------
Remaining issues
----------------
There are a few issues left to fix, and for these I request the
community's assistance. They are not blockers for me, and with my
limited Qt experience I don't feel like I'm getting any closer to fixing
them, so if someone else could pitch in and see what they can find, it
would be appreciated. It would be really nice to get them fixed, that
way we'd really have a first-class integration of Qt widgets in an OSG
scene. The issues are noted in the osgQtBrowser.cpp source file, but
here they are too:

-------------------------------------------------------------------
  QWidgetImage still has some issues, some examples are:

  1. Editing in the QTextEdit doesn't work. Also when started with
     --useBrowser, editing in the search field on YouTube doesn't
     work. But that same search field when using QWebViewImage
     works... And editing in the text field in the pop-up getInteger
     dialog works too. All these cases use QGraphicsViewAdapter
     under the hood, so why do some work and others don't?

     a) osgQtBrowser --useWidgetImage [--fullscreen] (optional)
     b) Try to click in the QTextEdit and type, or to select text
        and drag-and-drop it somewhere else in the QTextEdit. These
        don't work.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) Try the operations in b), they all work.
     e) osgQtBrowser --useWidgetImage --useBrowser [--fullscreen]
     f) Try to click in the search field and type, it doesn't work.
     g) osgQtBrowser
     h) Try the operation in f), it works.

  2. Operations on floating windows (--numFloatingWindows 1 or more).
     Moving by dragging the titlebar, clicking the close button,
     resizing them, none of these work. I wonder if it's because the
     OS manages those functions (they're functions of the window
     decorations) so we need to do something special for that? But
     in --sanityCheck mode they work.

     a) osgQtBrowser --useWidgetImage --numFloatingWindows 1
                     [--fullscreen]
     b) Try to drag the floating window, click the close button, or
        drag its sides to resize it. None of these work.
     c) osgQtBrowser --useWidgetImage --numFloatingWindows 1
                     --sanityCheck
     d) Try the operations in b), all they work.
     e) osgQtBrowser --useWidgetImage [--fullscreen]
     f) Click the button so that the getInteger() dialog is
        displayed, then try to move that dialog or close it with the
        close button, these don't work.
     g) osgQtBrowser --useWidgetImage --sanityCheck
     h) Try the operation in f), it works.

  3. (Minor) The QGraphicsView's scrollbars don't appear when
     using QWidgetImage or QWebViewImage. QGraphicsView is a
     QAbstractScrollArea and it should display scrollbars as soon as
     the scene is too large to fit the view.

     a) osgQtBrowser --useWidgetImage --fullscreen
     b) Resize the OSG window so it's smaller than the QTextEdit.
        Scrollbars should appear but don't.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) Try the operation in b), scrollbars appear. Even if you have
        floating windows (by clicking the button or by adding
        --numFloatingWindows 1) and move them outside the view,
        scrollbars appear too. You can't test that case in OSG for
        now because of problem 2 above, but that's pretty cool.

  4. (Minor) In sanity check mode, the widget added to the
     QGraphicsView is centered. With QGraphicsViewAdapter, it is not.

     a) osgQtBrowser --useWidgetImage [--fullscreen]
     b) The QTextEdit and button are not in the center of the image
        generated by the QGraphicsViewAdapter.
     c) osgQtBrowser --useWidgetImage --sanityCheck
     d) The QTextEdit and button are in the center of the
        QGraphicsView.
-------------------------------------------------------------------

As you can see I've put specific repro steps there too, so it's clear
what I mean by a given problem. The --sanityCheck mode is useful to see
what should happen in a "normal" Qt app that demonstrates the same
situation, so hopefully we can get to a point where it behaves the same
with --sanityCheck and without."
2010-06-15 13:57:44 +00:00
Robert Osfield
1f2d381299 From Luc Frauciel, added extra test case accessible via -t 7. 2010-06-14 16:30:43 +00:00
Robert Osfield
e601bb9cc3 From Wang Rui, "For a long time, the osgviewerMFC example uses addSlave() to setup the
graphics context and link it with a slave camera. I don't know the
reason we perform like that, which will cause a problem that the
GUIEventHandler may not obtain correct window coordinates because the
main camera will use a default input range to receive events from the
slave camera's graphics context. It is also weird to see the
addSlave() used in non-cluster applications, which beginners will be
confused with.

I've make a slightly modification to the osgviewerMFC example to make
it work without setting slave cameras. I've tested with the MDI
framework and everything seems fine."
2010-06-14 15:25:05 +00:00
Robert Osfield
c32da14d60 Fixed permissions 2010-06-03 15:04:58 +00:00
Robert Osfield
2ea6aa050e Refactored the PagedLODList implementation so that it's now done via a base class that enables different implementations to be easily tried. Initial concrete PagedLODList is the SetBasedPagedLODList. 2010-06-03 14:14:40 +00:00
Robert Osfield
7c4f2b7d1f Added support for a wider range of gpx files 2010-05-31 15:51:59 +00:00
Robert Osfield
d26a8474e7 Changed the ref_ptr<T> observer_ptr<>::lock() method to be
bool observer_ptr<>::lock(ref_ptr<T>&) to avoid the temporary ref_ptr<>'s
being created and destroyed on the stack along with the associated ref/unref() operations
2010-05-28 08:57:48 +00:00
Robert Osfield
d746f11650 Renamed osgGA::MatrixManipualtor to osgGA::CameraManipulator so its name better reflects it's function 2010-05-27 15:54:37 +00:00
Robert Osfield
a79a13955a From Wojciech Lewandowski, "Support for compressed texture arrays + mipmaps + auto mipmap generation. Changes vs OSG trunk. Thanks to Ricardo Corsi I was able to add last time tweaks and remove few issues. This version was so well tested that it has to be posted for inclusion into OSG ;-)
"
2010-05-21 09:34:25 +00:00
Robert Osfield
68a1ed2dcf Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF.
Fixed copy and paste error in Camera::getImplicitBufferAttachmentResolveMask().
2010-05-12 11:37:27 +00:00
Robert Osfield
6d046e9fa1 From Wang Rui, "I've just made another OSG+Qt (GUI) examples to demonstrate how to create OSG views, add them to a CompositeViewer, and add corresponding widgets to Qt layouts or as popup windows. The example inherits a GraphicsWindowQt from the GraphicsWindow base class and implements most of the virtual methods. A QGLWidget is created at the same time to perform keyboards and mouse events, who is also added as the main widget's child.
The new example, named osgviewerQtContext (because of deriving from GraphicsContext), works fine on Windows XP SP3 and Qt 4.5.0, with 4 widgets in QGridLayout and a popup window and 60Hz frame rate. I haven't tested it on Unix/Linux and Mac OSX yet. So any feedback from these platforms is appreciated. I wish this example be a useful complement to current osgviewerQt and osgviewerQtWidgets ones. :)

Some unfinished functionalities: inheritedWindowData, sharedContext, and more tests needed."
2010-04-30 12:22:31 +00:00
Robert Osfield
4012841053 Fixed handling of Terrain/CoordinateSystem node so that the code now handles the fact that Terrain now subclasses from CoordinateSystemNode. 2010-04-29 09:46:14 +00:00
Robert Osfield
75fc7b6598 Fixed warnings 2010-04-23 08:58:57 +00:00
Robert Osfield
9e2ec85420 From Tim Moore, added check to whether validConfigs is empty. 2010-04-22 10:13:05 +00:00
Robert Osfield
a475da35e3 From Mourad Boufarguine, "When compiling the example on VS9, the compiler complain about undefined GL_DEPTH_COMPONENT32F and GL_DEPTH_COMPONENT32F_NV. So I added them to include/osg/FrameBufferObject. The example builds fine and is working for me without crashs unless it is ran whithout argument. I added couple of lines to check for arguments number and print the example usage when needed." 2010-04-21 16:37:28 +00:00
Robert Osfield
c0e9fcbb67 From Tim Moore, "This contains a couple of fixes to support changing FrameBufferObject configurations on the fly; the user changes the camera attachments and calls Renderer::setCameraRequiresSetUp(). The major part of this submission is a comprehensive example of setting up floating point depth buffers. The user can change the near plane value and cycle through the available combinations of depth format and multisample buffer formats." 2010-04-19 11:43:06 +00:00
Robert Osfield
488eac94f7 From Wang Rui, "Attached is the osgAnimation wrappers for serialize IO operations. A
few headers and the osgAnimation sources are also modified to make
everything goes well, including:

A new REGISTER_OBJECT_WRAPPER2 macro to wrap classes like
Skeleton::UpdateSkeleton.
A bug fix in the Seralizer header which avoids setting default values
to objects.
Naming style fixes in osgAnimation headers and sources, also in the
deprecated dotosg wrappers.
A bug fix for the XML support, to write char values correctly.
A small change in the osg::Geometry wrapper to ignore the
InternalGeometry property, which is used by the MorphGeometry and
should not be set by user applications.

The avatar.osg, nathan.osg and robot.osg data files all work fine with
serializers, with some 'unsupported wrapper' warnings when converting.
I'm thinking of removing these warnings by disabling related property
serializers (ComputeBoundingBoxCallback and Drawable::UpdateCallback),
which are seldom recorded by users.

By the way, I still wonder how would we handle the C4121 problem,
discussed some days before. The /Zp compile option is set to 16 in the
attached cmake script file. And is there a better solution now?"
2010-04-19 10:35:18 +00:00
Robert Osfield
15afc29018 Added window size event handler 2010-04-01 21:04:36 +00:00
Robert Osfield
31e526f253 Added TerainHandler event handler to provide 'v'/'V' and 'r'/'R' key controls for change vertical scale and sample ratio respectively. 2010-03-29 08:49:20 +00:00
Robert Osfield
75d1de3d15 Fixed warning 2010-03-25 14:12:28 +00:00
Robert Osfield
04e4fa74cc Added new osgterrain example that is simplified to just basic setup and control osgTerrain nodes, leaving the osgthreadedterrain as the more complex example. 2010-03-19 16:31:48 +00:00
Robert Osfield
e9cd6b140f Renamed source file 2010-03-19 16:30:56 +00:00
Robert Osfield
515e421e1e Renamed osgterrain to osgthreadedterrain to better reflect it's functionality. 2010-03-19 14:55:35 +00:00
Robert Osfield
c3b7a04cf1 Added StateSet event handler to osgfont and osgtext to aid with debugging 2010-03-18 17:10:48 +00:00
Robert Osfield
90bc608020 Fixed warning 2010-03-11 10:17:50 +00:00
Robert Osfield
1f01d30f72 Added tests of various FileNameUtils functions, tests invoked by osgunittests filenames 2010-03-10 12:13:31 +00:00
Robert Osfield
073a60b2a1 Fixes for warning from qt headers 2010-03-05 15:08:03 +00:00
Robert Osfield
3d87d6fcbb Removed files that are now part of osgQt 2010-03-05 15:07:11 +00:00
Robert Osfield
3cd0c50df3 From Mourad Boufarguine, "Some others modified CMake scripts :
- OsgMacroUtils.cmake, SETUP_LINK_LIBRARIES macro : allow linking with debug/release external libraries
- osgQt/CMakeLists.txt : fix the linking to Qt librairies + linking to debug Qt librairies if found
- examples/ qt examples :  linking to debug Qt librairies if found"
2010-03-05 12:43:03 +00:00
Robert Osfield
4b4dd94b5d Added an "-a" speed averager option and a "-o filename" output option. 2010-03-05 11:21:36 +00:00
Robert Osfield
1a1b7bd7a1 Moved QWebViewImage and QGraphicsViewAdapter into new osgQt utility library. 2010-03-04 12:15:35 +00:00
Robert Osfield
315e0521c9 From Martin Beckett, "I tested DJ's fix to stop flicker on Windows + Qt viewer on 2.6.7
It solves the problem on XP and Win7 on Qt 4.5 and 4.62
It isn't necessary on Linux (ubuntu 8.10/9.04 Qt 4.5/4.6.2) but doesn't cause any harm.
But I have #ifdef'ed it with WIN32. I can't test it on 64bit windows (not sure if x64 defines WIN32?)"
2010-03-03 10:11:54 +00:00
Robert Osfield
8a86f47276 From Chris Hanson, comment fix 2010-02-26 09:40:11 +00:00
Robert Osfield
74687953be From Jeremy Moles, submitted by Cedric Pinson "Here an new example from Jeremy Moles that demonstrate EaseMotion from
osgAnimation, i have updated EaseMotion with new type, so for users of
EaseMotion just have look, it's a great example."
2010-02-25 17:58:50 +00:00
Robert Osfield
c2d55fdb37 Fixed GLES1/GLES2 build 2010-02-19 20:58:46 +00:00
Robert Osfield
db4d58b01d From Cedric Pinson, "Here a list of changes:
Bone now inherit from MatrixTransform. It simplify a lot the update of
Bone matrix. It helps to have the bone system more generic. eg it's now
possible to have animation data with precomputed bind matrix. The other
benefit, is now the collada plugin will be able to use osgAnimation to
display skinned mesh. Michael Plating did a great work to improve this
aspect, he is working on the collada plugin and should be able to submit
a new version soon.
The RigGeometry has been refactored so now it works when you save and
reload RigGeometry because the source is not touched anymore. The
benefit with this update is that it should be now possible to use a
MorphGeometry as source for a RigGeometry.

The bad news is that the format has changed, so i have rebuild osg-data
related to osgAnimation data, updated the blender exporter to export to
the new format.
The fbx plugin could be touched about this commit, i dont compile it so
i can't give more information about it.
The bvh plugin has been updated by Wang rui so this one is fixed with
the new code of osgAnimation.
The examples has been updated to work with the new code too...

The example osg-data/example.osg should be remove, it's an old example
that does not work.

For people using blender the blender exporter up to date is here:
http://hg.plopbyte.net/osgexport2/
it will be merge to http://hg.plopbyte.net/osgexport/ as soon as the
modification will be push in the trunk.
"
2010-01-27 12:24:55 +00:00
Robert Osfield
09bb45ec79 Added .get() to fix build 2010-01-26 16:48:55 +00:00
Robert Osfield
865eb1df2f From Laurence Muller, "attached the CMakeList.txt to fix the issue described in: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2010-January/037792.html
Issue:
osgQtBrowser fails to compile because it can not find the QTCore header files

Fix:
Add the QT_QTCORE_INCLUDE_DIR to the CMakeList.txt file

Patch:
...\OpenSceneGraphSVN\examples\osgQtBrowser\CMakeLists.txt
change (line 17): INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} )
to (line 17): INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
"
2010-01-26 15:37:26 +00:00
Robert Osfield
5e9aedc8e1 From Laurens Voerman,"ttached is a updated version for
examples\osgautocapture\osgautocapture.cpp

-fixed a bug with --active command line option not rendering
-added --pbuffer command line option
-changed very confusing #ifdef 0
-added OSG_GLES GL_RGB readPixels support if available (UNTESTED)"
2010-01-26 11:37:24 +00:00
Robert Osfield
2a6719b7d8 From Jean-Sebastien Guay, build fixes for Mingw 2010-01-18 14:27:20 +00:00
Robert Osfield
5a9fbd60e6 Added missing .get()'s 2010-01-13 13:09:48 +00:00
Robert Osfield
5d9bf9f4d5 Added virtual pause() method into osg::AudioSink to support pausing of a movie thread and it's associated audio.
Updated osgmovie plugin to use the pause support.
2010-01-07 14:35:17 +00:00
Robert Osfield
e12bce86e7 Fixed warnings 2010-01-07 10:01:26 +00:00
Robert Osfield
9d5d68d0f0 Fixed compile warnings 2009-12-15 14:45:33 +00:00
Robert Osfield
8670be33c3 Added checked against QT webkit being available 2009-12-14 12:50:57 +00:00
Robert Osfield
98a63784b4 Fixed warnings 2009-12-14 12:49:59 +00:00
Robert Osfield
e0154c2d28 From Ulrich Hertlein, "attached is a stencil buffer-based constant-width outline f/x with example. I've also modified osgfxbrowser to setup the stencil buffer accordingly." 2009-12-08 17:41:44 +00:00
Robert Osfield
f1009763fc Added osggpx example to demonstate how to use the XmlParser and create line models.
To use :

  osggpx myterrainmodel.ive -t mytrack.gpx
2009-12-02 12:37:22 +00:00
Robert Osfield
b4562b0393 From Jean-Sebastien Guay, Explanation:
Currently osg2cpp removes "\n" line endings to replace them with a textual equivalent ("\\n") in order for the string representing the shader to contain line endings in the string. But if the file that was read contained Windows line endings ("\r\n"), the resulting file looked really weird (the \r were left there and editors interpreted that as an additional newline). Also, I can imagine that if the shader file that was read had Mac line endings ("\r") then the output shader would all end up in one long line since there are no "\n"...

What I've done:

I've added a search and replace of "\r\n" to "\n", and then "\r" to "\n" (note that the order is important).

I've also changed the filename handling so that the output file will be put in the same directory as the input file in case it was specified with a path. Previous functionality is retained for files specified with the filename only.""
2009-11-27 15:39:07 +00:00
Robert Osfield
7146f8a62f Added check for Geometry pointer being valid 2009-11-26 10:12:38 +00:00
Robert Osfield
e5b76975a9 For testing purposes added code path and options for testing viewer creation in series, including with enabling of VBO's. Options are:
osgcamera -r 5 --vbo cow.osg

Which repeats construction of the viewer 5 times in a row, and enables VBO, and on each repeat a new model is loaded.

  osgcamera -r 2 --vbo --shared cow.osg

Which repeats construction of the viewer 2 times in a row, and enables VBO, and on each loads the model once and shares it between each instance of the viewer.
2009-11-25 16:31:14 +00:00
Robert Osfield
90bd49100f Added support for repeating viewer construction 2009-11-25 16:20:25 +00:00
Robert Osfield
2f72c29bd4 From Sergey Leontyev, example for testing of DatabasePaging and CompositeView usage 2009-11-25 11:31:52 +00:00
Robert Osfield
a3adc3d07c From Martin Scheffler, "osgParticle: method to set start and end tile for particle texture (for animated particles). I also updated examples/osgParticle to show the feature.
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.
"
2009-11-24 15:00:11 +00:00
Robert Osfield
3ef770a9ff From Rafa Gaitan, "Current ffmpeg plugin didn't support pause and seek, I have added this
functionality and I also modified osgmovie example to support "seek"."

Note from Robert Osfield, changes osgmovie to use '>' for the seek as '+' was already used in a separate submission that had been merged.
2009-11-20 14:31:11 +00:00
Robert Osfield
e15006b194 From Cedric Pinson, "here an update of osgmovie example with the following features:
- play and pause now stop and play all streams given in the command line
(not only the first)
- add key + - to increase decrease the speed of all streams
- add key o to display all stream frame rate
"
2009-11-20 10:54:39 +00:00
Robert Osfield
6cc2ce5e4a Form Roland Smeenk, "Attached is a small change to the osgWidget::EventInterface so it matches the NotifyWidget and NullWidget interface (added const). Due to this mismatch these widgets never received events.
I also changed the osgwidgetbox example so the ColorWidget is receiving events again."
2009-11-19 11:30:22 +00:00
Robert Osfield
1bc204a87f From J.P. Delport, "simple addition to make the scroll wheel work in the example." 2009-11-19 11:21:05 +00:00
Robert Osfield
f38d1cdbb4 Fixed build 2009-11-19 10:47:42 +00:00
Robert Osfield
b7cabac990 From Mathias Froechlich, "Attached the collected fixes I needed to compile with all of them.
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 ..."
2009-11-18 12:15:29 +00:00
Robert Osfield
79f766efab Added OSG_CPP_EXCEPTIONS_AVAILABLE cmake option to enable optional build of plugins and examples that required C++ exceptions 2009-11-17 12:55:52 +00:00
Robert Osfield
22e01d3cba From Cedric Pinson, "After fixing Skeleton, i introduce a compile issue in
osganimationhardware example
I added a #include <osg/MatrixTransform> to fix it
"
2009-11-13 13:52:12 +00:00
Robert Osfield
e166b510c7 Improved compatibility with GLES2 2009-11-12 12:07:13 +00:00
Robert Osfield
b00ff07294 Changed default enabling of vertex attribute mapping 2009-11-10 12:03:03 +00:00