Commit Graph

8689 Commits

Author SHA1 Message Date
Robert Osfield
d952172559 From Tim Moore, "Double precision versions of BoundingBox and BoundingSphere are useful for doing computations in world coordinates, especially when working with a geocentric scene. By default, these classes are built using floats, so templated versions fill a need. I've used the double precision templates to fix some problems with ViewDependentShadow, which will follow shortly.
"
2008-11-26 16:39:52 +00:00
Robert Osfield
98c197edad added workaround of compile issues with templated version of BoundingBox 2008-11-26 16:00:27 +00:00
Robert Osfield
b813d1b31b Updated wrappers 2008-11-26 13:18:54 +00:00
Robert Osfield
d7c2d6863d From Andy Preece,
"To reproduce the bug:

   1. Create a template osg::Sequence node (and underlying geometry) but do not attach the node to the current active scenegraph.
   2. At some point during the rendering loop (perhaps on a keystroke) clone the sequence node (I use the call:

       dynamic_cast<osg::Node*>(templateNode -> clone( osg::CopyOp( (osg::CopyOp::CopyFlags)osg::CopyOp::DEEP_COPY_NODES ) ) )

   3. Set the cloned sequence node duration to a value that makes the animation run slower (i.e. 2.0).
   4. Start the cloned sequence (using setMode()).
   5. Repeat steps 2 \u2013 4 and observe that the cloned sequences do not run slow but run as fast, appearing to ignore the duration that has been set on them.

 

Looking at the \u2018good documentation\u2019 (2.4 source code), I see that _start is being set to _now (osg::Sequence::setMode(), line 192). Should this not _start not be set to -1.0?"
2008-11-26 12:50:12 +00:00
Robert Osfield
89ea6d596c Added searching for OpenEXR 2008-11-26 12:35:49 +00:00
Robert Osfield
51fee6f75c From Ragnar Hammarqvist, "I wrote an EXR image plug-in to osg, I would like to contribute this plug-in to the osg project if you find it useful.
The plug-in is a wrapper around open-exr (http://www.openexr.com) that consists of two projects, ilmbase-1.0.1 and openexr-1.6.1.

I have only tested it on windows XP 32 machine. So there might be some work making it work on other platforms.

The plug-in supports writing and reading EXR files. When writing it can use the data type GL_HALF_FLOAT_ARB(se ilmbase-1.0.1) and GL_FLOAT. When reading the data type always becomes GL_HALF_FLOAT_ARB. It supports textures with three and four channels.

When reading an exr file it automatically removes Alfa channel if it didn't store any information."

--

From Robert Osfield, started work on ported it to other platforms, but could fix some problems relating to error: 

        ?Imf::OStream::OStream(const Imf::OStream&)? is private

I'm checking in now so that others can have a bash at completing the port.
2008-11-26 12:35:25 +00:00
Robert Osfield
e02ae68aa9 From Gino van den Bergen, "The FindGDAL.cmake seems to be broken in OSG 2.6.1 for locating gdal.h through enviroment variable GDAL_DIR.
Also, I've modified the FindCOLLADA.cmake to locate the current 2.1 versions of the COLLADA DOM in the build directories under VC8. I've also added a COLLADA_LIBRARY_DEBUG spec. Other flavors may be added depending on compiler version and DOM version."
2008-11-26 12:07:03 +00:00
Robert Osfield
b147a22af1 From BjornHein, "attached a proposal for an extension for the the stl-File ReaderWriter. It allows saving of an osg node tree as stl file in ASCII-Format.
Standard is to generate one stl file.

With an additional option it is possible to write one file per Geode. This option is not very "useful" for typical application, I use it for separating and conversion of geometric data. So it could be removed if considered to special."
2008-11-26 11:45:33 +00:00
Robert Osfield
270fd48536 From John Vidar Larring, osgautocapture example that captures an image from a paged database by frame loop to the paging is complete, then takes a snapshot. 2008-11-26 11:23:06 +00:00
Robert Osfield
b2762c4788 Added DatabasePager::getRequestsInProgress() that return true if there are still tiles to load.
Added DatabasePager::setTargetMaximumNumberOfPageLOD(..) that sets the target number of PagedLOD to try and maintain
2008-11-26 11:12:19 +00:00
Robert Osfield
e3d1c4ba04 From Piotr Rak, "added bool conversion for ref_ptr, when no implicit conversion to T* is used." 2008-11-25 16:24:50 +00:00
Robert Osfield
a7a7115581 Fix for build with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION off 2008-11-25 15:57:27 +00:00
Robert Osfield
1228897b72 Fixed build for when OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION is off 2008-11-25 15:38:11 +00:00
Robert Osfield
8ea639f564 Updated wrappers 2008-11-25 14:40:02 +00:00
Robert Osfield
017b4315bc From Joakim Simmonsson, fix for handling of billboards in FLATTEN_STATIC_TRANSFORMS_DUPLICATING_SHARED_SUBGRAPHS 2008-11-25 14:31:19 +00:00
Robert Osfield
b6fe330b85 Added support for unsigned int uniforms 2008-11-25 14:15:55 +00:00
Robert Osfield
0d8ae3bd66 From Ferdi Smit, added support for unsigned int typed uniforms 2008-11-25 14:15:35 +00:00
Robert Osfield
a751eb0326 From Urlich Hertlein, "Attached is a patched version that replaces calls to atof() with osg::asciiToFloat()." 2008-11-25 13:45:27 +00:00
Robert Osfield
b7882c57f8 Fixed warning and some unitialized variables. 2008-11-25 12:22:33 +00:00
Robert Osfield
a1f59b6241 Fixed warning 2008-11-25 11:09:40 +00:00
Robert Osfield
d08d778608 From Jaromir Vitek, "In attachment are another fixes for using packed depth+stencil (PDS).
* 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."
2008-11-25 10:57:14 +00:00
Robert Osfield
410b90334a From Wojciech Lewandowski, "I have restored MSVC disabled warnings in osg/Export. Difference is they are now disabled only when OSG_DISABLE_MSVC_WARNINGS macro is defined. This macro is set through CMake options and autogenerated in osg/Config. Simon suggested that it would be cool if we had more control over selected warnings. I tried to learn how to make selection of individual warning numbers possible, but had to gave up as my cmake skills were not sufficient. The only way I saw this possible would be adding one define for each MSVC warning number. But many definitions seemed too be to much clutter for osg/Config file so I rejected thar idea. For this it would be cool if autogenerated Config entries could more powerful than simple #define/#undef flags. Maybe Cmake gurus know how to do it.
I have not reverted added Compiler options. I assume that one may want to have warnings enabled for the application but may not want to see them while OSG libraries and examples compile.

Modified files:

osg/Export   - now explicitly includes osg/Config to make sure OSG_DISABLE_MSVC_WARNINGS is read
osg/Config.in  - declares OSG_DISABLE_MSVC_WARNINGS flag to be added to autogenerated osg/Config
CMakeLists.txt - declares OSG_DISABLE_MSVC_WARNINGS as option with default ON setting
"
2008-11-24 16:32:52 +00:00
Robert Osfield
f92baedf2b From Marco Jez, "The DDS plugin currently prints too many NOTICE messages that, given their nature and frequency, should really be demoted to INFO or DEBUG severity. Fix is attached." 2008-11-24 16:26:15 +00:00
Robert Osfield
8527492638 From Alberto Luaces, removed #include <cmath> as it was cause a build problem under Cygwin. 2008-11-24 16:09:43 +00:00
Robert Osfield
2517c1e77e Improved the set of the master + slave cameras 2008-11-24 16:02:20 +00:00
Robert Osfield
9addcc050d From Rolad Smeenk, "Forgot a call to uniqify when generating an Id based on osg::Node name." 2008-11-24 15:27:19 +00:00
Robert Osfield
6ae07ce0e2 From Roland Smeenk, "This application can be used for testing plugins that can both read and write a certain file format. It will display the original file next to the written and reread file.
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"
2008-11-24 14:37:15 +00:00
Robert Osfield
6bdd83413d From Roland Smeenk, "Overview of the Collada/dae plugin changes
New features
+Read and write of osg::LOD, osg::Switch, osgSim::Sequence, osgim::MultiSwitch and osgSim::DOFTransform data in <extra>
+Read and write of osg::Node description data in <extra>
+Plugin option "NoExtras" to prevent writing of <extra> data and only traverse the active children when saving
 
Changes/additions
+instanced_geometry and instanced_controller are now loaded in a single Geode with multiple Geometries instead of multiple geodes with a single Geometry
+Changed all calls to the deprecated createAndPlace() to the new add() methods
+All transformation elements <scale>, <rotate>, <translate>, <lookat>, <matrix>, <skew> are now concatenated properly in to a single MatrixTransform.
 Previously this was not done in order as required by Collada and and not all elements were included.
+Complete skew matrix creation
+Automatically add GL_RESCALE_NORMAL if scale is non-identity
+Blinn shininess remapping to [0,128] when in range [0,1]
+Changes to CMake file to make it compile on Windows
+Coding style and code documentation
 
Bug fixes
+Transparent texture writing fixed
+Fixed bug in using osg node name as collada node ID
+Fixed usage of double sided faces in GOOGLEEARTH extra
+Not adding blendfunc and blendcolor when opaque
 
TODO/Wishlist
-solve differences in drawables, DAE reader should place multiple collation elements into multiple primitivesets in a single geometry where possible (only when same material)
-solve differences in matrices
-multitexture support
-skinned mesh and generic animations using osgAnimation
-profile_GLSL based on COLLADA OpenGL Effects Viewer http://ati.amd.com/developer/rendermonkey/downloads.html
-handling more <extra> to more closely mimic the intended lighting"
2008-11-24 14:26:04 +00:00
Robert Osfield
d25de5e92e Replaced usage atof to asciiToFloat. 2008-11-24 13:50:28 +00:00
Robert Osfield
fccd05b290 Converted OpenGL version number code to using osg::asciiToFloat to avoid issues with conversion using locale senstive atof function 2008-11-24 13:19:01 +00:00
Robert Osfield
bf8c3cc07e From Jason Daly, "This is a plugin (two, actually) that will allow OSG to load .bsp map files from Valve's Source Engine games (Half-Life 2, etc.). One plugin (called "vbsp" to distinguish it from the Quake 3 bsp loader) reads the .bsp file itself, and the other ("vtf") reads the texture files.
The set up for this to work is a bit more complex than most files, since the engine expects all files to be in a certain place, and it tends to mix case a lot.  I tried to explain everything in the VBSP_README.txt file."

This plugin has been integrated with the pre-exisiting bsp plugin.
2008-11-24 11:39:02 +00:00
Robert Osfield
38f7fabb10 Renamig of files in prep of merge of valve bsp support 2008-11-24 10:28:19 +00:00
Robert Osfield
ed918cf6be From Tim Moore, "the GraphicsWindowX11 code was not correctly calling GraphicsContext::resized when the window was not mapped with the requested geometry." 2008-11-24 10:16:03 +00:00
Robert Osfield
d7ba995370 Updated wrappers 2008-11-24 10:13:27 +00:00
Robert Osfield
f1b5b75128 Added mechnism for tracking when a VncImage is inactive or not. 2008-11-23 17:28:13 +00:00
Robert Osfield
5b15436935 Added mechanism for tracking when interactive images are being rendered to
enable their backends to only rendered them when they are actively being rendered
in the OpenGL window.
2008-11-23 15:51:43 +00:00
Robert Osfield
8264b31fa1 Introduce osg::asciiToDouble/asciiToFloat function. 2008-11-23 11:35:43 +00:00
Robert Osfield
d946a6536e From Ulrich Hertlein, "I noticed some regression in the BMP loader - some 8-bit (paletted) files wouldn't load anymore but simply crash.
After taking a look at the current state of the BMP loader I decided it might be worth a shot at reimplementing that part.  For example: the current loader doesn't properly handle 1- and 4-bit files, incorrectly loads 16-bit files as intensity-alpha (they are RGB555), is full of dead code, and generally not in very good shape.

Attached is my re-implementation for review.

I've checked it against the test images from http://wvnvaxa.wvnet.edu/vmswww/bmp.html and models that use BMP files.
"
2008-11-23 10:20:50 +00:00
Robert Osfield
d0994c4ad3 From Paul Martz, added missing export 2008-11-23 09:57:41 +00:00
Robert Osfield
9f55408ca3 Removed the optional build for osgWidget and plugins as these are options that are appropriate for building all the time 2008-11-22 14:30:21 +00:00
Robert Osfield
56a2cc65d0 From Cedric Pinson, Pulled in osgAnimation from OpenSceneGraph-osgWidget-dev into svn/trunk. 2008-11-22 12:14:19 +00:00
Robert Osfield
fdaa75400b From Danny Valente, submitted bu Jean-Sebastien Guay, "Some context: In the past I submitted a fix to osgViewer::CompositeViewer where events would get wrong input ranges. Later, you made a change to set the eventState's current graphics context to the current graphics context. However, there's a problem in the sequence of events. Here's the recap (doing a graphical diff with the attached file will show this clearly):
Before:

1. if the camera is not a slave camera
  1.1 set the eventState's graphics context to the current context.
2. if the current master view is not the view which has the focus
  2.1 set the current master view to be the view which has the focus
  2.2 use the new master view's eventState instead of the old one

Now as you can see from this sequence, the graphics context is set on the eventState before switching to the view which has focus (and thus using another eventState). So the new eventState, in the case we need to switch views, will contain an old graphics context, not the correct one.

Just inversing these steps fixes the problem:

1. if the current master view is not the view which has the focus
  1.1 set the current master view to be the view which has the focus
  1.2 use the new master view's eventState instead of the old one
2. if the camera is not a slave camera
  2.1 set the eventState's graphics context to the current context.

Now, the eventState will refer to the correct graphics context in both cases.

Attached is a fixed CompositeViewer.cpp (based on today's SVN) which does this. Note that some other things are done in the 1. and 2. cases, but they have no influence on each other so they can just be swapped without problems.
"
2008-11-21 18:16:43 +00:00
Robert Osfield
6524788516 Added handling of View::LightingMode 2008-11-21 17:44:16 +00:00
Robert Osfield
d423aff288 Build fix 2008-11-21 17:10:41 +00:00
Robert Osfield
59df690e3e Added exports 2008-11-21 16:09:28 +00:00
Robert Osfield
e158c78ffa From David Spilling, better support for multitexture in obj loader. 2008-11-21 13:23:55 +00:00
Robert Osfield
d903423ded From Jaromir Vitek, osgpackeddepthstencil example as a test case. 2008-11-21 12:38:22 +00:00
Robert Osfield
2c4bb15bb6 Updated wrappers 2008-11-21 12:31:28 +00:00
Robert Osfield
344908faad Made the ParticleSystemUpdate::addParticleSystem, removeParticleSystem, replaceParticleSystem and setParticleSystem methods all virtual to allow them to be overriden. 2008-11-21 12:30:12 +00:00
Robert Osfield
a90bdd1833 From Mario Valle, "Attached two small correction to remove the following warnings from MINGW build." 2008-11-21 12:15:16 +00:00