Game Development Community

TGEA 1.8 Bug -- Lighting Preferences Problem

by Jeff Faust · in Torque Game Engine Advanced · 01/07/2009 (1:06 pm) · 2 replies

A bunch of lighting preferences (UseDynamicShadows, UseDynamicRangeLighting, etc) are initialized in the sgLightManager::sgInit() method found in lightingSystem/synapseGaming/sgLightManager.cpp. Most other Torque preferences are initialized in a consoleInit() method.

Now, the consoleInit() methods are all called very early in the start-up process so these preference variables all exist by the time the various defaults.cs and prefs.cs files become exec'd. But sgLightManager::sgInit() is called much later, not even before a mission is loaded. This means that none of the lighting preferences exist at the time the defaults.cs and prefs.cs files are exec'd and the preference variables will all assume their initial values as hard-coded in C++. Effectively, this makes it impossible to set any of these lighting preferences following the usual Torque conventions.

For example: Dynamic shadows currently don't work on Mac OS-X for TGEA 1.8, but there's no way to set $pref::sgLightManager::UseDynamicShadows to false in defaults.cs. One must change the default value in sgLightManager.cpp and recompile.

About the author

Jeff Faust creates special effects indie middleware and games for Faust Logic. --- Blog: Effectronica.com --- Twitter: @FaustLogic


#1
01/23/2009 (8:42 pm)
1) You can fix this by removing the call to sgInit() in sgLightManager::activate and adding
static ProcessRegisterInit doSgInit(&sgLightManager::sgInit);
anywhere in the file (I stuck it right above sgLightManager::sgInit)

2) This was made more interesting to debug because the defaults.cs file had the wrong names for all of the sgLightManager prefs. I've fixed that too.

3) "Dynamic shadows don't currently work on Mac OS X"? They work fine for me on my iMac and MacBook Pro.
#2
01/26/2009 (7:06 am)
I thought dynamic shadows were known deficiencies in 1.8 on the Mac, based on comments made by Matt Fairfax on his original 1.8 release blog. He referred to it as "self shadowing" and I probably was mistaken when I assumed he meant dynamic shadows.

Anyway, dynamic shadows don't work for me at all on my MacBook not-Pro. There is a texture projected, but it's always a garbage texture.