Multitexturing and Register Combiners
Hello, guys!
I''m trying to learn more about Multitexturing and Register combiners.
I want to use 3 multitexture units, my graphics card has 4.
But when I use this method only textures 2 are visible, why?
GL_TEXTURE0_ARB visible.
GL_TEXTURE1_ARB visible.
GL_TEXTURE2_ARB not visible.
//active texture 1 (the 1D radial ramp texture)
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_1D);
glBindTexture(GL_TEXTURE_1D, ZtextureID);
//active texture 0 (the 2D radial map texture)
glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, XYtextureID);
//This one is not visible???
glActiveTextureARB(GL_TEXTURE2_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, TexArray[0]);
//setup and enable the register combiners
glCombinerParameteriNV(GL_NUM_GENERAL_COMBINERS_NV, 1);
glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, (float*)&color);
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV, GL_TEXTURE0_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV, GL_TEXTURE1_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_RGB);
glCombinerOutputNV(GL_COMBINER0_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV, GL_SPARE0_NV, GL_NONE, GL_NONE, GL_FALSE, GL_FALSE, GL_FALSE);
glFinalCombinerInputNV(GL_VARIABLE_A_NV, GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_B_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_C_NV, GL_CONSTANT_COLOR0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_D_NV, GL_ZERO, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
glFinalCombinerInputNV(GL_VARIABLE_G_NV, GL_ZERO, GL_UNSIGNED_INVERT_NV, GL_ALPHA);
glEnable(GL_REGISTER_COMBINERS_NV);
cheers
opengl_coder
im surprised u see any textures at all u should only be seeing GL_CONSTANT_COLOR0_NV
edit my bad u will see tex0 * tex1 * constant color
also texture2 might be bound but youre not using in the regcombine method
check out a register combiners pdf from nvidia theyre pretty thorough
http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
[edited by - zedzeek on January 27, 2003 11:57:56 PM]
edit my bad u will see tex0 * tex1 * constant color
also texture2 might be bound but youre not using in the regcombine method
check out a register combiners pdf from nvidia theyre pretty thorough
http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
[edited by - zedzeek on January 27, 2003 11:57:56 PM]
Thank you zedzeek.
What I want to do is create a per-pixel poinlight.
I use tex0 for my 1D texture, tex1 for my 2D texture and tex2 for my "normal" texture.
But I don''t know how to set up my register combiners..
What I want to do is create a per-pixel poinlight.
I use tex0 for my 1D texture, tex1 for my 2D texture and tex2 for my "normal" texture.
But I don''t know how to set up my register combiners..
check here
http://users.ox.ac.uk/~univ1234/index.htm
paul has described a few different methods
http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
http://users.ox.ac.uk/~univ1234/index.htm
paul has described a few different methods
http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
put this in the right block:
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV, GL_TEXTURE2_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
mfg cNc
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV, GL_TEXTURE2_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
mfg cNc
I tried to add the
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV, GL_TEXTURE2_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
but it did't look correct..
Does anybody know how to use the method in Ron Fraziers Per-pixel tutorial without rendring two times and using blending?
[edited by - opengl_coder on January 30, 2003 10:25:42 AM]
glCombinerInputNV(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV, GL_TEXTURE2_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB);
but it did't look correct..
Does anybody know how to use the method in Ron Fraziers Per-pixel tutorial without rendring two times and using blending?
[edited by - opengl_coder on January 30, 2003 10:25:42 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement