Reputation: 1998
I'm using Helix 3D Toolkit to draw 3D objects in WPF application. Currently I'm working on drawing 2D shapes in 3D (rectangles) and having a problem with textures when the shapes intersects:
The intersection changes when moving the camera:
I tried to place one shape a bit higher then the other one (Z = 0.101 and 0.102), but the result is the same. If I increase the difference (Z = 1 and 2), the problem is solved. But that's too high, because there will be other 3D objects on top of the shapes and the shapes should not be overlap them.
Why this happens? I thought that even a small difference in height should be enough to clearly identify which texture should be displayed.
I tried to google, but I even don't know how to describe this problem correctly to get relevant results.
Upvotes: 1
Views: 690
Reputation: 726
This is a problem called Z-Fighting, pretty common in 3D graphics. if you have access to the shader (either HLSL or GLSL) or the GL/DX context, you could resolve it from there.. If you don't then, possible solution could be either :
Upvotes: 0