Game Development Community

Turning off shader generation produces shader errors

by Jeff Faust · in Torque 3D Professional · 06/16/2009 (8:51 am) · 6 replies

The handling of autogenConditioners appears to cause errors when shader generation is turned off (by setting $ShaderGen::GenNewShaders = false;).

autogenConditioners.h is still created when shader generation is off and this seems to cause problems because the hash numbers for lightinfoUncondition() become inconsistent.

Disabling creation and deletion of autogenConditioners.h when GenNewShaders=false comes close to fixing the problem, but then some shaders will no longer resolve their lightinfoUncondition() calls. I think this has something to do with the hash changing, but I don't understand what's going on here well enough to find a fix.

About the author

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


#1
06/16/2009 (1:19 pm)
Hum... not sure why the hash is changing. It really should be consistant.

That said currently Basic and Advanced Lighting could have the same hash results for the procedural shaders.

Both of these need to be solved for $ShaderGen::GenNewShaders to work well.
#2
06/16/2009 (1:55 pm)
My theorizing about the hash is probably wrong...

I did some new tests... when GenNewShaders is false, autogenConditioners.h does still get regenerated, but it's identical to the old one, so that must not be the problem.

Still, when GenNewShaders is false, some shaders produce the error:
"undeclared identifier 'lightinfoUncondition'"
and don't do the lighting correctly.

They work again once GenNewShaders is true again.

#3
06/16/2009 (2:28 pm)
Hum... what is supposed to happen is the ProcessShaderMaterial is supposed to pass....
#define lightinfoUncondition autogenUncondition_bde4cbab
... down to shadergen via the shader macros. If its not finding lightinfoUncondition then i suppose that macro isn't being passed down in that case.
#4
06/24/2009 (6:52 pm)
Yaa Jeff's Here! That means very very good things!
#5
06/26/2009 (2:56 pm)
Logged as THREED-530
#6
09/04/2009 (6:32 pm)
Update: Fixed for the next release.