Light leaks 木漏れ日

Instead of doing something productive, I actually remembered I had an idea earlier last week to make some lighting effect so that it’s almost like the character’s world is situated in the canopy of trees where the light leaks in. (interestingly i just had a side thought as i was typing in that perhaps the skylight cloud probably isn’t going to be important since it should be obstructed by trees anyways.

ezgif.com-gif-maker (18).gif

I dug through a couple of google search and then realised this technique of having a “stencil” on a light is called a light cookie in unity, so i tried to search for the equivalent for UE4 - from a couple of forum posts I came to the realisation that i need to use the light function to impose the stencil texture.

Based on this water caustic tutorial, I had to do a bunch of adjustment to the actual shader graph to get what i need. I tried out many variation of panner, time, sine configuration for a wiggle effect. but then i ended up decided to scale back and just make flickering to the emission based on another texture with a linear sine (nice tip to learn today is that if you multiply the sine value by 0.5 then add 0.5 it makes it linear)

I also hooked up a colour and light intensity change with the day and night cycle inside of the BP sky sphere.

Next steps

  • Due diligence for the move to using an AI controller