Scalar functions in shaders now supported. I hardcoded it to 4 float variables (scalarA, scalarB, scalarC, scalarD) but this can be expanded later if I feel like it. Basically you can write in your shader like:
diffuse=tex<0,1,1,0,0,0,0,rgb> * scalarA
or
diffuse=tex<0,1,1,0,0,0,scalarA,rgb>
And then you can create an object like a weapon or vehicle that uses that shader and you can set scalarA during each draw.
So you can use scalarA to turn on and off the lights on a warthog or to animate the tires to spin when it's moving.
Halo had a similar system but it was more restricted.
Also, I'm about to tear TWL out of the engine and start writing my own library to replace it. Making a bak of everything and crossing my fingers.
Bookmarks