OpenGL Multitexturing Details w/Alpha
Again, thanks for all the help. I hope I can repay it one day somehow either to this community or to you =-).
Thanks a million - you made my day... err no - month =-D
Thanks a million - you made my day... err no - month =-D
Seems I spoke too soon -
The base isn't drawing where the details aren't.
Meaning the base is also using the details alpha.
If you need a screen of this i can p rovide one
The base isn't drawing where the details aren't.
Meaning the base is also using the details alpha.
If you need a screen of this i can p rovide one
Err wait - I'm going to try a forth pass, interpolate of colormap and colormap in respect to alpha
Code:
glActiveTextureARB( GL_TEXTURE2_ARB );//detail - instead of pass through, interpol with tex0 in respect to 1-alpha
glEnable(GL_TEXTURE_2D);
BindTexture(details);
/*glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE);
glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS);*/
glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_RGB_ARB,GL_INTERPOLATE_ARB);
glTexEnvi(GL_TEXTURE_ENV,GL_SOURCE0_RGB_ARB, GL_PREVIOUS );
glTexEnvi(GL_TEXTURE_ENV,GL_OPERAND0_RGB_ARB,GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV,GL_SOURCE1_RGB_ARB, GL_TEXTURE0 );
glTexEnvi(GL_TEXTURE_ENV,GL_OPERAND1_RGB_ARB,GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV,GL_SOURCE2_RGB_ARB, GL_TEXTURE1);
glTexEnvi(GL_TEXTURE_ENV,GL_OPERAND2_RGB_ARB,GL_ONE_MINUS_SRC_COLOR);
glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA);
makes it visible now, but the details are MUCH too light ( I switched to a GL_MODULATE for the details since its the actualy effect I want, not GL_ADD_SIGNED)
makes it visible now, but the details are MUCH too light ( I switched to a GL_MODULATE for the details since its the actualy effect I want, not GL_ADD_SIGNED)
You don't need to enable blending for multitexturing, unless you intend for the final combined texture to be translucent (usually not, for terrain.)
Hmm, well see, since I'm using multiple textures, and the DOT3 hack wont work for me, I have to make like 3-4 passes. I can't figure out how to do this otherwise since in my TU1 I need to references the previous and previous only grabs the previous tu
I ended going up with this as it was "close enough". The tool is for Myth III: The Wolf Age. Here are the results of the multitexturing on one of the standard maps:
Before: Pepper Heights
After: Pepper Heights
After: Pepper Heights Close up
After: Llanc Close Up Road
Its still not quite right (It actually brightens when there is white instead of darkens... hmm...) but I think it will work for its purpose (which is seeing how things look in a rough fashion without switching to the engine every 5 minutes).
Before: Pepper Heights
After: Pepper Heights
After: Pepper Heights Close up
After: Llanc Close Up Road
Its still not quite right (It actually brightens when there is white instead of darkens... hmm...) but I think it will work for its purpose (which is seeing how things look in a rough fashion without switching to the engine every 5 minutes).
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL Alpha Channel Problem | Moganza | 1 | 1,564 |
Jan 19, 2013 08:25 AM Last Post: sealfin |
|
| OpenGL ES 2.0, 2D Alpha Transparency Artifacts | Macmenace | 3 | 6,210 |
Mar 28, 2010 11:18 PM Last Post: AnotherJake |
|
| Can't get multitexturing to work | Coyote | 4 | 3,431 |
Nov 16, 2009 11:48 PM Last Post: arekkusu |
|
| Opengl alpha premultiplication issue | Najdorf | 5 | 4,372 |
Nov 13, 2008 09:49 AM Last Post: Najdorf |
|
| Loading and using textures with alpha in OpenGL with Cocoa | corporatenewt | 4 | 5,112 |
Dec 8, 2007 02:06 PM Last Post: Malarkey |
|

