plotoptix icon indicating copy to clipboard operation
plotoptix copied to clipboard

Dark ringing in redering with layer of plastic spheres

Open brennansprinkle opened this issue 6 years ago • 3 comments

Hi, I've been rendering some simulations data that I have using this code and things look really great in general! I've run into a problem recently where dark rings can be seen when rendering a long layer of plastic spheres. (Hopefully the attached pic goes through). I've tried a few things with the camera angle and the aperture radius but nothing seems to help much. I was wondering if you had any ideas? I can also post the data and a minimal example.

Thank you for any help you can provide!

sed_lub_0

brennansprinkle avatar Aug 06 '19 21:08 brennansprinkle

Hi, This is a typical artifact caused by the numerical precision of finding ray-object intesection. It looks ugly especially on spheres. Please, try changing the scene_epsilon value to something above the default 0.001, eg:

optix = TkOptiX()
...
optix.set_float("scene_epsilon", 0.01)

You can experiment with this variable also interactively:

optix.set_float("scene_epsilon", 0.01, refresh=True)

Another solution would be to change the scale of the whole scene (object sizes, distances, etc).

Some time ago I was trying to minimize this effect with various tricks but it is still there when spheres are small. I'll make one more approach..

Let me know if epsilon works sufficiently for your case.

robertsulej avatar Aug 06 '19 22:08 robertsulej

optix = TkOptiX() ... optix.set_float("scene_epsilon", 0.01)

This worked perfect! Thank you! I wound up using 0.05 but the scene has no rings now. sed_lub_3000

brennansprinkle avatar Aug 07 '19 16:08 brennansprinkle

Great! Your image looks very nice. The good thing is that the view is sharp, which could be a problem if you go too far with the epsilon.

I'll keep the issue open so I remember to try again if there is any better solution to this artifacts, and you'll get a message if I manage to improve the code.

Cheers!

robertsulej avatar Aug 07 '19 16:08 robertsulej