Original Post
Hello!
Just started working with NV_REGISTER_COMBINERS but I''ve a really big problem. I use 2 general combiners and the final combiner but the final combiner doesn''t work. It''s a simple Bump Mapping demo with specular lighting, using ARB_vertex_program designed for NV1X chipsets (only 2 combiners, only 2 texture units).
Here''s my Source-Code (only the specular lighting, the diffuse works with texture_env_dot3, not with register combiners):
glEnable(GL_REGISTER_COMBINERS_NV);
glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, 2);
glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, MaterialSpec);
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV, GL_TEXTURE0, GL_EXPAND_NORMAL_NV, GL_RGB);
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV, GL_TEXTURE1, GL_EXPAND_NORMAL_NV, GL_RGB);
glCombinerOutputNV(GL_COMBINER0_NV, GL_RGB, GL_SPARE0_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE, GL_TRUE, GL_FALSE, GL_FALSE);
glCombinerInputNV(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_A_NV, GL_SPARE0_NV, GL_SIGNED_IDENTITY_NV, GL_RGB);
glCombinerInputNV(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_B_NV, GL_SPARE0_NV, GL_SIGNED_IDENTITY_NV, GL_RGB);
glCombinerOutputNV(GL_COMBINER1_NV, GL_RGB, GL_SPARE0_NV, GL_DISCARD_NV, GL_DISCARD_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE);
glFinalCombinerInputNV(GL_VARIABLE_E_NV, GL_SPARE0_NV, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_F_NV, GL_SPARE0_NV, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_A_NV, GL_E_TIMES_F_NV, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_B_NV, GL_CONSTANT_COLOR0_NV, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_C_NV, GL_ZERO, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_D_NV, GL_ZERO, GL_SIGNED_IDENTITY_NV, GL_RGB);
glDrawArrays(ToRender->PrimitveType, 0, ToRender->NumVertices);
But if I use the following code for the final combiner the result is the same:
glFinalCombinerInputNV(GL_VARIABLE_E_NV, GL_ZERO, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_F_NV, GL_ZERO, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_A_NV, GL_ZERO, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_B_NV, GL_ZERO, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_C_NV, GL_ZERO, GL_SIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_D_NV, GL_ZERO, GL_SIGNED_IDENTITY_NV, GL_RGB);
I really don''t know what to do here! With the code above (using everywhere GL_ZERO) nothing should be drawn, but it seems that the final combiner uses VARIABLE_A_NV and VARIABLE_B_NV from the last general combiner (here SPARE0_NV for both).
I really don''t know what''s going on here!
Thanks a lot!
Corrail
corrail@gmx.at
ICQ#59184081