In the mean time I've learnt a bit more about the limitations of DOT3 bump mapping. This also explains why this isn't used much anymore.
- It works in object space, as opposed to shader based models which work in tangent space. - There is a requirement to fully uv-unwrap the model so each point on the object maps to a unique texel (you can't even exploit symmetries in the object) - One needs to encode the light vector as vertex colors (light position relative to each vertex, which is very important for point lights). This means updating the color array whenever the light source moves. - The UV maps have to be baked in object coordinates. You can't use bump maps created for tangent space or the lighting will be incorrect. - lots of limitation in the fixed function pipeline (ambient and specular lighting might be impossible in combination with DOT3) Christian 2016-05-19 12:52 GMT+02:00 Robert Osfield <[email protected]>: > Hi Christian, > > Thanks for the example. I've merged it with OpenSceneGraph-Data and > used the git author set to your name/email, looking at github this > means it links automatically with your git account. I hope this is > OK. > > Thanks, > Robert. > > > On 10 March 2016 at 16:20, Christian Buchner > <[email protected]> wrote: > > > > It appears there is almost no working example of an OSG object that uses > the > > fixed function pipeline DOT3 bump mapping technique. > > > > I am attaching an .osg file that features an animated light source that > > highlights the effect. In osgviewer rotate the box 90 degrees to the side > > for best effect. > > > > This is based on a really ancient forum posting from 2008, the OSG file > was > > manually cleaned up, removing unnecessary transparency and blending > effects. > > http://delta3d.org/forum/viewtopic.php?showtopic=12622 > > > > The stone wall texture and bump map was taken from this osg example > > repository: > > > https://bitbucket.org/kornerr/osg-deferred-shading/src/2b2f5532f41c305b31c46467291281388657b392?at=default > > > > Any other pairs of diffuse and normal textures might work just as fine. > Even > > if this does not make it into the OpenSceneGraph-Data repository, this > > posting will hopefully preserve the example for another 10 years ;-) > > > > Christian > > > > > > _______________________________________________ > > 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 >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
