For element *i* of the return value, 0.0 is returned if *x*[*i*] < *edge*[*i*], and 1.0 is returned otherwise.

Parameters

*edge*

Specifies the location of the edge of the step function.

*x*

Specify the value to be used to generate the step function.

genType

**step**( genType edge,

genType x);

now consider this

template <class T> T Max(T a, T b) { return (a > b ? a : b); } as an if if thats faster than normal if then we can debate on the thing, anyway if we dig in shit we end up with times for each gpu.

second thing seems to have more instructions than first one. since i just converten it to asm on the flow i am not 100% sure but it seems so, fpu will do more work , and in the second line you hgave 3 ifs and on first only 2, we could rant about optimization that goes through glsl and end up that calculations (* /) are faster, but you don't always have division in first line. someone more experienced should reply to that, but i thing for small scene without much data to process second should be faster than first one wheres first is faster for complicated scenes. , but yet not always, and again to answer the question there should be a specialist that knows how glsl optimization is done., thus this can vary on different gpus/cpus, and a mystery for 2016: if elses werent invented to screw the performance.