[go: up one dir, main page]

A downloadable Shader for Ren'Py

Download NowName your own price
Optimized Outline Shader For Ren'Py

Version 1.1: Now with Drop Shadows

This shader is designed for developers who need professional Outlines and Drop Shadows without sacrificing game performance. While other shaders use heavy exponential sampling, this version utilizes a fixed-cost 3-ring sampling method (16 taps).

It ensures perfectly smooth visuals even on low-end laptops and "potato" PCs.

Key Features

  • Laptop Optimized: Constant sampling cost ensures zero FPS drops.
  • Drop Shadows: Full control over xoffset and yoffset for depth effects.
  • Smart Padding: Automatic mesh adjustment prevents the effect from being cut off.
  • Threshold Control: Fine-tune detection for both clean lineart and soft-painted sprites.

Installation & Usage

1. Download shader_outline.rpy and drop it into your /game folder.

2. Call the shader in your script using Presets (easy) or Custom parameters (pro):

# --- USE A PRESET ---
show character at outline_white_thick
show character at shadow_soft
# --- CUSTOM CONFIGURATION ---
show character at outline(width=5.0, xoffset=10, yoffset=10, color="#0006")

Available Presets

Preset Name Effect Description
outline_white_thin 2px clean white border
outline_black_thick 4px solid black border
shadow_soft 60% opacity black drop shadow
shadow_hard 100% opacity solid black shadow

License & Support

Licensed for both commercial and non-commercial projects. Attribution is required: you must credit GRIMUMU in your project's credits.

Supporting my work on Patreon allows me to continue developing high-performance tools for the Ren'Py community.

Follow me: Twitter/X | Instagram | Itch.io

Updated 10 days ago
Published 12 days ago
StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorGRIMUMU
GenreVisual Novel
Tagsasset, Dating Sim, grimumu, Indie, outline, Ren'Py, Shaders, Simple, Sprites

Download

Download NowName your own price

Click download now to get access to the following files:

shader_outline.rpy 5.8 kB

Development log

Comments

Log in with itch.io to leave a comment.

Everywhere I go I see reze

She’s the only sprite I’ve drawn, haha 😅

I am so here for this. Thank you. Q: Would this work on side image main character sprites as well? 

Hi! Thank you so much for your comment! I'm really glad you like the shader. 

Regarding your question: Yes, it works perfectly on side images! Since side images are handled as sprites in Ren'Py, you can apply the shader directly when defining your character.

The best way to do this is to apply the transform in the image definition so you don't have to call it every time. Here is an example:

# Applying a white outline preset to a side image sprite
image side reze = At("images/reze_side.png", outline_white_thin)
# --
# Now define your character using that side image
define r = Character("Reze", image="reze")
label start:
    r "As you can see, the outline works on my side image too!"

I hope this helps! Feel free to ask if you have any more questions.

I must be doing something wrong? It works for the center sprites just fine (and looks so good!), but it's not working for my side MC sprite.

I really appreciate your time! This is how I'm defining it in my image: 

image s w neutral = At("images/saki/work/side saki w neutral.png", outline_white_thick)

Unless there is something wrong with my sprite image, which I feel like there shouldn't be?

Hi there! Thank you for the feedback. I’ve analyzed why the shader might be acting up specifically with your Side MC sprite.

The issue isn't your sprite or the shader code itself, but how Ren'Py handles the "Side Image" container. When you define it using "At()", the shader expands the mesh to draw the outline , but the dialogue window often clips (cuts off) anything that goes outside its standard boundaries.

The fix is to apply the transform directly in your "screens.rpy" file:

  1. Open screens.rpy and locate the screen say(who, what): section.
  2. Find the line that says add SideImage().
  3. Apply the transform there like this:
if gui.show_side_image:
    add SideImage() at outline_white_thick

Pro Tip for your Sprites: Make sure your side saki PNG files have at least 10-15 pixels of empty transparency around the edges. If the character's hair or clothes touch the very edge of the image file, the shader won't have "canvas" space to draw the outline, even with the automatic padding.

Applying it in the screen is much more efficient as it handles all your MC's expressions at once! Let me know if this solves it for you.

Hmm. When I started the game after placing the additional code, it crashes? I can play around more, as I don't want to take up all your time figuring this out. You've been a big help already. It works just fine on the center based sprites though!

I’ve analyzed why the game is crashing. There was a syntax error in the previous code snippet, and applying the shader in two different places simultaneously can cause conflicts. Here is the direct fix:

1. Correct the code in screens.rpy

Open your "screens.rpy" file and locate the "screen say(who, what):" section. Find the line for the Side Image and replace that block with this exact code:

if side_image:
    add side_image at outline_white_thick:
        xalign 0.0
        yalign 1.0

Applying it directly in the screen is much more efficient as it handles all your MC's expressions at once.

2. Clean up your image definitions

You must remove any "at outline_white_thick" or similar transforms from your individual image definitions (like "image side saki..."). If you apply the shader in the image definition AND in the screen at the same time, the game will crash or have performance issues.

3. Padding Reminder

If the outline looks cut off, ensure your PNG files have at least 15 pixels of empty transparency around the edges. If the character's hair or clothes touch the edge of the image, the shader won't have space to draw the outline.

This should solve the crash and get the shader working perfectly. 

Did it work?