I would like to make a material that is only seen when a dynamic light shines on that part of the surface and what is shadowed fully transparent

I am trying to make a sky for my planet, right now i only just have a hemisphere rotating around the planet staying lined up with my moving dynamic light i would like to make a full sphere that is shown on the side that light hits that object and the side that is shadowed is transparent or invisible. here are some screen shots of what i have already.


the blue ball is just a test material but were it has its shadow is were i want it to be transparent or invisible.
And the planet is what i want it for, i would just like a better sky, Thank you if you can help me out with this.

1 Like

So there isn’t any way to get the lighting for an object within it’s material, only post processing materials have access to that. But once we’re at post processing, there’s no way to make an object transparent. So the only way to get the effect you’re looking for is by faking it.

Essentially what you’re going want to do within the sky’s shader is determine how far each pixel is from the light and set the opacity based on that. In the sky’s blueprint, you’ll want to hold a reference to the light so you can access it’s position, and then update the material’s variables on tick to maintain the proper effect as the world moves around.

Here’s some snapshots to make it easier:


Hey there. I know it’s been a while, but could you upload this somewhere? I’m having trouble replicating this. Thanks <3