Jump to content
  • Advertisement
Sign in to follow this  
x11001001101x

Directx Texture Problem

This topic is 2551 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 am new here, I have been learning C++ for a few years now. I decided to start learning Directx since i am interested in Game Development.
I started to create my own Game engine in my own time and its going pretty well. I have been able to create a 3D World with Camera, Lights and Models,
however there is this annoying problem witch I can't find a solution online for it or I didnt know how to search for it correctly.


When I place a textured mesh and then place another mesh over it with the same axis it screws the texture and it tries to display both textures at the same time.

I know its weird how I explained it but here is some screenshots of the problem in my game.

ss3y.jpg


ss2na.jpg



ss1hj.jpg



See how the texture becomes inside the Room since I placed a floor with a different texture for this room, it collided with the terrain's texture.
So if anyone know, is there something I have to add like a

SetRenderState

for example.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I think the problem you've got here is z-fighting. Try using a depth bias http://msdn.microsof...9(v=vs.85).aspx

SetRenderState( [color=#2A2A2A]D3DRS_DEPTHBIAS, -1.0 );
[color=#2A2A2A]

[color=#2A2A2A]// Render first floor
[color=#2A2A2A]

SetRenderState( [color=#2A2A2A]D3DRS_DEPTHBIAS, 0.0 );
[color=#2A2A2A]

[color=#2A2A2A]// Render second

Share this post


Link to post
Share on other sites
Yeah, that's definitely z-fighting. The question is why are you trying to draw two floor meshes on top of each other?


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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!