Download

Cloud shadows

Hello everybody,

I was wondering how can I have cloud shadows moving on the ground without actually have clouds in the sky?
There was this feature in cryengine where you could give it a Black/White texture and it’d cast it on the terrain but I cant fine such thing in UE4 nor there’s anything on the docs.

Thank you.

Take a look at light functions :slight_smile:

That’s how it works in UDK: https://www.youtube.com/watch?v=1XRP3eluDeQ

For that you can use a LightFunction material and apply it to the Directional Light in your level. Here is a basic example of how to set it up:

Using a panner node along with a mask texture should be all you need. This is how Epic achieved the look in FortNite, it works pretty well, anything fancier would need actual cloud meshes as translucent materials don’t cast shadows, an issue I am trying to find a solution to currently as I need the clouds to cast shadows…

Hope that helps!

Edit: I’m too slow today, either that or fighters too fast… :cool:

Thank you both for the fast replies. I have made the material below but I have 2 problems.

hxxp://s1.xum.ir/2014/12/22/1.jpg

  1. The texture lightens the ground instead of darkening.
  2. The preview ball you see just keeps rotating left, right, left right. I need it to rotate on a single direction constantly. (figured this one out).

Sorry for the boob questions. Haven’t been into this editor enough.

  1. could you post your lightfunction properties? -> have you added the material to the directional light? :slight_smile:
  2. just use the panner without the time (change the direction + speed in the properties of the panner)

Just a short side note -> with a multiply + constant vector you can controle the density and brightness of the cloud shadows

e.g thats how it looks like in my case

6662a349150782dc0b335e945d1994d08416fb4a.jpeg

#1 - Just before the FeatureLevelSwitch node, add in a OneMinus node, this will flip the values. You don’t really need the FeatureLevelSwitch node at all if you aren’t making a game for Mobile & PC, if it’s just PC then just remove it.

For #2 I would keep the time node, but delete the Sine node, that is what is making it go side to side. With a Panner, TexCoord and a Time node it should pan the texture in one direction in a repeated loop, you can set the direction by clicking on the panner node and adding an X or Y value (or both, and can be positive or negative).

Yes I have added it to a directional light.

hxxp://s1.xum.ir/2014/12/22/1.jpg

Do you see what I mean?
Now if I turn the light to Red, the shadows are red, but if I turn it to black they disappear. I need black shadows.

Thank you both again. I figured it out.
The only problem I have now is the radius. How can I increase it?

hxxp://s1.xum.ir/2014/12/22/1.jpg

Normally it should tile it -> in the light function properties you can increase the size of the effect (Light Function Scale)

I think I wasn’t clear sorry. The cloud texture is already tiled and moving but it’s something with the rendering distance. The cloud shadows are rendered only within a certain distance from camera and I don’t see them farther if I don’t move forward.

hxxp://s1.xum.ir/2014/12/22/Untitled.jpg

Play around with the fade distance :slight_smile: (also in the light function settings)

I think you should be very careful where you hotlink your images from. If one of those girl pictures was something against rules here you could easily get infraction for something that is not entirely your fault.

So I am editing those hotlinked pictures, please fix them if its needed.

@fighter5347, Thanks for all the guidance.

@Nawrot, Sorry. I never saw that happening before, though I didn’t see the girls but I imagine what has happened. Would find a better host soon. Thanks.