Good night everyone. I just made my custom Saturn planet for a cutscene. I thought it would be an easy task. The planet is just fine, but I have a problem with the rings. They don't cast or receive any shadow. I guess my problem is related with the object and texture. The object is a standard plane (I tried with a quad aswell) with the ring texture in alpha blended mode. I don't even know if this is the right forum but, can you point me in the right direction? You can see what I have right now with the attached screenshot. Thanks in advance!
Set the standard shader Rendering Mode for the rings to Cutout. You will lose any transparency that is gradual, instead it will either be cut out or not (there is a slider). The reason Cutout works with shadows is because it's drawn in the geometry pass. Transparent shaders cannot receive shadows.
You could write your own shader to receive shadows from the planet by calculating the shadow analytically. You can assume the planet is at the center of the mesh and just pass in the radius of the planet. Shadow casting with transparent can be a little weird. The standard shader can do a stipple or alpha cutoff shadow cast by transparency, but the stipple method is broken for surface shaders for a few reasons so you either have to write your own using a vert / frag shader or stick with cutoff shadows. With a surface shader you need alphatest:_Cutoff and addshadow, with a vert frag shader you need a shadow caster pass. The reason why cutoff shaders can work with shadow receiving is because they're rendered with the camera depth pass, not the geometry pass.
Well, I'm a beginner with this, so I will try the standard shader with cutout. It will cast shadows on the planet or just receive them?
Hi, I'm just trying the standard shader set to cutout, however, when I do that, the rings dissappear. Am I missing something? I'm attaching two screenshots showing the actual configuration. I guess it's something simple, maybe the texture configuration, or the plane object...
Adjust the Alpha Cutoff value down. It's likely your alpha is quite transparent. Also anything beyond oblique angles with mipmaps can cause an image's alpha to get even more transparent causing it to disappear. Not much you can do about this sadly, apart from turning off mipmaping.