PDA

View Full Version : Selectively calling a function in GLSL



Jyk1234
11-06-2013, 09:35 PM
Hello All,

I need to selectively call a function within my vertex shader, this decision is based on a per vertex "flag".
So, it would be something like:



if ( flag_set )
{
call_func();
}

I understand that branching instructions in shaders are costly. Is there some other way i can achieve the same thing without the "if" condition?

Thanks!