Game Development Community

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!

#1
05/09/2005 (11:36 am)
Well after a little more research it appears that the whole client/server concept isn't even used when running the Show Tool. I'm basing that on the fact that NetConnection::eventReadPacket never gets called (which is what calls the SimDataBlockEvent code that eventually triggers the "preload" on the shader objects).

So... can anybody tell me how to properly initialize the shaders in a client-only environment?

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.
#3
05/10/2005 (1:16 pm)
Thanks, Ben.

Brian, if you're out there... :-)
#4
05/10/2005 (4:10 pm)
Try using -show modname for your parameter instead of -mod show. Ie. "-show demo".
#5
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?