4
$\begingroup$

I am looking to render Saturn and its rings. The sun illuminates the diffuse material of the rings on their sunlit side but their backlit side needs to have an emissive shader. However the rings must be unilluminated on either side where shadowed by Saturn itself.

Thus, in the material nodes for Cycles, I need a way to separate light rays into three categories:

  • Direct illumination: light rays directly hitting the diffuse sunlit side
  • Self-shadowed: light rays directly blocked by the sunlit side of the rings themselves
  • Externally-shadowed: light rays that never touch the rings because they are shadowed by the planet

This is similar to the "Is Shadow Ray" output from the Light Path node, except that covers both the self-shadowed and externally-shadowed cases together. I am looking for a way to split that up.

$\endgroup$
4
  • $\begingroup$ Do your rings have thickness? $\endgroup$ – Robin Betts Jun 17 '19 at 13:57
  • $\begingroup$ @RobinBetts No, they are just a plane. $\endgroup$ – Keavon Jun 17 '19 at 15:32
  • 2
    $\begingroup$ In reality the rings do not emit any light, they are a bunch of particles floating in orbit. If you are using just a solid opaque ring it will occlude all light, but you could use a translucent shader, or better still a mix of transparent and difuse controlled by some noise texture. $\endgroup$ – user1853 Jun 17 '19 at 17:32
  • $\begingroup$ If it's one plane, The dark side of the ring is not occluded by the light side, as far as the ray-tracer is concerned, is it? The ray makes one hit and moves on.. the reason it's dark is simply because of its angle to the incident light? $\endgroup$ – Robin Betts Jun 17 '19 at 17:56
2
$\begingroup$

As mentioned in a comment, it would be incorrect to model this situation with an emissive material, as no light is being emitted. Fortunately, there is a shader in Cycles that supports your use case.

The Translucent shader emulates light passing through a thin sheet of material, and being diffused on the other side. This is frequently used for materials such as paper or grass - very thin layers that let the light pass through.

You can also use it for the ring material. However, you need to mix it with your current material, as only a fraction of the light is let through - part of it is still diffused. Example setup:

Cycles node setup

Results

From the top:

Saturn example render: top

From the bottom:

Saturn example render: bottom

Ring shadows: Saturn example render: ring shadows forgive the lazy texturing

Note that we have not used any shadow "hacks" or emissive materials - hence the rendered result is reasonably physically accurate. In particular note that:

  • No fake light is being created
  • Rings diffuse light as expected
  • Rings catch shadows (on both sides) from other objects
  • Rings cast shadows on the planet

Possible improvements

To further improve the material, you could:

  • Tweak the mix value so that the material is just as translucent as it should be
  • Adjust the opacity of the material depending on the view angle (perpendicular angles should be more transparent, but slanted angles should be more opaque, because light has to travel further through the asteroid cloud, so it would have a greater chance of being diffused. If you wanted even more physically accurate results, you could give the rings a small amount of thickness and render their volume)
  • Adjust textures, colors, etc

Why this is better than hacking with shadow colors

This sort of setup will simulate light bounces more physically accurately. In particular, it will ensure that no light is being "created" from nothing - the amount of light redirected from a material will be no more than the light that has shined on it.

This would be difficult to achieve manually. As you already realized, dealing with shadows yourself would be tricky, even if you had access to shadow data. In addition, you would have to ensure that the material doesn't emit too much light - for example, if the light source is at an angle, there should be less light than if it was perpendicular to the surface.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.