BeanstalkBlue Posted February 28, 2017 Share Posted February 28, 2017 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. Quote Link to comment Share on other sites More sharing options...
wo997 Posted February 28, 2017 Share Posted February 28, 2017 @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. Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted February 28, 2017 Author Share Posted February 28, 2017 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 28, 2017 Share Posted February 28, 2017 You can try several options: - increase camera.minZ - decrease camera.maxZ - Turn on log depth: http://doc.babylonjs.com/tutorials/using_logarithmic_depth_buffer NasimiAsl and BeanstalkBlue 2 Quote Link to comment Share on other sites More sharing options...
BeanstalkBlue Posted February 28, 2017 Author Share Posted February 28, 2017 That helps, thanks @Deltakosh! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
AmyFox Posted September 23, 2021 Share Posted September 23, 2021 You can try: - turn on material.disableDepthWrite, which is useful to clear the z-fighting between coplanar polygons. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.