so i've come across two different algos for two sided lighting:
1. turn cull on, set winding CCW, set shader param invert_normals to false, then draw, then set winding to CW, set invert_normals to true, and draw again. this seems to be a popular algo. an example can be found here:
http://www.fairyengine.com/articles/hlsl2sided.htm
2. turn cull off, pass camera direction vector as a parameter to the shader. in the shader, if view_dir dot normal > 0, the normal is backfacing, so invert it before doing lighting calculations. I have only seen this mentioned one place - right here, by our very own Buckeye:
he started with a single quad with two normals per vertex facing opposite directions, then realized he could do the view_dir dot normal test. in the thread he says its faster than algo #1 in testing. makes sense - just one draw call vs two, no culling vs cull testing everything.twice, and the same number of tris rasterized either way.
I haven't looked up view_dir dot normal yet - is it correct? I assume so, but want to be certain. sure wish i remembered some of the linear i took. got an A and can't remember jack!
and it is the camera's "look at" direction vector that he's referring to as view direction, right? that doesn't have to be normalized, does it? don't think so...
any reason not to go with algo #2 ?
anyone heard of algo #2 before, or did Buckeye invent it?