Better way to do detail mapping than this?

Hey again people. In my application I’m trying to tile a detail map using multitexturing with the following setup:

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
m_pTextureArray[iBase].Use();

glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, 2.0f);
m_pTextureArray[iDetail].Use();

And the detail map looks like this:
http://www.biosphereent.com/projects/terraimages/terra7.jpg

I’m not too happy with the way it looks and was wondering if there is another way to do it without nVidia only extensions and without bumpmapping.

Serious Sam 2 does an excellent job using detail mapping on all the walls and stuff and I was wondering how to do that as well. (unless Serious Sam uses bumpmapping, in which case nevermind )

If you have to try out the application, you can grab it at http://www.biosphereent.com/projects/terra.html

Any help would be appreciated.Thanx!

[This message has been edited by TheGecko (edited 03-26-2002).]

Try GL_ADD_SIGNED_EXT in EXT_texture_env_combine.

Nutty

I would suggest that the problem is the art being used as a detail texture rather than the math you’re doing in the pixel pipeline. Take the detail texture you have and run an emboss filter on it in PhotoShop. This gives a much better look, IMO. Additionally, you should have a look at the histogram of the resulting detail map and make sure it is centered around mid-gray (128) with a fairly tight distribution.

-JasonM

Thanx for the suggestions!

JasonM [ATI]: I just tried that.It looks really cool now! It’s just that when you get too close to it that it really starts to look terrible Oh well, can’t do much about it I guess.

Nutty: I’m still a little confused as to how to use those parameters you posted.Is there any way you can show me where in my code I should do the modifications and what the exact glTexEnvf() parameters are? And which line in my code I should delete? Thanx!

I’m still open to any more suggestions though.I’m trying out as many as I can to see which best suits me

This should go in the second texture unit.

glTexEnfi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_PREVIOUS_ARB);
glTexEnfi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_SIGNED_ADD);

Have a look in the spec for the extension for more information.

TheGecko, I tried your beta demo of the Terraformer3D, and anytime I tried to display terrain it would crash with a 0xC0000005 exception at 0x4061d0. I have a GF2 MX, and Win98 BTW in case that helps you narrow down the problem.

Did you import the texture pak first?
(File>Import>Texture PAK then select the textures.pak file in the data directory)

Maybe I should start forcing users to load this file at startup

Yes, and it makes no difference still crashes. Well, it does make a small difference, it just crashes at 0x404f63 with the same type of exception.