cosmoscout / cosmoscout-vr

:milky_way: A virtual universe which lets you explore, analyze and present huge planetary datasets and large simulation data in real-time.
Other
351 stars 27 forks source link

Ring self shadowing #293

Closed JonasGilg closed 2 years ago

JonasGilg commented 2 years ago

Rings have now shading on the dark side based on transparency:

image image

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2690370622


Changes Missing Coverage Covered Lines Changed/Added Lines %
plugins/csp-rings/src/Ring.cpp 0 10 0.0%
<!-- Total: 0 10 0.0% -->
Totals Coverage Status
Change from base Build 2614742148: -0.002%
Covered Lines: 491
Relevant Lines: 16403

💛 - Coveralls
Schneegans commented 2 years ago

Awesome! Have you tested this in VR? The computation of the lit side looks a bit as if it could go wrong there :wink:

JonasGilg commented 2 years ago

I tried the following functions for the dark ring side. At the bottom is a reference image. I am not quite happy with any of them, but I think for a real solution we need a much more complex approach with scattering calculations.

No HDR HDR (default) HDR (-3.5 compensation)
1-a No_HDR_linear Default_HDR_linear Adjusted_HDR_linear
(1-a)^2 No_HDR_quadratic Default_HDR_quadratic Adjusted_HDR_quadratic
-sqrt(a)+1 No_HDR_sqrt Default_HDR_sqrt Adjusted_HDR_sqrt
1-a^2 No_HDR_inverse_quadratic Default_HDR_inverse_quadratic Adjusted_HDR_inverse_quadratic

Reference: Reference

JonasGilg commented 2 years ago

I tested it on the power wall in VR and it works. You can even see the light side with one eye and the dark side with the other.