PP Shader with more than 4 parameters

Posted By: yorisimo

PP Shader with more than 4 parameters - 11/04/13 19:34

I am building a postprocessing (pixel) shader that needs more than 4 parameters. The manual specifies use of the material's vecSkill1 (skill1-skill4) to modify parameters. This works for me, but only allows 4 parameters to be passed. How can I pass more information?
Posted By: Superku

Re: PP Shader with more than 4 parameters - 11/04/13 19:42

What I normally do (instead of using Material skills) is define vars (or floats or VECTORs) in lite-C and use those in the shader as follows:

var game_time = 0;
...
while(1)
{
game_time += time_frame;
wait(1);
}

Shader:

float game_time_var; // the _var / _flt feature is explained in detail in the manual

return (0.5+0.5*sin(game_time_var)); // pixel shader
Posted By: yorisimo

Re: PP Shader with more than 4 parameters - 11/04/13 19:56

Thanks! Looks like that should work. Didn't know about this feature laugh
Posted By: Kartoffel

Re: PP Shader with more than 4 parameters - 11/04/13 20:14

there's also vecSkill5, 9 and 13 and 17
Posted By: yorisimo

Re: PP Shader with more than 4 parameters - 11/04/13 20:26

Thanks. That works too. I misread the manual. I was trying to use vecSkill2 which doesn't exist
© 2024 lite-C Forums