Game Development Community

Shaders explained?

by Paul Weston · in Torque 3D Professional · 07/13/2011 (6:52 am) · 3 replies

Hello again everyone,

I am a bit embarrassed to ask this question since it is probably an obvious answer, but being focused mainly just on level design, script programming and adding existing resources to the engine I have never really had to deal with this end of things...

The question is, how do the shaders work in T3D? I am mystified by the shaders folder and the "clean shaders" batch file... Some of the people who downloaded our demo complain it won't run for them and their console.log files are always full of shader errors like:

GFXD3D9Shader::_compileShader - Error compiling shader: ERROR_MOD_NOT_FOUND: n/a (8007007e)
GFXD3D9Shader::_compileShader - no compiled code produced; possibly missing file 'shadergen:/b12a767dec12097c_V.hlsl'.

I would like to help these people out, the demo runs fine on any of my machines with none of these shader errors, so why does it happen on some systems and not others? Should I be cleaning all the shaders before I package the game, or for those who have already downloaded it and are having issues can we somehow clean up their shaders and they will be re-created properly by the game when it loads?

Again, sorry for my naivete, I am just totally clueless when it comes to the shaders, how they work, where they go, what their purpose is, how to change/modify them etc. My search through the documentation did not provide these answers so thought I'd post here.

Thanks for any feedback anyone can provide - just looking for a quick overview on this as well as some possible suggestions for clients who experience shader errors when trying to play our demo. What can I do for them to resolve these issues?

Cheers,
P

#1
07/13/2011 (8:38 am)
Could this be a Vista/Windows 7 issue with permissions. Torque 3D generates a bunch of procedural HLSL files at run-time.

They get generated to: ...FPS Examplegameshadersprocedural

However, if installed in Program Files directory, this likely will not work as Vista/Windows 7 does not allow writes to those directories.

Likely want to look at saving out those files and others that are saved out while running Torque 3D to Documents and Settings or AppData/Roaming

That is my guess anyway
#2
07/13/2011 (8:55 am)
Of course, that makes total sense...

Is there a way to modify the stock Torque installer package to NOT default to "Program Files" for the install folder? I'd rather install off the root to avoid these problems.

Thanks!
#3
07/13/2011 (11:48 am)
I use Junction (a windows program similar to linux ln command) to point the projects I want to use with torque to the My Projects directory. The benefits of this are 2-fold: no permissions issues and my projects living in source control can be outside of the Torque installed directory.

This is a solution, but may not be for everyone as it has some drawbacks:
- No visual identifier in XP (looks the same as a regular folder)
- Uninstalling Torque with a junction project directory deletes that directories contents

Heres a link to Junction:
http://technet.microsoft.com/en-us/sysinternals/bb896768