z-fighting line and solid meshes

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
AndrAlekseevV
Gnoblar
Posts: 6
Joined: Thu Jan 26, 2017 1:15 pm
x 2

z-fighting line and solid meshes

Post by AndrAlekseevV »

I'm finding material to use with lines.
I have one-color solid mesh and I'd like to make contours of the mesh with line mesh. So, I have lines on the corners of mesh. I'm drawing buildings with edges.
I'm creating them as a single manual object(OT_TRIANGLE_LIST and OT_LINE_LIST with different material).

I'm using the follow materials:

Code: Select all

material line
{
    technique
    {
        pass
        {
           lighting on
           emissive 0  0.25  0.35
           depth_write on
        }
    }
}

material wall
 {
    technique
    {
       pass
        {
           lighting on
           emissive 1 1 1
           depth_write on
       }   
    }
 }
And it works fine on convex edges, but doesn't work at all or I see z-fighting on non-convex edges.
It work on PC(Linux), but it doesn't work on Android. I doesn't see lines. I solved the problem with adding depth_bias -100 for the wall material. And it's works fine on my samsung A3 2016(Mali-T720 MP2). But it doesn't work on Android with Tegra 3 - I can see lines but I don't see walls anymore.
There is many devices on Android and is't unreal to test this on all.
So, I'm finding material that I need to use to make lines always visible(or in the most cases). I'll very happy, if you can help me =))

I want to have something like this:
Image
Post Reply