[osg-users] Computing Normals for Drawables
s.d.hammett at googlemail.com
Fri Nov 6 13:34:08 PST 2009
2009/11/6 Jean-Sébastien Guay <jean-sebastien.guay at cm-labs.com>:
> Hi Simon,
>> 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.
Ah I didn't know that, ty. Seems like an odd limitation though.
How does the angles thing work? Not sure I follow you.
If you did the normal lookup, wouldn't you save a whole load
of shader processing time, or is memory bandwidth a bigger limitation with
More information about the osg-users