Shaders in Torque 3D and elsewere?
by Martin Askestad · in Torque 3D Beginner · 01/02/2012 (4:32 am) · 0 replies
When I'm experimenting with shaders in FX Composer or an old program called Dark Shader, the HLSL code usually consists of both the pixel and vertex shaders, functions variables and a block called technique. And the technique has one or more passes. I assume that these passes are what trigger the execution of the shader code.
When I look at a shader in Torque there are no technique block, no passes and the Vertex and Pixel shaders are stored in two different files. They do seem to have a main function however.
So I was wondering, if I want to make my own shader and move it in to Torque, do I just have to rewrite the compile statement of a shader in FX Composer for example to a main function and it will work?
Also, the documentation says that if a shader doesn't have the .hsls file extension, assembly language is assumed. So perhaps I should compile my shader first and then add the compiled version to Torque?
Any suggestions on how I can proceed?
When I look at a shader in Torque there are no technique block, no passes and the Vertex and Pixel shaders are stored in two different files. They do seem to have a main function however.
So I was wondering, if I want to make my own shader and move it in to Torque, do I just have to rewrite the compile statement of a shader in FX Composer for example to a main function and it will work?
Also, the documentation says that if a shader doesn't have the .hsls file extension, assembly language is assumed. So perhaps I should compile my shader first and then add the compiled version to Torque?
Any suggestions on how I can proceed?
About the author
Always have ideas for new games. But not always the motivation or the skill.