Skip to main content
gamedev.net
🔒 Locked

Multiple Textures

Started by prock20 Dec 5, 2001 at 5:31 PM 0 replies 250+ views
Original Post
prock20
prock20
I''m trying to write a terrain engine that acts much like a tile based game. Of course there is going to be different terrain types (i.e. grass, swamp, mountain, etc). I am new to D3D8 and want to place multiple textures on the terrain. One texture for the "main" texture (grass, rock, etc) and one for whatever is going to be on top the main texture (i.e. road, leaves, blood, etc). The top texture must have a color that is transparent so bottom texture will show through. The main reason why I want to use multiple textures is to eliminate the need to create separate textures for the road for each terrain type. Right now I have a simple terrain that uses only one texture. I use a triangle list for the terrain. Is here a good way to do this?
prock20
prock20
Better yet....

Does anyone have any information on how to render a terrain with multiple textures using DX8.1?


More info on the current project:

Planning to have a height map, and a "texture" type.

presently generating a triangle list (transforming in software to avoid the hardware retransforming the vertex (8x worst case)

this works beautifully with single textures. tiling a single texture (multiple textures in one) works fairly well, but tends to artifact a bit "blending" between different "tiles"

What I''d like to do is seperate it on a few lists (one for sand, one for grass for example) would make a cleaner texture wrap.
Problem then is blending beween the two. Best I can figure is to use a stencil mask on the second layer, and a z-bias to force it to draw on top.

Anyone have any better thoughts on how to handle this?

Any thoughts appreciated!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.