Multitexturing, how to set a unique color on each texture?

Started by
5 comments, last by Electron 21 years, 2 months ago
The problem is this: Say if i want to render two textures on a surface, but with the color intensity of 25% from the first texture, and 75% of the other? I understand how to deal with multitexturing, but i cannot find any way to add a color to each texture. (or at least i fail trying). It is imperative that it is solved with multitexturing. I cannot cheat by rendering the surface twice with blending. Electron

"Your truth can be changed simply by the way you accept it."


--Electron"The truth can be changed simply by the way you accept it.""'General failure trying to read from file' - who is General Failure, and why is he reading my file??"
Advertisement
You''ve tried using glActiveTextureARB() and setting the glTexEnv() color?

-Mr.Oreo
I did, but i never got any results, so my guess was that the color was used for another purpose. (For instance, i saw that this color only was used when using texenv mode GL_BLEND, or am i wrong?)

Electron

"The truth can be changed simply by the way you accept it."


--Electron"The truth can be changed simply by the way you accept it.""'General failure trying to read from file' - who is General Failure, and why is he reading my file??"
write down the FULL equation of what u want to do

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
Just say that i want to blend two textures using multitexturing, how do i do to make, for instance, the first texture appear of 25% oparcity and the other with 75?

Electron

"The truth can be changed simply by the way you accept it."


--Electron"The truth can be changed simply by the way you accept it.""'General failure trying to read from file' - who is General Failure, and why is he reading my file??"
I''d be also interested if anyone knows a way to multitexture two textures each having a different color... but I don''t know of any way this can be done, except perhaps with register combiners or pixel shaders. ie.
1) multitexture pass #1 with one vertex color using GL_DECAL/GL_REPLACE
2) multitexture pass #2 with another different vertex color using GL_DECAL/GL_REPLACE

The problem is that one can only specify one vertex color afaik.

I think this is different from what Electron wants, which sounds like a problem of picking blend paramaters/equation for the second texture unit.
>>Just say that i want to blend two textures using multitexturing, how do i do to make, for instance, the first texture appear of 25% oparcity and the other with 75? <<

thus u want
tex0 * 0.25 + tex1 * 0.75

this can be achieved with interpolate with tex_env_combine
which lets u do
tex0 * A + tex1 * (1-A)

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

This topic is closed to new replies.

Advertisement