
Posted:
Thu Nov 13, 2003 11:49 am
by rabidhamster
The shader just operates of a string of characters - it doesn't do any maths, so it just expects to see numbers in the shader string. Basically every time a module wants to draw something, it sends the text in the shader to R4 and R4 sets up OpenGL accordingly.
Probably one of the better ways to change what happens in the shader is to do:
if (something) strcpy(my.shader,"shadertext");
else strcpy(my.shader,"shadertext2");
You can insert variable numbers in stuff like the example in the other thread, but i haven't had much success for some reason - i will fiddle and see what i can do though. The debugging is needed :p
I may add a console window for R4 similar to the R2e one - would it be ok for me to just add a function that would output text/data to that?
- Gordon