Frage

Is there some builtin fragment function in CG that allows me to compute the following without conditionals?

y = x>bias?1.0f:0.0f;

War es hilfreich?

Lösung

Almost. It's a >= instead of a >

http://http.developer.nvidia.com/Cg/step.html

y = step(bias, x);

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top