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 Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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