Out of principle I don’t help people who are using the fixed-function pipeline.
#1: It’s just encouraging bad behavior.
Bad dog.
#2: It’s like someone asking you to help figure out how to use his or her 1980
Apple III when there is a 2017
Alienware L. Spiro Supreme Mega Ultra Plus Neo Giga Mecha Panties Over-9,000 PC sitting right next to him or her. You’re helping for a bad reason (he or she is just intimidated by the more-complex look of the newer machine), and in the end you’ll just have to re-teach him or her once he or she finally moves on to the bigger better machine, so you’re wasting your time anyway.
I can’t really understand what you are trying to do. It doesn’t help that the image you showed of what you want to achieve (“desired”) is for some reason the only image that is basically impossible to see. That’s the one image that should be absolutely clearest and easiest to see.
My best guess: Your model has vertex colors or a material and you want to blend them with a texture.
#1:
glBlendFunc() and
glAlphaFunc() apply to how the final pixel mixes with the back buffer (or gets discarded). Disable blending and alpha testing. You’re not trying to blend with the back buffer, you are trying to blend a texture over a model’s material/vertex color.
#2:
glTexEnvi(). Read carefully how pixels travel through the texture-stage states and carefully figure out what settings you need to apply to get the result you want. Since you posted that
GL_MODULATE isn’t working for you, once again I don’t know what you are trying to do so I can’t really make many suggestions, but the result you posted of
GL_MODULATE isn’t the result I would have expected, so you may not have gotten the
pname value correct.
Here is the thought process:
#1: What is source 0? The model’s base color.
::glTexEnvi( GL_TEXTURE_ENV, GL_SRC0_RGB, GL_PREVIOUS );#2: What is source 1? The texture in slot 0.
::glTexEnvi( GL_TEXTURE_ENV, GL_SRC1_RGB, GL_TEXTURE0 );#3: How do you want to combine these 2 inputs? Multiply them?
::glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE );Repeat for alpha.
I don’t know what you want to do, but if you use these 3 steps and carefully pick the sources (which I am fairly sure I already got correct above) and the way in which they are combined you should be able to find your result.
Or you should just switch to shaders and make whatever you want happen.
L. Spiro