Jump to content

[SOLVED] Auxiliary buffer is doing depth test since 2.7.3 which results in Z Fighting


photo

Recommended Posts

Posted

Hi,

I just port our project from 2.7.2 to 2.7.3 and discovered that the auxiliary buffer is doing a depth test now.

My material is set to disable depth test and depth mask to prevent depth testing and writing so I can write all pixel in the auxiliary buffer to do the outlining with a sobel later.

It worked without problems in 2.7.2..

Is there a workarround without offsetting the geometry from the ground plane?

Sample code and video is in the attachement.

Thanks,

Sebastian

source.zip

Posted

Hello Sebastian,

This was made for proper work of alfa test materials with auxiliary buffer. We need some time to investigate possible ways of fixing this.

How urgent is this for you?

Thank you.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

Hi morbid,

it would be ok to have a solution in the next 2 weeks.

Thank you

Posted

Hello @sebastian.vesenmayer,

Consider using the Geometry Inflation feature as a possible workaround. Yes, it inflates the geometry, but the offset is not so perceptible on small values and the pivot point is not moved. Just add a couple of lines to your init function:

...
objMeshStatic->setMaterialParameter("auxiliary_color", Unigine::Math::vec4(1.f, 0.f, 0.f, 0.f), 0);

// enable the Geometry Inflation
objMeshStatic->setMaterialState("geometry_inflation", 1, 0);
objMeshStatic->setMaterialParameter("vertex_balloon", Unigine::Math::vec4(0.01f, 0.f, 0.f, 0.f), 0); // 0.01f is pretty enough

return 1;
}
...

It works like a charm in your sample project. If it is not acceptable for your logic, we'll come up with other ways.

Image 3.png

Thank you!

Posted
On 1/14/2019 at 5:46 AM, thomalex said:

Hello @sebastian.vesenmayer,

Consider using the Geometry Inflation feature as a possible workaround. Yes, it inflates the geometry, but the offset is not so perceptible on small values and the pivot point is not moved. Just add a couple of lines to your init function:


...
objMeshStatic->setMaterialParameter("auxiliary_color", Unigine::Math::vec4(1.f, 0.f, 0.f, 0.f), 0);

// enable the Geometry Inflation
objMeshStatic->setMaterialState("geometry_inflation", 1, 0);
objMeshStatic->setMaterialParameter("vertex_balloon", Unigine::Math::vec4(0.01f, 0.f, 0.f, 0.f), 0); // 0.01f is pretty enough

return 1;
}
...

It works like a charm in your sample project. If it is not acceptable for your logic, we'll come up with other ways.

Image 3.png

Thank you!

As you can see on your picture the outline is now generated arround the Ball.

If something would block the sight, the outlining will vanish.

Polygon offset is not working for us.

We did render it without depth test to make sure that fine height differences won't affect it on the zero ground. We cannot exactly say what the height is, since every scenery is different.

Best practise may be to define the same blending functions in auxiliary as in deferred and forward rendering procedure.

Posted

Thank you very much :)

Posted

Hi,

sorry for the late reply.

The version you sent me works. :)

Thank you for your help.

Topic can be closed.

  • morbid changed the title to [SOLVED] Auxiliary buffer is doing depth test since 2.7.3 which results in Z Fighting
×
×
  • Create New...