Shadow in both sides of an sphere

I see a fast hack you can do. In PostShadow15.frag you need to have additional parameter, something like LightRadius or ShadowRadius (whatever). Pass it there by overriding the ShadowRenderer and modifying the proper j3md file. Then, on the very beginning of shader’s main function do a simple test: check if the fragment is not too far, then draw it or discard it.

Why? The PointLightShadowRenderer render the shadows on every shadow receiving geometry that is in the light’s radius. Even if it is only partially covered in light, in the end you can have shadow drawn outside the light radius! So the simple test should do the trick. Of course you can limit the shadows by passing the planet’s orbit radius, so you’ll have shadows drawn only on the side that is actually facing the sun.

Well. I have plans to integrate shadows in the lighting pass, but that will only be on master and maybe just for PBR lighting, so it might not be an option for you.

What could be done in you case it to remove shadows from faces that are facing away from the light direction, only for objects that only receive shadows… So basically, you could duplicate the lighting.j3md, and modify the postShadow technique (the postShadow15 too) to use a slight ly different shader.
This shader would be the same as the stock one, except it would cancel shadows one pixels where the normal is facing away from the light direction. ( positive dot product between the light direction and the normal, or something like that). You may have to pass the light direction to the shader though I don’t think we have it in the stock shader.
Imo this could be the easiest way to achieve what you want.

The zExtends form the light point of view will be very very unpractical… You won’t be able to tweak it for each object… IMO it’s not really an interesting option.

That’s an open issue in the tracker btw. it’s also the case for a spot light range.

Seens an good approach, I will look on that, thanks !