Sign in to follow this  

Texturised Height maps

This topic is 2844 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I m trying to add textures on my height maps but all it returns with is the height map with a brownish color, probably from taken from the picture. I think I m drawing a part of the texture in each triangle. I m using: device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Length, 0, indices.Length / 3); My shader does: float4 color; color = tex2D(TextureSampler, in.TextureCoords.xy); return color;

Share this post


Link to post
Share on other sites
Time to start debugging.

Try outputting in.TextureCoords.xy from the shader to see if the UVs at that point are actually correct, and keep outputting values until you find something wrong

Share this post


Link to post
Share on other sites
Have you set up your vertices in your program with the correct texture coordinates?

They need to be VertexPositionNormalTexture where you set the position, the normal and then the texture coordinates. To have the texture simply scale across each vertex then set each edge of the quad as 0,0 -> 1,1.

Share this post


Link to post
Share on other sites

This topic is 2844 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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