TDS Making-Of #2: Leaves Shadow Effect With Renpy

Heyo, Fable again! Hope you liked my previous post about the camera effects. This time we will talk about another nice visual effect I found while trying to enhance the game script: the leave shadows!

It’s a known fact: anything looks cooler with leave shadows on it: the ground with yellow patches, your clothes as you roam through the forest, Raen’s chest…

I first found about the possibility of using shadow effects thanks to Katy133’s video that showcases Ren’py’s AlphaMask feature. If you want to try it for yourself, Katy133 helpfully provided a customizable mock game on Lemmasoft so you can try the shadow effect for yourself.

Let’s take this scene for example:

  show raen_surprised at center
    show expression AlphaMask("foliage_1", At("raen_surprised", center)) as mask
    with dissolve
    rs "Ah!"
    "I awoke with a start."
    rs "What was with that dream…? I feel like that’s not the first time, either..."

First you show Raen (“raen_surprised”, the regular sprite), then you show an “AlphaMask” that will call the image “foliage_1”, cut it to the shape of “raen_surprised”, and apply it on top of it. As a result, the image foliage_1 will only appear on top of Raen and will remain invisible in the rest of the screen.

If you don’t understand anything, that’s alright, I barely understand how it works myself. These really worked with a mix of dreams, trials and error and half a kidney donated to Satan.

​Perhaps this might be a little easier to understand:

As for that “foliage_1” image, I got it from the photograph of some tree canopy someone nicely cut out on Deviantart. Then I modified it with Photoshop like this:
– On the layer of the image, select “blending options” >>> “color overlay” >>> black color, opacity 100%
– Fill some areas with black so the sun doesn’t hit your character’s face in an awkward way
– Filter >>> Gaussian Blur 1,5%
– Lower the opacity to 40%
​- Profit

Of course I could have made the foliage myself with some cool leave brushes, but I’m lazy the end result doesn’t look too bad, right?

Now that you’ve got the idea, you can start experimenting! The cool thing with Alphamasks is that they can move with your sprites:

This way, you could make two characters dance under the moonlight…

Or make them stay right here and play some cool tricks by moving only the Alphamask:

image rosace_rotate:
    "rosace" with dissolve #calls the image file "rosace.png"
    rotate 0 #starts at 0°
    linear 20 rotate 360 #rotates 360° in 20 seconds
    repeat

show illran con at center
show expression AlphaMask("rosace2", At("illran con", center)) as mask

Or make them astral project with some big galaxy picture:

image galaxy1:
    "galaxy" with dissolve #refers to the image file "galaxy.png"
    size (1920, 1080) crop (0, 0, 1920, 1080) #starts at the bottom of the image
    linear 60.0 crop (0, 4000, 1920, 1080) #moves to top in 60 seconds
    linear 60.0 crop (0, 0, 1920, 1080) #goes back down
    repeat

show leos neutral at center with dissolve
show expression AlphaMask("galaxy1", At("leos neutral", center))  as mask    

Fun fact: if you ditch “Alphamask” and only display an “expression”, you can show the same character several times.

show ds surprised at slightleft
show expression "ds icysmile" at slightright as clone:
    xzoom -1.0 #flips the sprite horizontally
d "Is that what they call a doppelgänger?"

…. Looks like I got carried away again. Anyway, I highly doubt we’ll actually use of any these (aside from the leave shadows) in The Divine Speaker, but who knows what idea will come to me next.

Hope you found it useful! 😀

TDS Making-Of #2: Leaves Shadow Effect With Renpy
Scroll to top
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.