Jump to content
  • Advertisement
Sign in to follow this  
Tipotas688

Texturised Height maps

This topic is 3095 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
Advertisement
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
I checked it and it definitely uses the first pixel in order to every triangle with its color. how do I make the whole map draw all the picture and not just its first pixel?

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!