Advertisement

What`s wrong with my textrue?

Started by September 23, 2013 06:29 AM
3 comments, last by IndignentAngel 11 years, 4 months ago
Hello everyone. I`am a beginner of DX11 API. I recently learnt some tutorials and wrote a simple dx11 program which just drew a textured cube. But the result seemed to be not right. What`s wrong with it?

It looks like some of the texture coordinates are not right on some of the triangles, and the rest are repeated across the cubes faces

To get the texture to repeat just once, set the coords to range from 0 to 1

You might have just set them to range from 0 to texture width

For the texture coordinate issue, look at a "texture coordinate system" tutorial for directx, and it will definitely show you a working cube

Advertisement

Get the texture from texture filtering here: http://www.codesampler.com/dx9src/dx9src_3.htm#dx9_texture this texture contains how both OpenGL and DX handle texture coordinates and I always use this one as my test texture because of that.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

It looks like some of the texture coordinates are not right on some of the triangles, and the rest are repeated across the cubes faces

To get the texture to repeat just once, set the coords to range from 0 to 1

You might have just set them to range from 0 to texture width

For the texture coordinate issue, look at a "texture coordinate system" tutorial for directx, and it will definitely show you a working cube

Thank you! I finally fix that. It is all about the texture coordinates.

Get the texture from texture filtering here: http://www.codesampler.com/dx9src/dx9src_3.htm#dx9_texture this texture contains how both OpenGL and DX handle texture coordinates and I always use this one as my test texture because of that.

Ah! That helps a lot. Thank you.

In fact. I created three buffers. One for vertex positions , one for the normals and the other for texture coordinates. And I made a mistake when filling the D3D11_INPUT_ELEMENT_DESC structure. I shold have assinged 0 to the AlignedByteoffset and an incremental value to the InputSlot for the three buffers.

This topic is closed to new replies.

Advertisement