Mark.. Blitz's Z-buffer accessible, but...

Blitz3D Forums/Blitz3D Programming/Mark.. Blitz's Z-buffer accessible, but...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

"sswift: Would having zbuffer access benefit your shadow routines?"


No, not really.

In fact, without pixel shaders, I'm not sure that having access to the zbuffer would allow us to generate zbuffer shadows in realtime.

The traditional way would be to generate a zbuffer for the camera, and a zbuffer for the light source, and then using the distance of each pixel in the camera view from the camera, transform that pixel to light space to camera space, and then determine if the pixel's Z value in light space is greater than the distance of the pixel at that location which is in the light's zbuffer. If so, then it is in shadow.

This would be expensive.