Jump to content

  • Log In with Google      Sign In   
  • Create Account


What`s wrong with my textrue?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 IndignentAngel   Members   -  Reputation: 115

Like
0Likes
Like

Posted 23 September 2013 - 12:29 AM

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?

Attached Thumbnails

  • 20130923142236.png


Sponsor:

#2 Kaptein   Prime Members   -  Reputation: 1844

Like
1Likes
Like

Posted 23 September 2013 - 12:40 AM

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



#3 NightCreature83   Crossbones+   -  Reputation: 2674

Like
0Likes
Like

Posted 23 September 2013 - 02:59 AM

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, Mad Max

#4 IndignentAngel   Members   -  Reputation: 115

Like
0Likes
Like

Posted 24 September 2013 - 06:16 AM

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.



#5 IndignentAngel   Members   -  Reputation: 115

Like
0Likes
Like

Posted 24 September 2013 - 06:28 AM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS