Texturised Height maps

Started by
4 comments, last by Tipotas688 14 years, 1 month ago
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;
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
I dont know how to debug a shader :p
breakpoints dont work there :S
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?
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.
Portfolio & Blog:http://scgamedev.tumblr.com/
yes that was it! I just saw it I still had VertexPositionNormalColored :S

cheers!

This topic is closed to new replies.

Advertisement