Jump to content
  • Advertisement
Sign in to follow this  
Paulpetk123

D3D11 Texturing doesn't work properly

This topic is 866 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, my problem is that my object is texturing weirdly. Problem accured when I changed something in code.

 

I changed from this : 

http://pastebin.com/Kxdw66BG

to this :

http://pastebin.com/3z3BaD8h

 

I use only use UpdateObjectTransformations() for second skymap, which works perfectly fine, so that shouldn't be problem.

 

this is how texture should be :

http://imgur.com/AqIWKw1

this is how it is :

http://imgur.com/D6tMyWa

Share this post


Link to post
Share on other sites
Advertisement
Use visual studios graphics debugger and check the texture coordinates for that cubes draw call. They are probably not getting set so they might all be (0,0) or something. You can tell because the resulting cube is basically the same color as your texture. Its a solid color so all the vertices must have the same texture coordinates

Share this post


Link to post
Share on other sites

Use visual studios graphics debugger and check the texture coordinates for that cubes draw call. They are probably not getting set so they might all be (0,0) or something. You can tell because the resulting cube is basically the same color as your texture. Its a solid color so all the vertices must have the same texture coordinates

http://pastebin.com/fP07Ty0F They do look legit... 37-73

Edited by Paulpetk123

Share this post


Link to post
Share on other sites
Are you sure your using the right vertices out of those 71? Also check your vertex shader, make sure the texture coordinates are being passed properly, and are being used correctly in your pixel shader. Check your shaders in the graphics debugger so you know for sure which shaders you are using, maybe you are using the wrong vertex shader or something

Share this post


Link to post
Share on other sites

Are you sure your using the right vertices out of those 71? Also check your vertex shader, make sure the texture coordinates are being passed properly, and are being used correctly in your pixel shader. Check your shaders in the graphics debugger so you know for sure which shaders you are using, maybe you are using the wrong vertex shader or something

I found my problem, but thanks still

Share this post


Link to post
Share on other sites

 

Hello, my problem is that my object is texturing weirdly. Problem accured when I changed something in code.

 

I changed from this : 

http://pastebin.com/Kxdw66BG

to this :

http://pastebin.com/3z3BaD8h

 

I use only use UpdateObjectTransformations() for second skymap, which works perfectly fine, so that shouldn't be problem.

 

this is how texture should be :

http://imgur.com/AqIWKw1

this is how it is :

http://imgur.com/D6tMyWa

 

Looks like problem was that my shader file had bad layout. 

This is how it was :

struct PixelInputType
{
    float4 position : SV_POSITION;
    float2 tex : TEXCOORD0;
 
 
};
it needed to be :
struct PixelInputType
{
    float4 position : SV_POSITION;
    float2 tex : TEXCOORD0;
float3 normal : NORMAL;
 
};

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!