Problem with GL_NV_texture_env_combine4

Started by
9 comments, last by tSG 22 years, 2 months ago
Hey, I have a problem with using the mentioned extension. I use the following code and it''s task would be to draw the texture in its ''true'' color, isn''t it? However it draws the texture with blue color... Why is this? glColor4f(1,1,1,1); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE4_NV); glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE0_ARB); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PRIMARY_COLOR_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_ZERO); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE3_RGB_NV, GL_ZERO); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_COLOR); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND3_RGB_NV, GL_SRC_COLOR); Draw(); Thanks in advance! -- tSG --
-- tSG --
Advertisement
A/ is lighting enabled?
B/ (i havent looked at that extension for a while) but what u have here is exactlly the same as

GL_MODULATE (ie no combine no nothing)


http://uk.geocities.com/sloppyturds/gotterdammerung.html
To just render the texture colour, you don''t need any of the texture_env_combine extensions. All you need to do is:

a) Set the current drawing colour and use an environment function of GL_MODULATE
b) Use an environment function of GL_DECAL.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
Oh yes, I know that I could use GL_MODULATE instead this... ''cause this is just a test, I would like to blend two textures with a certain alpha over each other. That could be easily done in two passes but I would like to use the multitexturing...
Btw. lighting is disabled so that can''t be a problem


-- tSG --
-- tSG --
sounds like u want tex env combine + use the interpolate method whichll let u use
tex0 * A + tex1 * (1-A)
A can be the alpha of a texture

http://uk.geocities.com/sloppyturds/gotterdammerung.html
zedzeek is exactly right, you want to use the standard GL_EXT_texture_env_combine extension using the GL_INTERPOLATE token.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
quote:Original post by zedzeek
sounds like u want tex env combine + use the interpolate method whichll let u use
tex0 * A + tex1 * (1-A)
A can be the alpha of a texture

http://uk.geocities.com/sloppyturds/gotterdammerung.html


I don''t think so. The extension says:
"Should textures from other texture units be allowed as sources?
- No, not in the base spec. Too many vendors have expressed concerns about the scalability of such functionality. This can
be added as a subsequent extension."
I think that says that multitexturing is not supported by standard GL_EXT_texture_env_combine... And meanwhile the NV extension docs says that NV tex env extension is an extension of this - with support of multitexturing.
Please correct me if I know something incorrectly.



-- tSG --
-- tSG --
Read the OpenGL 1.2.1 manual, it''s got a good section on how the multitexturing engine works. Look up fragments...

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
quote:
I don''t think so. The extension says:
"Should textures from other texture units be allowed as sources?
- No, not in the base spec. Too many vendors have expressed concerns about the scalability of such functionality. This can
be added as a subsequent extension."

This quote only refers to the capability of a texture combine stage to *directly* access texture sources of other combine units, without passing through the full texture pipeline. This is only useful for very advanced shading effects, and has been realized in the combine4 extensions, the crossbar ext. or directly through register combiners. For your simple equation you don''t need it at all. It''s just standard multitexture routing offered by ext_tex_env_combine. You should familiarize yourself with the basic principles of multitexturing and the workings of the texture pipeline.

NV_texture_env_combine4 is nic, if you want to do equations such as c = cf * (ct0 + ct1). This simple equation just can''t be done using any standard texture_env equation.
Ahh, thank you for pointing out that! I will definitely look at the opengl1-2-1 specifications for more details. Thanks!


-- tSG --
-- tSG --

This topic is closed to new replies.

Advertisement