Point Sprite MAT and Depth Test leads to Flickering in Render TOP

Hey There,

I am rendering a number of points and I am using the Point Sprite MAT width a Color Map TOP as material for the particles. The point cloud is really dense at some points, and I have the feeling that causes the flickering in my Render TOP, see gif and image for reference (sorry for short GIF but max file size limited me in my quick attempt.)


flickering

The problem disappears when I disable Depth Test, but unfortunately I need this.

The same happens with a Line MAT and rendering Points btw.

I would be extremely thankful if someone knows how to solve this problem.

Best
Daniel

I could be mistaken but it looks like case of z-fighting.

You might try making your camera’s near and far clip planes tighter, closer in to the simulation/particle system. This helps a lot with regular geometry, it probably will have a similar effect here.

1 Like

Z-fighting is a good description for it :slightly_smiling_face: : @lucasm as simple as that. I tightened the camera near and far parameters and the flickering stopped! Especially the near parameter is the one to look out for in my case! Thank you so much.

PS: I guess this doesn’t belong in the bug section really? More a “parameter tricks for better render results” section :stuck_out_tongue:

Happy me

1 Like

Good deal!
Yeah I was hoping thats all it was. Yeah camera depth is not linear in perspective so you have way more precision up close. This is by design I believe, since most of the action is up close for most artists.

@lucasm Makes sense!

Since you seem confident around the matter, I just stumbled onto sth in the render. Do you know if the scaling parameters do not apply when instancing points and using Point Sprite MAT. Line MAT etc apply scaling on instancing…

Best
Daniel

Sorry what do you.mean by sth?

Point sprites won’t react to the traditional scale parameter for instancing I don’t believe, since their size is technically defined as a screen space variable in the shader.

I’ve done instancing vis glsl where I pass in a scale parameter and calculate scale slightly differently for sprites, I could share that if you’re interested in a custom shader approach.

Otherwise maybe some others may have a solution here using built in options

Oh sorry. By ‘sth’ I meant ‘something’ :slightly_smiling_face:

I went down the root to using Line MAT and using Point Sprites as Point Type. Rendering is fairly fast and with Anti Aliasing above 16 the quality is really nice. Scaling does work here!

Thanks @lucasm for your help and thanks for mentioning your custom shader. I would like to have a look if you don’t mind (xyz@danieldalfovo.de), otherwise I am sorted right now and very happy where its going :slight_smile:

Take care and thanks again!
Daniel