Sign in to follow this  
DuckWizard

Texture Splatting Question

Recommended Posts

I read this article: http://www.gamedev.net/reference/articles/article2238.asp I'm trying to adapt this method for use in my terrain engine. I've run into a bit of a problem. From the article:
Quote:
Each chunk has the base textures repeated several times over it – but the alphamap is stretched over the entire area. (0, 0) of the chunk would have alphamap coordinates of (0, 0) and texture coordinates of (0, 0). (33, 33) of the chunk would have alphamap coordinates of (1, 1) and texture coordinates of (x, x), where x is the number of times you want the textures to be repeated.
My question is, if I am rendering the geometry only once and combining the texture with the alpha map in the texture units, how can I make the alpha map use different texture coordinates than the texture? It seems like the (u,v) for the alpha map will always be the same as the (u,v) in the texture map, and thus instead of being stretched over the entire terrain, the alpha map will tile with the texture (rendering it essentially useless). Any thoughts? Thanks, -Jeremy

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
#define TERRAIN_D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ/*|D3DFVF_NORMAL*/|D3DFVF_TEX1|D3DFVF_TEX2)

struct TERRAIN_CUSTOMVERTEX
{
FLOAT x, y, z;
//FLOAT nx, ny, nz;
FLOAT u1, v1; //for texture1
FLOAT u2, v2; //for alphamap
};

i think this should work..
:D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this