Jump to content

Suggestion for solving this z-testing/z-fighting problem?


Recommended Posts

This is scene is arranged into separate blocks, each block is a SolidParticleSystem. (Like this, and like this.)

Each particle is touching right on the edge (see attached image), or click here.

There are some black pixels that flicker in and out on these edges. These are z-fighting artifacts on the edges (I think :)).

I tried just increasing the scale of the particles slightly so they overlap with each other but this doesn't fix it.

What can I do to remove these artifacts? Is there a simple way without adding more geometry to every particle?

I'm not afraid to modify shaders if I have to.


Link to comment
Share on other sites

@BeanstalkBlue I was thinking about changing the height of each particle so it doesn't render side walls (these which are on the same height, they are flat), is it a good idea? This may cause more problems though.

If that doesn't work you will probably have to subtract height for rendering for tiny values, make it like:

renderHeight = baseHeight - distanceToCamera/1000, where 1000 is just a big value, not to affect visual effects to much.

Link to comment
Share on other sites

I tried offsetting the heights randomly by a little bit. Attached image of exaggerated version of what happens (big offsets).


It is much worse :(

I could try to not render side walls I guess, that's a good idea. But actually I dont know if the problem is with side walls or just the edges touching.

For that I guess I need to duplicate every particle so there are two different models available for each position (so I can have some particles in the mesh still have walls), and then only draw half the particles.



Link to comment
Share on other sites

  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...