Register Combiner question

I’m not sure why I use GL_EXPAND_NORMAL_NV.
I guess I cut it from some bumpmap demo.
Shall I change it to GL_UNSIGNED_IDENTITY_NV?

What happens if I don’t discard all outputs
for Alpha portion?

-Ninja

Originally posted by Ninja:
I’m not sure why I use GL_EXPAND_NORMAL_NV.
I guess I cut it from some bumpmap demo.

lol. I’m currently using this document as register combiners reference document
Moreover when I saw your code, the first time I thought “ah he’s plainly copy-pasting the sample code” !

Shall I change it to GL_UNSIGNED_IDENTITY_NV?

Yes you should.

What happens if I don’t discard all outputs
for Alpha portion?

If you don’t configure alpha portion, then the latest configuration will be kept. Since this algorithm never use any alpha portion, that’s not a problem. But in practice there’s a matter of performance : when you explicitly tell OpenGL to discard all outputs, then OpenGL will certainly skip any computation on this portion.