Custom made shadows

Hello Panda3d comunity,

My first 3d app is growing well thanks to this great python engine !
it’s called Astrini (standing for intitiation to basic astronomy facts)
intended to become a pedagogical software.

the source is on github:
github.com/webplate/astrini
I hope this software isn’t too buggy (don’t hesitate to report misbehaviours)

But I’m not writing here for a showcase as astrini is far from finished. I’m here to ask some advice to better control the projected shadows of my planetoids. For the moment I use a DirectionalLight with setShadowCaster to true in order to show moon’s shadow on earth (location of sun eclipse) and earth’s shadow on moon (moon eclipse).

I would like to control more precisely the darkening of my models where the shadow are casted. Idealy, I would like to show them without using the shadowCaster in order to avoid the jaggy aspect of a low resolution projection and to be able to align at wish these darkened areas with the shadow trails I designed (activate them with the shadow button).

At first I imagined having two versions of earth and moon (an illuminated and a dark one) and then using clipping planes to show darkened areas properly… but the doc says the clipping planes shouldn’t be used :frowning:

So may I ask how would you proceed ?

You have only round geometric objects, so I think that you can try to use only mathematical functions in shader instead of rendered shadowmap image to avoid low resolution problems, but of course it require rewriting shaders.

Thanks for your advice,
I’ll try to learn about shader’s rewriting, it seems a good idea.

And a HUGE thanks for your work on YABEE, this tool is so useful !
Luckily there’s still some russian geniuses to care for us :slight_smile: