Jump to content

File:Glass greenshirt.png

From VNDev Wiki

Original file (1,920 × 1,080 pixels, file size: 53 KB, MIME type: image/png)

Summary

A scene using the sprite File:Glass worried sprite.png with a shader that makes the shirt green. Meant to show that shaders can be used to enable character customization, but for this example I just hardcoded a different color.

This is the code used in Ren'Py to show it:

init python:
    renpy.register_shader("CharacterCustomisation.ShirtCollie", variables="""
uniform sampler2D tex0;
uniform float u_amount;
uniform vec3 u_col;
uniform vec3 u_border;
varying vec2 v_tex_coord;
             
     """, fragment_300="""
    gl_FragColor = texture2D(tex0, v_tex_coord);
    if ((gl_FragColor.b>(gl_FragColor.r+gl_FragColor.g)) && (gl_FragColor.b>0.5)){
        gl_FragColor.rgb = u_col;
    }
    else if ((gl_FragColor.b>(gl_FragColor.r+gl_FragColor.g)*0.9) && (gl_FragColor.r+gl_FragColor.g<0.5)){
        gl_FragColor.rgb = u_col*0.5;
    }
     """)

transform greenshirt:
    shader "CharacterCustomisation.ShirtCollie"
    u_amount 0.95
    u_col (0.0, 0.8, 0.0)
    u_border (0.5, 0.4, 0.0)

And then the sprite is shown with the code show glass worried at left, greenshirt

Licensing

Template:CC-by-sa-2.5

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current13:49, 26 July 2025Thumbnail for version as of 13:49, 26 July 20251,920 × 1,080 (53 KB)Tale glider (talk | contribs)A scene using the sprite File:Glass worried sprite.png with a shader that makes the shirt green. Meant to show that shaders can be used to enable character customisation, but for this example I just hardcoded a different color. This is the code used in Ren'Py to show it: <pre> init python: renpy.register_shader("CharacterCustomisation.ShirtCollie", variables=""" uniform sampler2D tex0; uniform float u_amount; uniform vec3 u_col; uniform vec3 u_border; varying vec2 v_tex_coo...

The following page uses this file:

Metadata