terrain texture splatting

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
soconne
Posts: 87
Joined: Fri Mar 05, 2004 2:00 pm

terrain texture splatting

Post by soconne »

I would like to implement texture splatting on a terrain I'm rendering with Irrlicht. I've read in the documentation that combining 2 textures, one being an alpha texture is not implemented yet.

What I've done in my own code in OpenGL is take a black and white texture, where each pixel is an alpha value, and a regular texturemap. I then bind the alpha as texuni0 and the texture as texunit1, and set blending properties in OpenGL so that texunit1 only shows through where there is white in the alphamap. I then implemented this on my terrain for texture splatting.

I would like to do this with irrlicht, but I can't seem to find the materials source file to add it. I found the header, but which file contains the .C source code that I could try and modify to add it?

Or has anybody already figured out how to do this without making modifications?
soconne
Posts: 87
Joined: Fri Mar 05, 2004 2:00 pm

Post by soconne »

Well i've been able to create a custom scene node with a texture splatted terrain in opengl mode. You can add as many layers as you want and have each blended based on the alpha map you add. Now I just gotta add the code for DirectX to work, gotta 'google' it and figure it out.

Gonna optimize it also to only include triangles that are fully or partially visible based on the alpha values to minimize the number of triangles in the terrain.

If anybody knows the code for doing the texture blending with alpha values in DirectX, please post!
Armen138
Posts: 298
Joined: Mon Feb 23, 2004 3:38 am

Post by Armen138 »

how exactly did you get this to work? is there no way without modifying the source of irrlicht?
Post Reply