GeForceFX RFL instruction

There is this RFL in NV_fragment_program instruction, which computes the reflection vector. But Cg never seems to use it. I thought that reflect() should compile direct to RFL. It is a “bad” instruction?

Hi Zengar,

There’s a subtle (but important) distinction between reflect() and RFL. Essentially, reflect() expects the normal (axis of reflection) to be normalized, while RFL does not. So RFL is somewhat more expensive.

reflect(i, normalize(n)) is effectively the same as RFL. The compiler doesn’t generate that code directly, however such sequences could be optimized to do that by the driver.

Thanks -

It’s funny… As I added RLF into my fragment program, it started running faster.
About 20%(simple emnironment mapping). But if it should be slower…
I’m experimenting with own HLSL compiler(just for fun ), so I wanted to know if I should compile my ferlect calls to RFL…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.