Sign in to follow this  
dzzunga

Broken texture

Recommended Posts

Hello all, I render my car mesh with license plate texture (i parse the x file data and use the DrawPrimitive to render). When i move the view point close to the car i can see the good lisence plate (good texture as the origin image) but when i move the view point far away from the car the lisence plate is broken, is splitted with some gaps. Please tell me why the lisence plate texture is looking so strange, so bad. By the way can you tell me how to paste the picture into forum message or it's impossible. Thank in advance

Share this post


Link to post
Share on other sites
Without seeing the image, I would say this is z-fighting.

You probably draw something just behind the license plate (for example, the car bumper)? The flickering occurs because the depth buffer accuracy isn't enough to differentiate between the depth of the license plate and the object just behind it, thus causing the card to "guess" which is in front.

To correct this, you could use a more deep depth buffer format, or reduce the ratio between the near and far clip plane distances in your projection transform so as to achieve more local depth precision in the depth buffer.

By the way: to display images in this forum, you must host them elsewhere or upgrade to GDNet+ account to host them here.

Share this post


Link to post
Share on other sites
Edit: Nik02 also has a point [wink] Be sure to check out that thread I linked to though as it goes into the causes of most basic artifacts you're bound to come across after this one [smile]

The texture filters on your sampler are probably not set up correctly for your needs. You'll want to set your texture minification, magnification and mip filters to linear or better. If you're using shaders, you can do this in your shader file's sample declaration. If you're not using shaders (chances are good you aren't) you'll have to call device->SetSamplerState with the appropriate parameters and values. The docs (and I think the forum FAQ) can likely tell you more, as will this thread which goes into filters and a few other similar issues.

Hope this helps :)

Share this post


Link to post
Share on other sites
Thanks a lot to you Nik02 and remigius.

I follow your instructions about reducing the ratio between the far and near clip plane and as the result lisence plates on the car mesh look very good without any flickering, splitting into stripes. I will try to change depth buffer format and use the texture filters to see the effect too.

I found out the meaning of the z-buffer after reading papers about it.

Yes my Direct3d knowledge is very limited, thank you again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this