Custom shaders not visible in Show Tool
by Justin Tolchin · in Torque Game Engine Advanced · 05/06/2005 (1:55 pm) · 5 replies
Hi all,
I have a custom material/shader on a model which works fine in-game, but when I try to view the model using "-mod show" the model just shows up black. I have moved the appropriate lines into "materialMap.cs", "materials.cs" and "shaders.cs". I noticed that when I run the game normally I get calls into "GFXD3DShader::initVertShader" and I can see my custom shader's .hlsl file name passed in. But when I run the show tool this doesn't happen.
It seems like it's all linked to the "preload" function for the ShaderData datablocks, which never gets called. I am definitely exec'ing the "shaders.cs" file (I can see it in console.log) so I don't know why the preload stuff isn't getting invoked. Is there something special about the show tool that prevents this?
Thanks!
I have a custom material/shader on a model which works fine in-game, but when I try to view the model using "-mod show" the model just shows up black. I have moved the appropriate lines into "materialMap.cs", "materials.cs" and "shaders.cs". I noticed that when I run the game normally I get calls into "GFXD3DShader::initVertShader" and I can see my custom shader's .hlsl file name passed in. But when I run the show tool this doesn't happen.
It seems like it's all linked to the "preload" function for the ShaderData datablocks, which never gets called. I am definitely exec'ing the "shaders.cs" file (I can see it in console.log) so I don't know why the preload stuff isn't getting invoked. Is there something special about the show tool that prevents this?
Thanks!
#2
05/10/2005 (1:15 pm)
I know we had this working; I'll have to let Brian reply tho because I've not been involved in that quadrant of things.
#4
05/10/2005 (4:10 pm)
Try using -show modname for your parameter instead of -mod show. Ie. "-show demo".
#5
It's interesting. Now the "initVertShader" method gets called, but only for one shader: "blurV.hlsl". Why just that one?
05/10/2005 (4:31 pm)
Thanks, Brian. It's interesting. Now the "initVertShader" method gets called, but only for one shader: "blurV.hlsl". Why just that one?
Torque Owner Justin Tolchin
So... can anybody tell me how to properly initialize the shaders in a client-only environment?
Thanks!