PDA

View Full Version : Re: simple register combiner question: help!



Codemonkey
11-14-2003, 01:57 PM
i am so frustrated with nvidia hardware right now

i am messing around with register combiners on a quadro4 700 GoGL

i have a single RGBA texture bound to unit 0

i have register combiners enabled with the following configuration:

static const float c0[]= { 0.5, 0.5, 0.5, 0.5 };
glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV ,1);
glCombinerStageParameterfvNV(GL_COMBINER0_NV,GL_CO NSTANT_COLOR0_NV,c0);
glCombinerInputNV(GL_COMBINER0_NV,GL_RGB,GL_VARIAB LE_A_NV,GL_TEXTURE0_ARB,GL_UNSIGNED_IDENTITY_NV,GL _RGB);
glCombinerInputNV(GL_COMBINER0_NV,GL_ALPHA,GL_VARI ABLE_A_NV,GL_TEXTURE0_ARB,GL_UNSIGNED_IDENTITY_NV, GL_ALPHA);
glCombinerInputNV(GL_COMBINER0_NV,GL_RGB,GL_VARIAB LE_B_NV,GL_CONSTANT_COLOR0_NV,GL_UNSIGNED_INVERT_N V,GL_RGB);
glCombinerInputNV(GL_COMBINER0_NV,GL_ALPHA,GL_VARI ABLE_B_NV,GL_CONSTANT_COLOR0_NV,GL_UNSIGNED_INVERT _NV,GL_ALPHA);
glCombinerInputNV(GL_COMBINER0_NV,GL_RGB,GL_VARIAB LE_C_NV,GL_ZERO,GL_SIGNED_IDENTITY_NV,GL_RGB);
glCombinerInputNV(GL_COMBINER0_NV,GL_ALPHA,GL_VARI ABLE_C_NV,GL_ZERO,GL_SIGNED_IDENTITY_NV,GL_ALPHA);
glCombinerInputNV(GL_COMBINER0_NV,GL_RGB,GL_VARIAB LE_D_NV,GL_ZERO,GL_SIGNED_IDENTITY_NV,GL_RGB);
glCombinerInputNV(GL_COMBINER0_NV,GL_ALPHA,GL_VARI ABLE_D_NV,GL_ZERO,GL_SIGNED_IDENTITY_NV,GL_ALPHA);
glCombinerOutputNV(GL_COMBINER0_NV,GL_RGB,GL_DISCA RD_NV,GL_DISCARD_NV,GL_SPARE0_NV,GL_NONE,GL_NONE,G L_FALSE,GL_FALSE,GL_FALSE);
glCombinerOutputNV(GL_COMBINER0_NV,GL_ALPHA,GL_DIS CARD_NV,GL_DISCARD_NV,GL_SPARE0_NV,GL_NONE,GL_NONE ,GL_FALSE,GL_FALSE,GL_FALSE);
glEnable( GL_REGISTER_COMBINERS_NV );

with this configuration, the texture appears completely normal.

1) why does the constant color not have an effect? no matter what values i choose, i always see the texture as normal
2) if i change the line:
glCombinerInputNV(GL_COMBINER0_NV,GL_RGB,GL_VARIAB LE_B_NV,GL_CONSTANT_COLOR0_NV,GL_UNSIGNED_INVERT_N V,GL_RGB);
to
glCombinerInputNV(GL_COMBINER0_NV,GL_RGB,GL_VARIAB LE_B_NV,GL_CONSTANT_COLOR0_NV,GL_SIGNED_IDENTITY_N V,GL_RGB);
the texture disappears!!! what is wrong!!

i have been through the specs dozens of times and can't find any state problems, errors, or "beware this combination of parameters" which might lead to these results. gluErrorString yields no errors at any point.

help help help!!! all i'm trying to do is learn to use register combiners!

Lev
11-14-2003, 02:10 PM
Have you enabled per-stage parameters? i.e. GL_PER_STAGE_CONSTANTS_NV?

Regards
-Lev

Codemonkey
11-14-2003, 03:37 PM
no. i will have to try that.
i see that feature is defined in register_combiners2, and of course i was only looking at the original documentation. this code was originally suggested by someone else, and i see now that he was using per stage constants instead of general constants.

thank you. hopefully that will help solve my problems. it is so frustrating because (as in this case) the documentation is incomplete or insufficiently cross-referenced. nowhere in the register_combiners specs is register_combiners2 mentioned. the API is so complicated, i can see why nvparse, Cg, and the new ARB programs were created.

thanks for your help!

[This message has been edited by Codemonkey (edited 11-15-2003).]