Is there any way to change the shader code variable at runtime? Here is an example :
// main.c float myValue = 0.65; // this value may change at runtime
void main() { ..... ..... }
// Here is the part of the shader code copied // from Terrain multitexture of mtlFX.c //.... //.... // Add the vertex light and shadow map #ifdef SHADOWMAP //entry: Shadow Map Offset //cntl: spin 0 1.0 0.05 //help: Light offset (0..1) to be subtracted from the shadow map
float offset = myValue;
FinalColor *= In.Color + (MaskColor.b - offset);
Thanks for any help.
Re: How to change shader code variable dynamically?
[Re: vlau]
#163780 10/29/0705:5510/29/0705:55
check here for some ideas on a useful DLL. go down to Matt's first reply. no, it isn't easier than using vecSkill1 or something, but if you need to use more values later i'm sure it can help.
once you establish a useful function (i haven't given it a go) it could be a very clean solution which allows you a lot of flexibility.
Thanks for your link Julz. Not more than 2 variables to be passed right now, I would like to use vecSkill1... at the moment but keep Matt's method in my HDD for future use.