Hi Jaap, I have been working on new shaders for volume rendering over the past week and this work will replace the current volume shaders. The new shaders I'm using int's for the loop iteration.
The original shaders used floats as hardware at the time didn't support ints so I coded to it, quite a few years on now and int's are supported in hardware. Robert. On 4 December 2013 11:29, Jaap Glas <[email protected]> wrote: > Dear all, > > > I am an employee of dGB Earth Sciences, and we are still porting > the 3D visualization of our open-source seismic interpretation > package OpendTect to OpenSceneGraph. > > I want to report a numerical bug in ALL fragment shaders coming with > OpenSceneGraph, i.e. those in the src/osgVolume/Shaders directory. > > The line: " while(num_iterations>0.0)\n" > should be: " while(num_iterations>0.5)\n" > > The loop variable num_iterations is probably made "float" instead > of "int" for a good reason, but depending on its start value, now > very small numerical errors may sometimes lead to the execution > of one iteration more than intended. This can be solved easily > by having the stop criterion test halfway two consecutive > iteration values. > > This bug manifested itself when extending the RayTracedTechnique > with an option to use the NEAREST texture filters instead of the > default LINEAR texture filters. Serious artifacts were "walking" > over the surface of the volume when rotating the scene. After > discovering and fixing this bug, these artifacts disappeared. > > I have attached one modified fragment shader file from the > latest trunk: src/osgVolume/Shaders/volume_frag.cpp, but > the fix should apply to all. > > > Best regards, > > Jaap Glas > > -- > -- dr. Jaap C. Glas > -- Software Engineer > -- dGB Earth Sciences > -- Nijverheidstraat 11-2 > -- 7511 JM Enschede, The Netherlands > -- [email protected] > -- http://www.dgbes.com > -- Tel: +31 534315155, Fax: +31 534315104 > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
