Game Development Community

How can you update the specular color dynamically?

by Dave Calabrese · in Torque Game Engine Advanced · 10/03/2008 (3:27 pm) · 2 replies

I've got an object in my game where I want to update the specular color on the fly, using ShaderGen. So I do the following in script...

myMaterial.specularColor[0] = "1.0 0.0 0.0 1.0";
reinitMaterials();

When I do this.... nothing happens. I have to flat out quit the game, change the specular color, save the material file, then reload. That doesn't seem right, since everything else I can change dynamically... so what's different about that?

-Dave Calabrese
Gaslight Studios

#1
10/03/2008 (4:24 pm)
Hopefully, this is just a mistype! There's no specularColor property, it's just specular[0] = "your color here".
#2
10/04/2008 (8:33 am)
Er.. wow, you're right, lol. That's usually proof when it's time for a weekend! ;)