View Full Version : GeForceFX RFL instruction

01-14-2004, 08:03 AM
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?

01-14-2004, 08:39 AM
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 -

01-14-2004, 02:30 PM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif ), so I wanted to know if I should compile my ferlect calls to RFL...