Pseudodepth and lights in Balder

After a few hours in the world of Balder, I managed to fight the evil wizard of the Z-buffer and projection mapping for rendering sprites correctly. Or, at least I hope so!
I used the distance vector from origo( using the cameras local coordinate system ) to the sprite P in order to scale it correctly using a pseudodepth function: 2*NearPlane/P.z.
 
Also, I finished implementing the basic lights: directional light and omni lights. Both lights got support for ambient, diffuse and specular lights, including self-shadowing.
This entry was posted in Balder3D. Bookmark the permalink.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.