[osg-users] Computing Normals for Drawables
jean-sebastien.guay at cm-labs.com
Fri Nov 6 11:31:42 PST 2009
> I'm not familiar enough with shaders though to say it's actually
> possible to do that., but it looks doable.
Totally, it's good idea. It's actually reminiscent of spherical
harmonics, but in reverse (instead of sampling illumination in all
directions on a sphere, you're choosing the direction that best
represents the normal).
The only thing is that the smallest unit for per-vertex attributes is a
32-bit float, so using a byte doesn't necessarily save anything over a
normal stored as theta+phi angles quantized to two half-floats, and that
way you don't need the lookup table of normals to index into.
But it's a good idea, I agree, as long as you can accept a slight loss
in lighting quality because of approximated normals (will probably show
up as banding on smooth surfaces).
Jean-Sebastien Guay jean-sebastien.guay at cm-labs.com
More information about the osg-users