Archived

This topic is now archived and is closed to further replies.

VanKurt

Right blending for detail map

Recommended Posts

VanKurt    133
Yep, as the subject already indicates I''m having problems with using my detailmap the right way. My terrain has a base texture and a multitextured detail texture. The first one is drawn with GL_REPLACE, the second one with GL_MODULATE. The problem is that the detailtexture makes the colormap much darker. I think I should change something with the blending but I don''t know where and how... (From Photoshop I know that there are different ways like ADD, SUBTRACT, MULTIPLY, SCREEN, DISSOLVE and stuf like that..?) Any ideas?

Share this post


Link to post
Share on other sites
blizzard999    268
A strange personal idea...

A big RGB texture; then compute shadow (for example by deriving the height map) and blend it off-line with the texture: simply multiply each component for a shadow coefficient.

Use a single texture for the details but modulate it with the RGB color in the big one.
In other words you use the big texture for glColor() and the detail texture as texture to be modulated.
I''m sure there is a way to do this using multitexture without using glColor() for each vertex...

Share this post


Link to post
Share on other sites
sirob    1181
perhaps your detail texture has a darker background color than the terrain texture? if so, you might have to color-key the background.

Share this post


Link to post
Share on other sites
OrangyTang    1298
quote:
Original post by VanKurt
(From Photoshop I know that there are different ways like ADD, SUBTRACT, MULTIPLY, SCREEN, DISSOLVE and stuf like that..?)
Any ideas?


GL_MODULATE will be the same as MULTIPLY - this will probably work fine if your detail texture is drawn taking this into account (ie, mostly white). Otherwise you probably want something like ARB_texture_env_add.

Share this post


Link to post
Share on other sites
VanKurt    133
Actually I have to admit that I am not able to init ARB_texture_env_combine.

:-(

Is anyone willing to help me?

Share this post


Link to post
Share on other sites
VanKurt    133
I have been trying to get this working for several hours now....ARGH!!
Here''s the result of my efforts:


  
glActiveTextureARB( GL_TEXTURE1_ARB );
glEnable( GL_TEXTURE_2D);
myTexMan.Bind(tex2);
glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_ADD );



if( glGetError() == GL_INVALID_ENUM )
bbMsg.Std("ERROR");




glActiveTextureARB( GL_TEXTURE0_ARB );
glEnable( GL_TEXTURE_2D);
myTexMan.Bind(tex1);
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );



But NOTHING HAPPENS!!! There is just the stupid old standard blending. It doesn''t even matter if I comment the "glTexEnvi( GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_ADD );" line away... :-((
gotta get to bed...

Share this post


Link to post
Share on other sites