TSE/TipsAndTricks

From TDN

This page is a Work In Progress.

Turning off procedural shader generation

The engine can be set so new shaders are not generated. The engine will load and compile whatever shaders were previously created. This is useful for debugging and modifying procedural shaders.

To turn off the generation of shaders, comment out the GEN_NEW_SHADERS preprocessor definition in shaderGen/shaderGen.cpp. Recompile and the next time it runs, the shaders will be read from disk only.

Forcing a pixel shader class

If running on hardware that has pixel shader support greater than that which is to be supported by a product, it's useful to be able to force the pixel version down to a lower level. It allows debugging and testing on that class of hardware without needing to actually install it.

To force the engine to run at a particular version, look at the client/prefs.cs file. Change $pref::Video::forcePixVersion to 1. Then change $pref::Video::forcedPixVersion to whatever you wish to force it to (1.1, 1.4, 2.0, etc). Check the console when the engine has started up to see if it has worked. It should have the lines:

Pix version detected: X
Forced pix version: Y

Note

Forcing a pixel version higher than what is supported by your hardware will cause errors.

Shader Compile Errors

Shader compile errors (and all console errors) are echoed to the Visual C++ IDE. Click on the shader error in the IDE output window and it will bring up the shader file and line that is bad.