Game Development Community

Enabling prepass buffer in basic lighting

by Guy Allard · in Torque 3D Professional · 12/09/2010 (4:47 pm) · 4 replies

I have a nice little postFX that gets depth information from prepass. Unfortunately, this only works with advanced lighting as prepass is unavailable to basic lighting.

I remember reading a thread some time ago (of course, the forum search won't find it again) where Tom Spilman implied that it was possible to get basic lighting to write to prepass. Can anyone give me an idea on how to achieve this?

#1
12/09/2010 (5:05 pm)
There is a fragment in basicLightManager.cpp

// If you would like to use forward shading, and have a linear depth 
// pre-pass than un-comment this code block.
#2
12/09/2010 (5:18 pm)
Indeed, I just noticed that too :)
#3
12/09/2010 (6:19 pm)
Hmm, it works as long as you don't change light managers. Switching light managers causes graphical corruption, even with the postFX disabled.

Changing from advanced to basic gives everything rendered red. Changing from basic to advanced gives a red 'tint' to certain parts of the terrain.

Strange. I assume that something is not getting cleaned up correctly during the switch.
#4
01/07/2011 (11:23 pm)
Logged as THREED-1305.