Code : x (x.0)? I'll pass it on to our shader compiler engineers). Cg/hlsl, on trouve souvent la fonction saturate. Long long before branching got introduced and supported in hardware., 09:46 AM #5, re: glsl Branching and Clamp function thank you def and _NK47, now I understand., 10:54 AM #6, re: glsl Branching and Clamp function. Bpurnomo, jul 23, 2009 1:34. Max(x,y) 1/2 * (x y x - y) min(x,y) 1/2 * (x y - x - y) someone compared original c max with these functions and achieved double performance with the above equations, 03:13 PM #10 Re: glsl Branching and Clamp function Ouch. Version Support, openGL Shading Language Version, function Name.10.20.30.40.50.30.00.10.22.214.171.124 mix(genType) mix(genDType) mix(genIType mix(genUType mix(genBType) Copyright Copyright Khronos Group.
Please enter a title. Similarly, if min and max or step are expanded using "if will there be a speed slowdown? Cg/hlsl, we often find the saturate function. Components of x and y that are not selected are allowed to be invalid floating-point values and will have no effect on the results. Not only clamp/min/max are implemented in hardware and do no branching, but if you have simple code like this: if(var1.33) var2 7; var3 var4-5.0; There will be no branching, either.