0% found this document useful (0 votes)
42 views66 pages

Log

The document details the initialization and loading process of the Ren'Py game engine version 8.3.7 on an Android device with specific hardware and software configurations. It includes performance metrics for various stages of the loading process, such as script loading and interface creation. Additionally, it provides technical details about the rendering process, including OpenGL ES version and shader code used for graphics rendering.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views66 pages

Log

The document details the initialization and loading process of the Ren'Py game engine version 8.3.7 on an Android device with specific hardware and software configurations. It includes performance metrics for various stages of the loading process, such as script loading and interface creation. Additionally, it provides technical details about the rendering process, including OpenGL ES version and shader code used for graphics rendering.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 66

2025-05-16 22:43:40 UTC

Alternative_Saves_Android_Port
Ren'Py 8.3.7.25031702

Manufacturer Xiaomi Model 2201117TL


Android Version: 13
Device Arch: android-arm64_v8a

Screen diagonal is 6.439898271117582 inches.


Version: Ren'Py 8.3.7.25031702
Mobile search paths: /data/user/0/averyfullhouse.tioeroge.com/files/game
/storage/emulated/0/Android/data/averyfullhouse.tioeroge.com/files/../../../../
Documents/TioEroge/averyfullhouse.tioeroge.com/game
Early init took 0.56s
Early init took 0.56s
Loading error handling took 0.86s
Loading error handling took 0.86s
Loading script took 5.66s
Loading script took 5.66s
Saving to
/storage/emulated/0/Android/data/averyfullhouse.tioeroge.com/files/../../../../
Documents/TioEroge/averyfullhouse.tioeroge.com
Loading save slot metadata took 0.54s
Loading save slot metadata took 0.54s
Loading persistent took 0.00s
Loading persistent took 0.00s
Set script version to: (8, 3, 4)
- Init at Characters/Mom/mom.rpyc:81 took 0.79814 s.
Unable to get height for _mom. Using default 1.0.
Unable to get height for _cheerleader. Using default 1.0.
Unable to get height for _firebrand. Using default 1.0.
Unable to get height for _jock. Using default 1.0.
Unable to get height for _nerd. Using default 1.0.
Unable to get height for _slacker. Using default 1.0.
- Init at Characters/Mom/mom.rpyc:5 took 0.59435 s.
- Init at Locations/Home/Backyard/backyard.rpyc:4 took 0.31702 s.
- Init at tl/PortTE/replaceText.rpyc:1 took 0.79062 s.
- Init at tl/SpanishTE/replaceText.rpyc:1 took 0.85495 s.
Running init code took 7.01s
Running init code took 7.01s
Loading analysis data took 0.10s
Loading analysis data took 0.10s
Analyze and compile ATL took 0.11s
Analyze and compile ATL took 0.11s
Reloading save slot metadata took 0.17s
Reloading save slot metadata took 0.17s
Index archives took 0.00s
Index archives took 0.00s
Dump and make backups took 0.00s
Dump and make backups took 0.00s
Cleaning cache took 0.00s
Cleaning cache took 0.00s
Making clean stores took 0.01s
Making clean stores took 0.01s
Initial gc took 1.12s
Initial gc took 1.12s
DPI scale factor: 1.000000
Creating interface object took 0.04s
Creating interface object took 0.04s
Cleaning stores took 0.00s
Cleaning stores took 0.00s
Init translation took 0.01s
Init translation took 0.01s
Build styles took 0.01s
Build styles took 0.01s
Load screen analysis took 0.39s
Load screen analysis took 0.39s
Analyze screens took 0.01s
Analyze screens took 0.01s
Save screen analysis took 0.00s
Save screen analysis took 0.00s
Prepare screens took 1.42s
Prepare screens took 1.42s
Save pyanalysis. took 0.00s
Save pyanalysis. took 0.00s
Save bytecode. took 0.00s
Save bytecode. took 0.00s
Running _start took 0.04s
Running _start took 0.04s
Interface start took 10.40s
Interface start took 10.40s

Initializing gles2 renderer:


primary display bounds: (0, 0, 2197, 987)
swap interval: 1 frames
Fullscreen mode.
Vendor: "b'Qualcomm'"
Renderer: b'Adreno (TM) 610'
Version: b'OpenGL ES 3.2 V@0502.41 (GIT@43fc279f3a, I58833f8ed4, 1679659134)
(Date:03/24/23)'
Display Info: None
Screen sizes: virtual=(2560, 1440) physical=(2307, 1080) drawable=(2307, 1080)
vertex live2d.colors, live2d.flip_texture, live2d.mask, renpy.alpha,
renpy.geometry, renpy.matrixcolor, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;
v_tex_coord.y = 1.0 - v_tex_coord.y;
}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, live2d.mask, renpy.alpha,
renpy.geometry, renpy.matrixcolor, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * mask.a;

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, live2d.mask, renpy.geometry,
renpy.matrixcolor, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, live2d.mask, renpy.geometry,
renpy.matrixcolor, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * mask.a;

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.imagedissolve, renpy.texture ----------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.imagedissolve, renpy.texture --------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_dissolve_multiplier;
uniform float u_renpy_dissolve_offset;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform sampler2D tex2;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color0 = texture2D(tex0, v_tex_coord.st, u_lod_bias);


vec4 color1 = texture2D(tex1, v_tex_coord.st, u_lod_bias);
vec4 color2 = texture2D(tex2, v_tex_coord.st, u_lod_bias);

float a = clamp((color0.a + u_renpy_dissolve_offset) *


u_renpy_dissolve_multiplier, 0.0, 1.0);
gl_FragColor = mix(color1, color2, a);
}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, live2d.inverted_mask, renpy.geometry,
renpy.matrixcolor, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, live2d.inverted_mask, renpy.geometry,
renpy.matrixcolor, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * (1.0 - mask.a);

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, renpy.geometry, renpy.matrixcolor, renpy.texture ---
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, renpy.geometry, renpy.matrixcolor, renpy.texture -
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.mask ----------------------------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.mask --------------------------------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_mask_multiplier;
uniform float u_renpy_mask_offset;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_tex_coord;

void main() {

vec4 src = texture2D(tex0, v_tex_coord.st, u_lod_bias);


vec4 mask = texture2D(tex1, v_tex_coord.st, u_lod_bias);

gl_FragColor = src * (mask.a * u_renpy_mask_multiplier +


u_renpy_mask_offset);
}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, live2d.inverted_mask, renpy.alpha,
renpy.geometry, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;
v_tex_coord.y = 1.0 - v_tex_coord.y;
}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, live2d.inverted_mask, renpy.alpha,
renpy.geometry, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * (1.0 - mask.a);

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, live2d.mask, renpy.alpha, renpy.geometry,
renpy.matrixcolor, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, live2d.mask, renpy.alpha, renpy.geometry,
renpy.matrixcolor, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * mask.a;

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, live2d.mask, renpy.geometry, renpy.texture ---------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, live2d.mask, renpy.geometry, renpy.texture -------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * mask.a;
}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.matrixcolor ---------------------------------------
#version 100
attribute vec4 a_position;
uniform mat4 u_transform;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;


}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.matrixcolor -------------------------------------
#version 100
precision mediump float;
uniform mat4 u_renpy_matrixcolor;

void main() {

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, renpy.alpha, renpy.geometry,
renpy.matrixcolor, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;


v_tex_coord = a_tex_coord;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, renpy.alpha, renpy.geometry,
renpy.matrixcolor, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex renpy.alpha, renpy.geometry, renpy.matrixcolor, renpy.texture -----------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.alpha, renpy.geometry, renpy.matrixcolor, renpy.texture ---------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex renpy.alpha, renpy.geometry, renpy.texture ------------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.alpha, renpy.geometry, renpy.texture ----------------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, renpy.geometry, renpy.texture ----------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, renpy.geometry, renpy.texture --------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform sampler2D tex0;
varying vec2 v_tex_coord;
void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);


}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, renpy.alpha, renpy.geometry, renpy.texture ---------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, renpy.alpha, renpy.geometry, renpy.texture -------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, live2d.mask, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;
gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, live2d.mask, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * mask.a;

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.solid ---------------------------------------------
#version 100
attribute vec4 a_position;
uniform mat4 u_transform;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;


}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.solid -------------------------------------------
#version 100
precision mediump float;
uniform vec4 u_renpy_solid_color;

void main() {

gl_FragColor = u_renpy_solid_color;
}
--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, live2d.mask, renpy.geometry,
renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, live2d.mask, renpy.geometry,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * mask.a;

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);
}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.imagedissolve, renpy.matrixcolor, renpy.texture ---
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.imagedissolve, renpy.matrixcolor, renpy.texture -
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_dissolve_multiplier;
uniform float u_renpy_dissolve_offset;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform sampler2D tex2;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color0 = texture2D(tex0, v_tex_coord.st, u_lod_bias);


vec4 color1 = texture2D(tex1, v_tex_coord.st, u_lod_bias);
vec4 color2 = texture2D(tex2, v_tex_coord.st, u_lod_bias);

float a = clamp((color0.a + u_renpy_dissolve_offset) *


u_renpy_dissolve_multiplier, 0.0, 1.0);
gl_FragColor = mix(color1, color2, a);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex remix.smoothstep_outline, renpy.alpha, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment remix.smoothstep_outline, renpy.alpha, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_low_color_fade;
uniform float u_mesh_pad;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform float u_step_end;
uniform float u_step_start;
uniform float u_threshold;
uniform float u_width;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform vec2 u_model_size;
uniform vec4 u_color;
uniform vec4 u_far_color;
uniform vec4 u_low_color;
varying vec2 v_tex_coord;

# line 74 "outline_shader.rpy "

// given a 0.0 to 1.0 distance, return alpha based on smoothstep values


float get_step_alpha(float d, float s, float e)
{
return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
}

bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D tex0,
float threshold) {
// x,y
if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}

// -x, y (if x is not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}
}

// x, -y (if y is not 0)
if (y > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}

// -x, -y (if both x and y not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}
}
}
return false;
}

float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,


float u_width, vec2 pixel_size, float max_dist) {
float nearest = 0.0;
for (float x = 1.0; x <= u_width; x += 1.0) {
float x_dist = pow(x, 2);
for (float y = 0.0; y <= x; y += 1.0) {
float d = pow(y, 2) + x_dist;
if (nearest > 0.1) max_dist = nearest;
if (d > max_dist) break;

vec2 pxo = vec2(x, y) * pixel_size;


// best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
nearest = d;
}

if (x > y) {
vec2 pyo = vec2(y, x) * pixel_size;
// best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
nearest = d;
}
}
}
}
return nearest;
}

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

# line 140 "outline_shader.rpy "

vec2 padded_size = u_model_size;


if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;

vec2 pos = v_tex_coord.xy;


vec2 pixel_size = (vec2(1.) / padded_size);

float max_dist = pow(u_width, 2);

// only want outlines where the image is part or fully transparent


if (gl_FragColor.a < 0.98) {
// the square distance of nearest threshold alpha pixel
float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
u_width, pixel_size, max_dist);
if (near > 0.1) {
// Now we can do the sqrt
float dist = sqrt(near) / u_width;
float color_dist = (dist - u_step_start) / (u_step_end - u_step_start);
vec4 color = mix(u_color, u_far_color, color_dist);
float alpha = get_step_alpha(dist, u_step_start, u_step_end);
if (u_low_color != u_color && alpha < 0.99) {
color = (u_low_color_fade > 0.5) ?
mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
u_low_color;
}
alpha *= u_color.a;
// this pixel should be altered
if (gl_FragColor.a > 0.05 && alpha > 0.05) {
// some edge pixel that has some opacity
gl_FragColor = vec4(
mix(color.rgb,
gl_FragColor.rgb,
gl_FragColor.a / (gl_FragColor.a + alpha)),
1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
} else {
gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
}
}
}

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
Error compiling shader ('remix.smoothstep_outline', 'renpy.alpha',
'renpy.geometry', 'renpy.matrixcolor', 'renpy.texture'):
1 #version 100
2 precision mediump float;
3 uniform float u_lod_bias;
4 uniform float u_low_color_fade;
5 uniform float u_mesh_pad;
6 uniform float u_renpy_alpha;
7 uniform float u_renpy_over;
8 uniform float u_step_end;
9 uniform float u_step_start;
10 uniform float u_threshold;
11 uniform float u_width;
12 uniform mat4 u_renpy_matrixcolor;
13 uniform sampler2D tex0;
14 uniform vec2 u_model_size;
15 uniform vec4 u_color;
16 uniform vec4 u_far_color;
17 uniform vec4 u_low_color;
18 varying vec2 v_tex_coord;
19
20 # line 74 "outline_shader.rpy "
21
22 // given a 0.0 to 1.0 distance, return alpha based on smoothstep values
23 float get_step_alpha(float d, float s, float e)
24 {
25 return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
26 }
27
28 bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D
tex0, float threshold) {
29 // x,y
30 if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
31 return true;
32 }
33
34 // -x, y (if x is not 0)
35 if (x > 0.1) {
36 if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a
>= threshold) {
37 return true;
38 }
39 }
40
41 // x, -y (if y is not 0)
42 if (y > 0.1) {
43 if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a
>= threshold) {
44 return true;
45 }
46
47 // -x, -y (if both x and y not 0)
48 if (x > 0.1) {
49 if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >=
threshold) {
50 return true;
51 }
52 }
53 }
54 return false;
55 }
56
57 float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,
58 float u_width, vec2 pixel_size, float max_dist) {
59 float nearest = 0.0;
60 for (float x = 1.0; x <= u_width; x += 1.0) {
61 float x_dist = pow(x, 2);
62 for (float y = 0.0; y <= x; y += 1.0) {
63 float d = pow(y, 2) + x_dist;
64 if (nearest > 0.1) max_dist = nearest;
65 if (d > max_dist) break;
66
67 vec2 pxo = vec2(x, y) * pixel_size;
68 // best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
69 if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
70 nearest = d;
71 }
72
73 if (x > y) {
74 vec2 pyo = vec2(y, x) * pixel_size;
75 // best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
76 if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
77 nearest = d;
78 }
79 }
80 }
81 }
82 return nearest;
83 }
84
85 void main() {
86
87 gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);
88
89 # line 140 "outline_shader.rpy "
90
91 vec2 padded_size = u_model_size;
92 if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;
93
94 vec2 pos = v_tex_coord.xy;
95 vec2 pixel_size = (vec2(1.) / padded_size);
96
97 float max_dist = pow(u_width, 2);
98
99 // only want outlines where the image is part or fully transparent
100 if (gl_FragColor.a < 0.98) {
101 // the square distance of nearest threshold alpha pixel
102 float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
103 u_width, pixel_size, max_dist);
104 if (near > 0.1) {
105 // Now we can do the sqrt
106 float dist = sqrt(near) / u_width;
107 float color_dist = (dist - u_step_start) / (u_step_end -
u_step_start);
108 vec4 color = mix(u_color, u_far_color, color_dist);
109 float alpha = get_step_alpha(dist, u_step_start, u_step_end);
110 if (u_low_color != u_color && alpha < 0.99) {
111 color = (u_low_color_fade > 0.5) ?
112 mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
113 u_low_color;
114 }
115 alpha *= u_color.a;
116 // this pixel should be altered
117 if (gl_FragColor.a > 0.05 && alpha > 0.05) {
118 // some edge pixel that has some opacity
119 gl_FragColor = vec4(
120 mix(color.rgb,
121 gl_FragColor.rgb,
122 gl_FragColor.a / (gl_FragColor.a + alpha)),
123 1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
124 } else {
125 gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
126 }
127 }
128 }
129
130 gl_FragColor = u_renpy_matrixcolor * gl_FragColor;
131
132 gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,
u_renpy_alpha, u_renpy_alpha * u_renpy_over);
133 }
Precompiling shader ('remix.smoothstep_outline', 'renpy.alpha', 'renpy.geometry',
'renpy.matrixcolor', 'renpy.texture'):
Traceback (most recent call last):
File "renpy/gl2\gl2shadercache.py", line 430, in load
File "renpy/gl2\gl2shadercache.py", line 352, in get
File "gl2shader.pyx", line 315, in renpy.gl2.gl2shader.Program.load
File "gl2shader.pyx", line 298, in renpy.gl2.gl2shader.Program.load_shader
renpy.gl2.gl2shader.ShaderError: ERROR: 0:20: '' : GLSL compile error:
malformed preprocessor directive
ERROR: 0:61: 'pow' : no matching overloaded function found
ERROR: 0:63: 'pow' : no matching overloaded function found
ERROR: 0:89: '' : GLSL compile error: malformed preprocessor directive
ERROR: 0:92: '*' : wrong operand types no operation '*' exists that takes a left-
hand operand of type '2-component vector of float' and a right operand of type
'const int' (or there is no acceptable conversion)
ERROR: 0:97: 'pow' : no matching overloaded function found
ERROR: 6 compilation errors. No code generated.

vertex renpy.geometry, renpy.imagedissolve -------------------------------------


#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.imagedissolve -----------------------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_dissolve_multiplier;
uniform float u_renpy_dissolve_offset;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform sampler2D tex2;
varying vec2 v_tex_coord;

void main() {

vec4 color0 = texture2D(tex0, v_tex_coord.st, u_lod_bias);


vec4 color1 = texture2D(tex1, v_tex_coord.st, u_lod_bias);
vec4 color2 = texture2D(tex2, v_tex_coord.st, u_lod_bias);

float a = clamp((color0.a + u_renpy_dissolve_offset) *


u_renpy_dissolve_multiplier, 0.0, 1.0);
gl_FragColor = mix(color1, color2, a);
}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.matrixcolor, renpy.solid --------------------------
#version 100
attribute vec4 a_position;
uniform mat4 u_transform;

void main() {

gl_Position = a_position;
gl_Position = u_transform * gl_Position;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.matrixcolor, renpy.solid ------------------------
#version 100
precision mediump float;
uniform mat4 u_renpy_matrixcolor;
uniform vec4 u_renpy_solid_color;

void main() {

gl_FragColor = u_renpy_solid_color;

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.matrixcolor, renpy.texture ------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.matrixcolor, renpy.texture ----------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, renpy.alpha, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;
void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, renpy.alpha, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, renpy.alpha, renpy.geometry,
renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, renpy.alpha, renpy.geometry,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform sampler2D tex0;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex renpy.geometry ----------------------------------------------------------
#version 100
attribute vec4 a_position;
uniform mat4 u_transform;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;


}

--------------------------------------------------------------------------------
fragment renpy.geometry --------------------------------------------------------
#version 100
precision mediump float;

void main() {
}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.imagedissolve, renpy.matrixcolor ------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.imagedissolve, renpy.matrixcolor ----------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_dissolve_multiplier;
uniform float u_renpy_dissolve_offset;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform sampler2D tex2;
varying vec2 v_tex_coord;

void main() {

vec4 color0 = texture2D(tex0, v_tex_coord.st, u_lod_bias);


vec4 color1 = texture2D(tex1, v_tex_coord.st, u_lod_bias);
vec4 color2 = texture2D(tex2, v_tex_coord.st, u_lod_bias);

float a = clamp((color0.a + u_renpy_dissolve_offset) *


u_renpy_dissolve_multiplier, 0.0, 1.0);
gl_FragColor = mix(color1, color2, a);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, live2d.mask, renpy.alpha,
renpy.geometry, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, live2d.mask, renpy.alpha,
renpy.geometry, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * mask.a;

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, renpy.geometry, renpy.texture -------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, renpy.geometry, renpy.texture -----
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform sampler2D tex0;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);
}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.texture -------------------------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.texture -----------------------------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);


}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, live2d.inverted_mask, renpy.alpha,
renpy.geometry, renpy.matrixcolor, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;
v_tex_coord.y = 1.0 - v_tex_coord.y;
}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, live2d.inverted_mask, renpy.alpha,
renpy.geometry, renpy.matrixcolor, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * (1.0 - mask.a);

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex live2d.colors, live2d.flip_texture, live2d.inverted_mask, renpy.geometry,
renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.colors, live2d.flip_texture, live2d.inverted_mask, renpy.geometry,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform sampler2D tex0;
uniform sampler2D tex1;
uniform vec4 u_multiply;
uniform vec4 u_screen;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * (1.0 - mask.a);

gl_FragColor.rgb = gl_FragColor.rgb * u_multiply.rgb;


gl_FragColor.rgb = (gl_FragColor.rgb + u_screen.rgb * gl_FragColor.a) -
(gl_FragColor.rgb * u_screen.rgb);
}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, live2d.mask, renpy.alpha, renpy.geometry, renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;
v_tex_coord.y = 1.0 - v_tex_coord.y;
}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, live2d.mask, renpy.alpha, renpy.geometry,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * mask.a;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex renpy.blur, renpy.geometry, renpy.matrixcolor ---------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.blur, renpy.geometry, renpy.matrixcolor -------------------------
#version 100
precision mediump float;
uniform float u_renpy_blur_log2;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = vec4(0.);
float renpy_blur_norm = 0.;
for (float i = -5.; i < 1.; i += 1.) {
float renpy_blur_weight = exp(-0.5 * pow(u_renpy_blur_log2 - i, 2.));
renpy_blur_norm += renpy_blur_weight;
}

gl_FragColor += renpy_blur_norm * texture2D(tex0, v_tex_coord.xy, 0.);

for (float i = 1.; i < 14.; i += 1.) {

if (i >= u_renpy_blur_log2 + 5.) {


break;
}

float renpy_blur_weight = exp(-0.5 * pow(u_renpy_blur_log2 - i, 2.));


gl_FragColor += renpy_blur_weight * texture2D(tex0, v_tex_coord.xy, i);
renpy_blur_norm += renpy_blur_weight;
}

if (renpy_blur_norm > 0.0) {


gl_FragColor /= renpy_blur_norm;
} else {
gl_FragColor = texture2D(tex0, v_tex_coord.xy, 0.0);
}

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex renpy.dissolve, renpy.geometry ------------------------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.dissolve, renpy.geometry ----------------------------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_dissolve;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_tex_coord;

void main() {

vec4 color0 = texture2D(tex0, v_tex_coord.st, u_lod_bias);


vec4 color1 = texture2D(tex1, v_tex_coord.st, u_lod_bias);
gl_FragColor = mix(color0, color1, u_renpy_dissolve);
}

--------------------------------------------------------------------------------
vertex live2d.flip_texture, live2d.inverted_mask, renpy.alpha, renpy.geometry,
renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, live2d.inverted_mask, renpy.alpha, renpy.geometry,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * (1.0 - mask.a);

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex remix.smoothstep_outline, renpy.geometry, renpy.texture -----------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

--------------------------------------------------------------------------------
fragment remix.smoothstep_outline, renpy.geometry, renpy.texture ---------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_low_color_fade;
uniform float u_mesh_pad;
uniform float u_step_end;
uniform float u_step_start;
uniform float u_threshold;
uniform float u_width;
uniform sampler2D tex0;
uniform vec2 u_model_size;
uniform vec4 u_color;
uniform vec4 u_far_color;
uniform vec4 u_low_color;
varying vec2 v_tex_coord;

# line 74 "outline_shader.rpy "

// given a 0.0 to 1.0 distance, return alpha based on smoothstep values


float get_step_alpha(float d, float s, float e)
{
return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
}

bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D tex0,
float threshold) {
// x,y
if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}

// -x, y (if x is not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}
}

// x, -y (if y is not 0)
if (y > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}

// -x, -y (if both x and y not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}
}
}
return false;
}

float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,


float u_width, vec2 pixel_size, float max_dist) {
float nearest = 0.0;
for (float x = 1.0; x <= u_width; x += 1.0) {
float x_dist = pow(x, 2);
for (float y = 0.0; y <= x; y += 1.0) {
float d = pow(y, 2) + x_dist;
if (nearest > 0.1) max_dist = nearest;
if (d > max_dist) break;

vec2 pxo = vec2(x, y) * pixel_size;


// best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
nearest = d;
}

if (x > y) {
vec2 pyo = vec2(y, x) * pixel_size;
// best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
nearest = d;
}
}
}
}
return nearest;
}

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

# line 140 "outline_shader.rpy "

vec2 padded_size = u_model_size;


if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;

vec2 pos = v_tex_coord.xy;


vec2 pixel_size = (vec2(1.) / padded_size);

float max_dist = pow(u_width, 2);

// only want outlines where the image is part or fully transparent


if (gl_FragColor.a < 0.98) {
// the square distance of nearest threshold alpha pixel
float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
u_width, pixel_size, max_dist);
if (near > 0.1) {
// Now we can do the sqrt
float dist = sqrt(near) / u_width;
float color_dist = (dist - u_step_start) / (u_step_end - u_step_start);
vec4 color = mix(u_color, u_far_color, color_dist);
float alpha = get_step_alpha(dist, u_step_start, u_step_end);
if (u_low_color != u_color && alpha < 0.99) {
color = (u_low_color_fade > 0.5) ?
mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
u_low_color;
}
alpha *= u_color.a;
// this pixel should be altered
if (gl_FragColor.a > 0.05 && alpha > 0.05) {
// some edge pixel that has some opacity
gl_FragColor = vec4(
mix(color.rgb,
gl_FragColor.rgb,
gl_FragColor.a / (gl_FragColor.a + alpha)),
1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
} else {
gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
}
}
}
}

--------------------------------------------------------------------------------
Error compiling shader ('remix.smoothstep_outline', 'renpy.geometry',
'renpy.texture'):
1 #version 100
2 precision mediump float;
3 uniform float u_lod_bias;
4 uniform float u_low_color_fade;
5 uniform float u_mesh_pad;
6 uniform float u_step_end;
7 uniform float u_step_start;
8 uniform float u_threshold;
9 uniform float u_width;
10 uniform sampler2D tex0;
11 uniform vec2 u_model_size;
12 uniform vec4 u_color;
13 uniform vec4 u_far_color;
14 uniform vec4 u_low_color;
15 varying vec2 v_tex_coord;
16
17 # line 74 "outline_shader.rpy "
18
19 // given a 0.0 to 1.0 distance, return alpha based on smoothstep values
20 float get_step_alpha(float d, float s, float e)
21 {
22 return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
23 }
24
25 bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D
tex0, float threshold) {
26 // x,y
27 if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
28 return true;
29 }
30
31 // -x, y (if x is not 0)
32 if (x > 0.1) {
33 if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a
>= threshold) {
34 return true;
35 }
36 }
37
38 // x, -y (if y is not 0)
39 if (y > 0.1) {
40 if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a
>= threshold) {
41 return true;
42 }
43
44 // -x, -y (if both x and y not 0)
45 if (x > 0.1) {
46 if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >=
threshold) {
47 return true;
48 }
49 }
50 }
51 return false;
52 }
53
54 float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,
55 float u_width, vec2 pixel_size, float max_dist) {
56 float nearest = 0.0;
57 for (float x = 1.0; x <= u_width; x += 1.0) {
58 float x_dist = pow(x, 2);
59 for (float y = 0.0; y <= x; y += 1.0) {
60 float d = pow(y, 2) + x_dist;
61 if (nearest > 0.1) max_dist = nearest;
62 if (d > max_dist) break;
63
64 vec2 pxo = vec2(x, y) * pixel_size;
65 // best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
66 if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
67 nearest = d;
68 }
69
70 if (x > y) {
71 vec2 pyo = vec2(y, x) * pixel_size;
72 // best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
73 if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
74 nearest = d;
75 }
76 }
77 }
78 }
79 return nearest;
80 }
81
82 void main() {
83
84 gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);
85
86 # line 140 "outline_shader.rpy "
87
88 vec2 padded_size = u_model_size;
89 if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;
90
91 vec2 pos = v_tex_coord.xy;
92 vec2 pixel_size = (vec2(1.) / padded_size);
93
94 float max_dist = pow(u_width, 2);
95
96 // only want outlines where the image is part or fully transparent
97 if (gl_FragColor.a < 0.98) {
98 // the square distance of nearest threshold alpha pixel
99 float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
100 u_width, pixel_size, max_dist);
101 if (near > 0.1) {
102 // Now we can do the sqrt
103 float dist = sqrt(near) / u_width;
104 float color_dist = (dist - u_step_start) / (u_step_end -
u_step_start);
105 vec4 color = mix(u_color, u_far_color, color_dist);
106 float alpha = get_step_alpha(dist, u_step_start, u_step_end);
107 if (u_low_color != u_color && alpha < 0.99) {
108 color = (u_low_color_fade > 0.5) ?
109 mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
110 u_low_color;
111 }
112 alpha *= u_color.a;
113 // this pixel should be altered
114 if (gl_FragColor.a > 0.05 && alpha > 0.05) {
115 // some edge pixel that has some opacity
116 gl_FragColor = vec4(
117 mix(color.rgb,
118 gl_FragColor.rgb,
119 gl_FragColor.a / (gl_FragColor.a + alpha)),
120 1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
121 } else {
122 gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
123 }
124 }
125 }
126 }
Precompiling shader ('remix.smoothstep_outline', 'renpy.geometry',
'renpy.texture'):
Traceback (most recent call last):
File "renpy/gl2\gl2shadercache.py", line 430, in load
File "renpy/gl2\gl2shadercache.py", line 352, in get
File "gl2shader.pyx", line 315, in renpy.gl2.gl2shader.Program.load
File "gl2shader.pyx", line 298, in renpy.gl2.gl2shader.Program.load_shader
renpy.gl2.gl2shader.ShaderError: ERROR: 0:17: '' : GLSL compile error:
malformed preprocessor directive
ERROR: 0:58: 'pow' : no matching overloaded function found
ERROR: 0:60: 'pow' : no matching overloaded function found
ERROR: 0:86: '' : GLSL compile error: malformed preprocessor directive
ERROR: 0:89: '*' : wrong operand types no operation '*' exists that takes a left-
hand operand of type '2-component vector of float' and a right operand of type
'const int' (or there is no acceptable conversion)
ERROR: 0:94: 'pow' : no matching overloaded function found
ERROR: 6 compilation errors. No code generated.

vertex live2d.flip_texture, live2d.inverted_mask, renpy.geometry, renpy.texture


#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform float u_live2d_ppu;
uniform mat4 u_transform;
uniform vec2 u_live2d_offset;
uniform vec2 u_model_size;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

v_tex_coord = a_tex_coord;
v_mask_coord = (a_position.xy * u_live2d_ppu + u_live2d_offset) /
u_model_size;
v_mask_coord.y = 1.0 - v_mask_coord.y;

v_tex_coord.y = 1.0 - v_tex_coord.y;


}

--------------------------------------------------------------------------------
fragment live2d.flip_texture, live2d.inverted_mask, renpy.geometry, renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_mask_coord;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

vec4 color = texture2D(tex0, v_tex_coord);


vec4 mask = texture2D(tex1, v_mask_coord);
gl_FragColor = color * (1.0 - mask.a);
}

--------------------------------------------------------------------------------
vertex renpy.alpha, renpy.blur, renpy.geometry ---------------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;
void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.alpha, renpy.blur, renpy.geometry -------------------------------
#version 100
precision mediump float;
uniform float u_renpy_alpha;
uniform float u_renpy_blur_log2;
uniform float u_renpy_over;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = vec4(0.);
float renpy_blur_norm = 0.;

for (float i = -5.; i < 1.; i += 1.) {


float renpy_blur_weight = exp(-0.5 * pow(u_renpy_blur_log2 - i, 2.));
renpy_blur_norm += renpy_blur_weight;
}

gl_FragColor += renpy_blur_norm * texture2D(tex0, v_tex_coord.xy, 0.);

for (float i = 1.; i < 14.; i += 1.) {

if (i >= u_renpy_blur_log2 + 5.) {


break;
}

float renpy_blur_weight = exp(-0.5 * pow(u_renpy_blur_log2 - i, 2.));


gl_FragColor += renpy_blur_weight * texture2D(tex0, v_tex_coord.xy, i);
renpy_blur_norm += renpy_blur_weight;
}

if (renpy_blur_norm > 0.0) {


gl_FragColor /= renpy_blur_norm;
} else {
gl_FragColor = texture2D(tex0, v_tex_coord.xy, 0.0);
}

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex renpy.ftl ---------------------------------------------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
varying vec2 v_tex_coord;
void main() {

v_tex_coord = a_tex_coord;
gl_Position = a_position;
}

--------------------------------------------------------------------------------
fragment renpy.ftl -------------------------------------------------------------
#version 100
precision mediump float;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, -1.0);


}

--------------------------------------------------------------------------------
vertex remix.smoothstep_outline, renpy.geometry, renpy.texture -----------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

--------------------------------------------------------------------------------
fragment remix.smoothstep_outline, renpy.geometry, renpy.texture ---------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_low_color_fade;
uniform float u_mesh_pad;
uniform float u_step_end;
uniform float u_step_start;
uniform float u_threshold;
uniform float u_width;
uniform sampler2D tex0;
uniform vec2 u_model_size;
uniform vec4 u_color;
uniform vec4 u_far_color;
uniform vec4 u_low_color;
varying vec2 v_tex_coord;

# line 74 "outline_shader.rpy "

// given a 0.0 to 1.0 distance, return alpha based on smoothstep values


float get_step_alpha(float d, float s, float e)
{
return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
}

bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D tex0,
float threshold) {
// x,y
if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}

// -x, y (if x is not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}
}

// x, -y (if y is not 0)
if (y > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}

// -x, -y (if both x and y not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}
}
}
return false;
}

float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,


float u_width, vec2 pixel_size, float max_dist) {
float nearest = 0.0;
for (float x = 1.0; x <= u_width; x += 1.0) {
float x_dist = pow(x, 2);
for (float y = 0.0; y <= x; y += 1.0) {
float d = pow(y, 2) + x_dist;
if (nearest > 0.1) max_dist = nearest;
if (d > max_dist) break;

vec2 pxo = vec2(x, y) * pixel_size;


// best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
nearest = d;
}

if (x > y) {
vec2 pyo = vec2(y, x) * pixel_size;
// best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
nearest = d;
}
}
}
}
return nearest;
}

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

# line 140 "outline_shader.rpy "

vec2 padded_size = u_model_size;


if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;

vec2 pos = v_tex_coord.xy;


vec2 pixel_size = (vec2(1.) / padded_size);

float max_dist = pow(u_width, 2);

// only want outlines where the image is part or fully transparent


if (gl_FragColor.a < 0.98) {
// the square distance of nearest threshold alpha pixel
float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
u_width, pixel_size, max_dist);
if (near > 0.1) {
// Now we can do the sqrt
float dist = sqrt(near) / u_width;
float color_dist = (dist - u_step_start) / (u_step_end - u_step_start);
vec4 color = mix(u_color, u_far_color, color_dist);
float alpha = get_step_alpha(dist, u_step_start, u_step_end);
if (u_low_color != u_color && alpha < 0.99) {
color = (u_low_color_fade > 0.5) ?
mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
u_low_color;
}
alpha *= u_color.a;
// this pixel should be altered
if (gl_FragColor.a > 0.05 && alpha > 0.05) {
// some edge pixel that has some opacity
gl_FragColor = vec4(
mix(color.rgb,
gl_FragColor.rgb,
gl_FragColor.a / (gl_FragColor.a + alpha)),
1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
} else {
gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
}
}
}
}

--------------------------------------------------------------------------------
Error compiling shader ('remix.smoothstep_outline', 'renpy.geometry',
'renpy.texture'):
1 #version 100
2 precision mediump float;
3 uniform float u_lod_bias;
4 uniform float u_low_color_fade;
5 uniform float u_mesh_pad;
6 uniform float u_step_end;
7 uniform float u_step_start;
8 uniform float u_threshold;
9 uniform float u_width;
10 uniform sampler2D tex0;
11 uniform vec2 u_model_size;
12 uniform vec4 u_color;
13 uniform vec4 u_far_color;
14 uniform vec4 u_low_color;
15 varying vec2 v_tex_coord;
16
17 # line 74 "outline_shader.rpy "
18
19 // given a 0.0 to 1.0 distance, return alpha based on smoothstep values
20 float get_step_alpha(float d, float s, float e)
21 {
22 return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
23 }
24
25 bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D
tex0, float threshold) {
26 // x,y
27 if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
28 return true;
29 }
30
31 // -x, y (if x is not 0)
32 if (x > 0.1) {
33 if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a
>= threshold) {
34 return true;
35 }
36 }
37
38 // x, -y (if y is not 0)
39 if (y > 0.1) {
40 if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a
>= threshold) {
41 return true;
42 }
43
44 // -x, -y (if both x and y not 0)
45 if (x > 0.1) {
46 if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >=
threshold) {
47 return true;
48 }
49 }
50 }
51 return false;
52 }
53
54 float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,
55 float u_width, vec2 pixel_size, float max_dist) {
56 float nearest = 0.0;
57 for (float x = 1.0; x <= u_width; x += 1.0) {
58 float x_dist = pow(x, 2);
59 for (float y = 0.0; y <= x; y += 1.0) {
60 float d = pow(y, 2) + x_dist;
61 if (nearest > 0.1) max_dist = nearest;
62 if (d > max_dist) break;
63
64 vec2 pxo = vec2(x, y) * pixel_size;
65 // best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
66 if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
67 nearest = d;
68 }
69
70 if (x > y) {
71 vec2 pyo = vec2(y, x) * pixel_size;
72 // best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
73 if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
74 nearest = d;
75 }
76 }
77 }
78 }
79 return nearest;
80 }
81
82 void main() {
83
84 gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);
85
86 # line 140 "outline_shader.rpy "
87
88 vec2 padded_size = u_model_size;
89 if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;
90
91 vec2 pos = v_tex_coord.xy;
92 vec2 pixel_size = (vec2(1.) / padded_size);
93
94 float max_dist = pow(u_width, 2);
95
96 // only want outlines where the image is part or fully transparent
97 if (gl_FragColor.a < 0.98) {
98 // the square distance of nearest threshold alpha pixel
99 float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
100 u_width, pixel_size, max_dist);
101 if (near > 0.1) {
102 // Now we can do the sqrt
103 float dist = sqrt(near) / u_width;
104 float color_dist = (dist - u_step_start) / (u_step_end -
u_step_start);
105 vec4 color = mix(u_color, u_far_color, color_dist);
106 float alpha = get_step_alpha(dist, u_step_start, u_step_end);
107 if (u_low_color != u_color && alpha < 0.99) {
108 color = (u_low_color_fade > 0.5) ?
109 mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
110 u_low_color;
111 }
112 alpha *= u_color.a;
113 // this pixel should be altered
114 if (gl_FragColor.a > 0.05 && alpha > 0.05) {
115 // some edge pixel that has some opacity
116 gl_FragColor = vec4(
117 mix(color.rgb,
118 gl_FragColor.rgb,
119 gl_FragColor.a / (gl_FragColor.a + alpha)),
120 1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
121 } else {
122 gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
123 }
124 }
125 }
126 }
Precompiling shader ('remix.smoothstep_outline', 'renpy.texture', 'renpy.texture'):
Traceback (most recent call last):
File "renpy/gl2\gl2shadercache.py", line 430, in load
File "renpy/gl2\gl2shadercache.py", line 352, in get
File "gl2shader.pyx", line 315, in renpy.gl2.gl2shader.Program.load
File "gl2shader.pyx", line 298, in renpy.gl2.gl2shader.Program.load_shader
renpy.gl2.gl2shader.ShaderError: ERROR: 0:17: '' : GLSL compile error:
malformed preprocessor directive
ERROR: 0:58: 'pow' : no matching overloaded function found
ERROR: 0:60: 'pow' : no matching overloaded function found
ERROR: 0:86: '' : GLSL compile error: malformed preprocessor directive
ERROR: 0:89: '*' : wrong operand types no operation '*' exists that takes a left-
hand operand of type '2-component vector of float' and a right operand of type
'const int' (or there is no acceptable conversion)
ERROR: 0:94: 'pow' : no matching overloaded function found
ERROR: 6 compilation errors. No code generated.

vertex remix.smoothstep_outline, renpy.alpha, renpy.geometry, renpy.matrixcolor,


renpy.texture
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

--------------------------------------------------------------------------------
fragment remix.smoothstep_outline, renpy.alpha, renpy.geometry, renpy.matrixcolor,
renpy.texture
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_low_color_fade;
uniform float u_mesh_pad;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform float u_step_end;
uniform float u_step_start;
uniform float u_threshold;
uniform float u_width;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform vec2 u_model_size;
uniform vec4 u_color;
uniform vec4 u_far_color;
uniform vec4 u_low_color;
varying vec2 v_tex_coord;

# line 74 "outline_shader.rpy "

// given a 0.0 to 1.0 distance, return alpha based on smoothstep values


float get_step_alpha(float d, float s, float e)
{
return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
}

bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D tex0,
float threshold) {
// x,y
if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}

// -x, y (if x is not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}
}

// x, -y (if y is not 0)
if (y > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}

// -x, -y (if both x and y not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}
}
}
return false;
}

float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,


float u_width, vec2 pixel_size, float max_dist) {
float nearest = 0.0;
for (float x = 1.0; x <= u_width; x += 1.0) {
float x_dist = pow(x, 2);
for (float y = 0.0; y <= x; y += 1.0) {
float d = pow(y, 2) + x_dist;
if (nearest > 0.1) max_dist = nearest;
if (d > max_dist) break;

vec2 pxo = vec2(x, y) * pixel_size;


// best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
nearest = d;
}

if (x > y) {
vec2 pyo = vec2(y, x) * pixel_size;
// best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
nearest = d;
}
}
}
}
return nearest;
}

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

# line 140 "outline_shader.rpy "

vec2 padded_size = u_model_size;


if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;

vec2 pos = v_tex_coord.xy;


vec2 pixel_size = (vec2(1.) / padded_size);

float max_dist = pow(u_width, 2);

// only want outlines where the image is part or fully transparent


if (gl_FragColor.a < 0.98) {
// the square distance of nearest threshold alpha pixel
float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
u_width, pixel_size, max_dist);
if (near > 0.1) {
// Now we can do the sqrt
float dist = sqrt(near) / u_width;
float color_dist = (dist - u_step_start) / (u_step_end - u_step_start);
vec4 color = mix(u_color, u_far_color, color_dist);
float alpha = get_step_alpha(dist, u_step_start, u_step_end);
if (u_low_color != u_color && alpha < 0.99) {
color = (u_low_color_fade > 0.5) ?
mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
u_low_color;
}
alpha *= u_color.a;
// this pixel should be altered
if (gl_FragColor.a > 0.05 && alpha > 0.05) {
// some edge pixel that has some opacity
gl_FragColor = vec4(
mix(color.rgb,
gl_FragColor.rgb,
gl_FragColor.a / (gl_FragColor.a + alpha)),
1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
} else {
gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
}
}
}

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
Error compiling shader ('remix.smoothstep_outline', 'renpy.alpha',
'renpy.geometry', 'renpy.matrixcolor', 'renpy.texture'):
1 #version 100
2 precision mediump float;
3 uniform float u_lod_bias;
4 uniform float u_low_color_fade;
5 uniform float u_mesh_pad;
6 uniform float u_renpy_alpha;
7 uniform float u_renpy_over;
8 uniform float u_step_end;
9 uniform float u_step_start;
10 uniform float u_threshold;
11 uniform float u_width;
12 uniform mat4 u_renpy_matrixcolor;
13 uniform sampler2D tex0;
14 uniform vec2 u_model_size;
15 uniform vec4 u_color;
16 uniform vec4 u_far_color;
17 uniform vec4 u_low_color;
18 varying vec2 v_tex_coord;
19
20 # line 74 "outline_shader.rpy "
21
22 // given a 0.0 to 1.0 distance, return alpha based on smoothstep values
23 float get_step_alpha(float d, float s, float e)
24 {
25 return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
26 }
27
28 bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D
tex0, float threshold) {
29 // x,y
30 if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
31 return true;
32 }
33
34 // -x, y (if x is not 0)
35 if (x > 0.1) {
36 if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a
>= threshold) {
37 return true;
38 }
39 }
40
41 // x, -y (if y is not 0)
42 if (y > 0.1) {
43 if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a
>= threshold) {
44 return true;
45 }
46
47 // -x, -y (if both x and y not 0)
48 if (x > 0.1) {
49 if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >=
threshold) {
50 return true;
51 }
52 }
53 }
54 return false;
55 }
56
57 float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,
58 float u_width, vec2 pixel_size, float max_dist) {
59 float nearest = 0.0;
60 for (float x = 1.0; x <= u_width; x += 1.0) {
61 float x_dist = pow(x, 2);
62 for (float y = 0.0; y <= x; y += 1.0) {
63 float d = pow(y, 2) + x_dist;
64 if (nearest > 0.1) max_dist = nearest;
65 if (d > max_dist) break;
66
67 vec2 pxo = vec2(x, y) * pixel_size;
68 // best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
69 if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
70 nearest = d;
71 }
72
73 if (x > y) {
74 vec2 pyo = vec2(y, x) * pixel_size;
75 // best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
76 if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
77 nearest = d;
78 }
79 }
80 }
81 }
82 return nearest;
83 }
84
85 void main() {
86
87 gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);
88
89 # line 140 "outline_shader.rpy "
90
91 vec2 padded_size = u_model_size;
92 if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;
93
94 vec2 pos = v_tex_coord.xy;
95 vec2 pixel_size = (vec2(1.) / padded_size);
96
97 float max_dist = pow(u_width, 2);
98
99 // only want outlines where the image is part or fully transparent
100 if (gl_FragColor.a < 0.98) {
101 // the square distance of nearest threshold alpha pixel
102 float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
103 u_width, pixel_size, max_dist);
104 if (near > 0.1) {
105 // Now we can do the sqrt
106 float dist = sqrt(near) / u_width;
107 float color_dist = (dist - u_step_start) / (u_step_end -
u_step_start);
108 vec4 color = mix(u_color, u_far_color, color_dist);
109 float alpha = get_step_alpha(dist, u_step_start, u_step_end);
110 if (u_low_color != u_color && alpha < 0.99) {
111 color = (u_low_color_fade > 0.5) ?
112 mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
113 u_low_color;
114 }
115 alpha *= u_color.a;
116 // this pixel should be altered
117 if (gl_FragColor.a > 0.05 && alpha > 0.05) {
118 // some edge pixel that has some opacity
119 gl_FragColor = vec4(
120 mix(color.rgb,
121 gl_FragColor.rgb,
122 gl_FragColor.a / (gl_FragColor.a + alpha)),
123 1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
124 } else {
125 gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
126 }
127 }
128 }
129
130 gl_FragColor = u_renpy_matrixcolor * gl_FragColor;
131
132 gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,
u_renpy_alpha, u_renpy_alpha * u_renpy_over);
133 }
Precompiling shader ('renpy.matrixcolor', 'renpy.alpha',
'remix.smoothstep_outline', 'renpy.texture', 'renpy.texture'):
Traceback (most recent call last):
File "renpy/gl2\gl2shadercache.py", line 430, in load
File "renpy/gl2\gl2shadercache.py", line 352, in get
File "gl2shader.pyx", line 315, in renpy.gl2.gl2shader.Program.load
File "gl2shader.pyx", line 298, in renpy.gl2.gl2shader.Program.load_shader
renpy.gl2.gl2shader.ShaderError: ERROR: 0:20: '' : GLSL compile error:
malformed preprocessor directive
ERROR: 0:61: 'pow' : no matching overloaded function found
ERROR: 0:63: 'pow' : no matching overloaded function found
ERROR: 0:89: '' : GLSL compile error: malformed preprocessor directive
ERROR: 0:92: '*' : wrong operand types no operation '*' exists that takes a left-
hand operand of type '2-component vector of float' and a right operand of type
'const int' (or there is no acceptable conversion)
ERROR: 0:97: 'pow' : no matching overloaded function found
ERROR: 6 compilation errors. No code generated.

vertex renpy.blur, renpy.geometry ----------------------------------------------


#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {
gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.blur, renpy.geometry --------------------------------------------
#version 100
precision mediump float;
uniform float u_renpy_blur_log2;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = vec4(0.);
float renpy_blur_norm = 0.;

for (float i = -5.; i < 1.; i += 1.) {


float renpy_blur_weight = exp(-0.5 * pow(u_renpy_blur_log2 - i, 2.));
renpy_blur_norm += renpy_blur_weight;
}

gl_FragColor += renpy_blur_norm * texture2D(tex0, v_tex_coord.xy, 0.);

for (float i = 1.; i < 14.; i += 1.) {

if (i >= u_renpy_blur_log2 + 5.) {


break;
}

float renpy_blur_weight = exp(-0.5 * pow(u_renpy_blur_log2 - i, 2.));


gl_FragColor += renpy_blur_weight * texture2D(tex0, v_tex_coord.xy, i);
renpy_blur_norm += renpy_blur_weight;
}

if (renpy_blur_norm > 0.0) {


gl_FragColor /= renpy_blur_norm;
} else {
gl_FragColor = texture2D(tex0, v_tex_coord.xy, 0.0);
}
}

--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.mask, renpy.matrixcolor ---------------------------
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;


v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.mask, renpy.matrixcolor -------------------------
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_renpy_mask_multiplier;
uniform float u_renpy_mask_offset;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
uniform sampler2D tex1;
varying vec2 v_tex_coord;

void main() {

vec4 src = texture2D(tex0, v_tex_coord.st, u_lod_bias);


vec4 mask = texture2D(tex1, v_tex_coord.st, u_lod_bias);

gl_FragColor = src * (mask.a * u_renpy_mask_multiplier +


u_renpy_mask_offset);

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;


}

--------------------------------------------------------------------------------
vertex remix.smoothstep_outline, renpy.alpha, renpy.geometry, renpy.texture ----
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

--------------------------------------------------------------------------------
fragment remix.smoothstep_outline, renpy.alpha, renpy.geometry, renpy.texture --
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_low_color_fade;
uniform float u_mesh_pad;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform float u_step_end;
uniform float u_step_start;
uniform float u_threshold;
uniform float u_width;
uniform sampler2D tex0;
uniform vec2 u_model_size;
uniform vec4 u_color;
uniform vec4 u_far_color;
uniform vec4 u_low_color;
varying vec2 v_tex_coord;

# line 74 "outline_shader.rpy "

// given a 0.0 to 1.0 distance, return alpha based on smoothstep values


float get_step_alpha(float d, float s, float e)
{
return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
}

bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D tex0,
float threshold) {
// x,y
if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}

// -x, y (if x is not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}
}

// x, -y (if y is not 0)
if (y > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}

// -x, -y (if both x and y not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}
}
}
return false;
}

float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,


float u_width, vec2 pixel_size, float max_dist) {
float nearest = 0.0;
for (float x = 1.0; x <= u_width; x += 1.0) {
float x_dist = pow(x, 2);
for (float y = 0.0; y <= x; y += 1.0) {
float d = pow(y, 2) + x_dist;
if (nearest > 0.1) max_dist = nearest;
if (d > max_dist) break;

vec2 pxo = vec2(x, y) * pixel_size;


// best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
nearest = d;
}

if (x > y) {
vec2 pyo = vec2(y, x) * pixel_size;
// best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
nearest = d;
}
}
}
}
return nearest;
}

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

# line 140 "outline_shader.rpy "

vec2 padded_size = u_model_size;


if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;

vec2 pos = v_tex_coord.xy;


vec2 pixel_size = (vec2(1.) / padded_size);

float max_dist = pow(u_width, 2);

// only want outlines where the image is part or fully transparent


if (gl_FragColor.a < 0.98) {
// the square distance of nearest threshold alpha pixel
float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
u_width, pixel_size, max_dist);
if (near > 0.1) {
// Now we can do the sqrt
float dist = sqrt(near) / u_width;
float color_dist = (dist - u_step_start) / (u_step_end - u_step_start);
vec4 color = mix(u_color, u_far_color, color_dist);
float alpha = get_step_alpha(dist, u_step_start, u_step_end);
if (u_low_color != u_color && alpha < 0.99) {
color = (u_low_color_fade > 0.5) ?
mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
u_low_color;
}
alpha *= u_color.a;
// this pixel should be altered
if (gl_FragColor.a > 0.05 && alpha > 0.05) {
// some edge pixel that has some opacity
gl_FragColor = vec4(
mix(color.rgb,
gl_FragColor.rgb,
gl_FragColor.a / (gl_FragColor.a + alpha)),
1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
} else {
gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
}
}
}
gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,
u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
Error compiling shader ('remix.smoothstep_outline', 'renpy.alpha',
'renpy.geometry', 'renpy.texture'):
1 #version 100
2 precision mediump float;
3 uniform float u_lod_bias;
4 uniform float u_low_color_fade;
5 uniform float u_mesh_pad;
6 uniform float u_renpy_alpha;
7 uniform float u_renpy_over;
8 uniform float u_step_end;
9 uniform float u_step_start;
10 uniform float u_threshold;
11 uniform float u_width;
12 uniform sampler2D tex0;
13 uniform vec2 u_model_size;
14 uniform vec4 u_color;
15 uniform vec4 u_far_color;
16 uniform vec4 u_low_color;
17 varying vec2 v_tex_coord;
18
19 # line 74 "outline_shader.rpy "
20
21 // given a 0.0 to 1.0 distance, return alpha based on smoothstep values
22 float get_step_alpha(float d, float s, float e)
23 {
24 return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
25 }
26
27 bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D
tex0, float threshold) {
28 // x,y
29 if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
30 return true;
31 }
32
33 // -x, y (if x is not 0)
34 if (x > 0.1) {
35 if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a
>= threshold) {
36 return true;
37 }
38 }
39
40 // x, -y (if y is not 0)
41 if (y > 0.1) {
42 if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a
>= threshold) {
43 return true;
44 }
45
46 // -x, -y (if both x and y not 0)
47 if (x > 0.1) {
48 if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >=
threshold) {
49 return true;
50 }
51 }
52 }
53 return false;
54 }
55
56 float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,
57 float u_width, vec2 pixel_size, float max_dist) {
58 float nearest = 0.0;
59 for (float x = 1.0; x <= u_width; x += 1.0) {
60 float x_dist = pow(x, 2);
61 for (float y = 0.0; y <= x; y += 1.0) {
62 float d = pow(y, 2) + x_dist;
63 if (nearest > 0.1) max_dist = nearest;
64 if (d > max_dist) break;
65
66 vec2 pxo = vec2(x, y) * pixel_size;
67 // best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
68 if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
69 nearest = d;
70 }
71
72 if (x > y) {
73 vec2 pyo = vec2(y, x) * pixel_size;
74 // best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
75 if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
76 nearest = d;
77 }
78 }
79 }
80 }
81 return nearest;
82 }
83
84 void main() {
85
86 gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);
87
88 # line 140 "outline_shader.rpy "
89
90 vec2 padded_size = u_model_size;
91 if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;
92
93 vec2 pos = v_tex_coord.xy;
94 vec2 pixel_size = (vec2(1.) / padded_size);
95
96 float max_dist = pow(u_width, 2);
97
98 // only want outlines where the image is part or fully transparent
99 if (gl_FragColor.a < 0.98) {
100 // the square distance of nearest threshold alpha pixel
101 float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
102 u_width, pixel_size, max_dist);
103 if (near > 0.1) {
104 // Now we can do the sqrt
105 float dist = sqrt(near) / u_width;
106 float color_dist = (dist - u_step_start) / (u_step_end -
u_step_start);
107 vec4 color = mix(u_color, u_far_color, color_dist);
108 float alpha = get_step_alpha(dist, u_step_start, u_step_end);
109 if (u_low_color != u_color && alpha < 0.99) {
110 color = (u_low_color_fade > 0.5) ?
111 mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
112 u_low_color;
113 }
114 alpha *= u_color.a;
115 // this pixel should be altered
116 if (gl_FragColor.a > 0.05 && alpha > 0.05) {
117 // some edge pixel that has some opacity
118 gl_FragColor = vec4(
119 mix(color.rgb,
120 gl_FragColor.rgb,
121 gl_FragColor.a / (gl_FragColor.a + alpha)),
122 1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
123 } else {
124 gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
125 }
126 }
127 }
128
129 gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,
u_renpy_alpha, u_renpy_alpha * u_renpy_over);
130 }
Precompiling shader ('remix.smoothstep_outline', 'renpy.alpha', 'renpy.geometry',
'renpy.texture'):
Traceback (most recent call last):
File "renpy/gl2\gl2shadercache.py", line 430, in load
File "renpy/gl2\gl2shadercache.py", line 352, in get
File "gl2shader.pyx", line 315, in renpy.gl2.gl2shader.Program.load
File "gl2shader.pyx", line 298, in renpy.gl2.gl2shader.Program.load_shader
renpy.gl2.gl2shader.ShaderError: ERROR: 0:19: '' : GLSL compile error:
malformed preprocessor directive
ERROR: 0:60: 'pow' : no matching overloaded function found
ERROR: 0:62: 'pow' : no matching overloaded function found
ERROR: 0:88: '' : GLSL compile error: malformed preprocessor directive
ERROR: 0:91: '*' : wrong operand types no operation '*' exists that takes a left-
hand operand of type '2-component vector of float' and a right operand of type
'const int' (or there is no acceptable conversion)
ERROR: 0:96: 'pow' : no matching overloaded function found
ERROR: 6 compilation errors. No code generated.

vertex renpy.alpha, renpy.blur, renpy.geometry, renpy.matrixcolor --------------


#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;

gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;
}

--------------------------------------------------------------------------------
fragment renpy.alpha, renpy.blur, renpy.geometry, renpy.matrixcolor ------------
#version 100
precision mediump float;
uniform float u_renpy_alpha;
uniform float u_renpy_blur_log2;
uniform float u_renpy_over;
uniform mat4 u_renpy_matrixcolor;
uniform sampler2D tex0;
varying vec2 v_tex_coord;

void main() {

gl_FragColor = vec4(0.);
float renpy_blur_norm = 0.;

for (float i = -5.; i < 1.; i += 1.) {


float renpy_blur_weight = exp(-0.5 * pow(u_renpy_blur_log2 - i, 2.));
renpy_blur_norm += renpy_blur_weight;
}

gl_FragColor += renpy_blur_norm * texture2D(tex0, v_tex_coord.xy, 0.);

for (float i = 1.; i < 14.; i += 1.) {

if (i >= u_renpy_blur_log2 + 5.) {


break;
}

float renpy_blur_weight = exp(-0.5 * pow(u_renpy_blur_log2 - i, 2.));


gl_FragColor += renpy_blur_weight * texture2D(tex0, v_tex_coord.xy, i);
renpy_blur_norm += renpy_blur_weight;
}

if (renpy_blur_norm > 0.0) {


gl_FragColor /= renpy_blur_norm;
} else {
gl_FragColor = texture2D(tex0, v_tex_coord.xy, 0.0);
}

gl_FragColor = u_renpy_matrixcolor * gl_FragColor;

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
vertex remix.smoothstep_outline, renpy.alpha, renpy.geometry, renpy.texture ----
#version 100
attribute vec2 a_tex_coord;
attribute vec4 a_position;
uniform mat4 u_transform;
varying vec2 v_tex_coord;

void main() {

gl_Position = a_position;
gl_Position = u_transform * gl_Position;

v_tex_coord = a_tex_coord;

--------------------------------------------------------------------------------
fragment remix.smoothstep_outline, renpy.alpha, renpy.geometry, renpy.texture --
#version 100
precision mediump float;
uniform float u_lod_bias;
uniform float u_low_color_fade;
uniform float u_mesh_pad;
uniform float u_renpy_alpha;
uniform float u_renpy_over;
uniform float u_step_end;
uniform float u_step_start;
uniform float u_threshold;
uniform float u_width;
uniform sampler2D tex0;
uniform vec2 u_model_size;
uniform vec4 u_color;
uniform vec4 u_far_color;
uniform vec4 u_low_color;
varying vec2 v_tex_coord;

# line 74 "outline_shader.rpy "

// given a 0.0 to 1.0 distance, return alpha based on smoothstep values


float get_step_alpha(float d, float s, float e)
{
return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
}

bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D tex0,
float threshold) {
// x,y
if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}

// -x, y (if x is not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}
}

// x, -y (if y is not 0)
if (y > 0.1) {
if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a >=
threshold) {
return true;
}

// -x, -y (if both x and y not 0)


if (x > 0.1) {
if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >= threshold) {
return true;
}
}
}
return false;
}

float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,


float u_width, vec2 pixel_size, float max_dist) {
float nearest = 0.0;
for (float x = 1.0; x <= u_width; x += 1.0) {
float x_dist = pow(x, 2);
for (float y = 0.0; y <= x; y += 1.0) {
float d = pow(y, 2) + x_dist;
if (nearest > 0.1) max_dist = nearest;
if (d > max_dist) break;

vec2 pxo = vec2(x, y) * pixel_size;


// best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
nearest = d;
}

if (x > y) {
vec2 pyo = vec2(y, x) * pixel_size;
// best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
nearest = d;
}
}
}
}
return nearest;
}

void main() {

gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);

# line 140 "outline_shader.rpy "

vec2 padded_size = u_model_size;


if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;

vec2 pos = v_tex_coord.xy;


vec2 pixel_size = (vec2(1.) / padded_size);

float max_dist = pow(u_width, 2);

// only want outlines where the image is part or fully transparent


if (gl_FragColor.a < 0.98) {
// the square distance of nearest threshold alpha pixel
float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
u_width, pixel_size, max_dist);
if (near > 0.1) {
// Now we can do the sqrt
float dist = sqrt(near) / u_width;
float color_dist = (dist - u_step_start) / (u_step_end - u_step_start);
vec4 color = mix(u_color, u_far_color, color_dist);
float alpha = get_step_alpha(dist, u_step_start, u_step_end);
if (u_low_color != u_color && alpha < 0.99) {
color = (u_low_color_fade > 0.5) ?
mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
u_low_color;
}
alpha *= u_color.a;
// this pixel should be altered
if (gl_FragColor.a > 0.05 && alpha > 0.05) {
// some edge pixel that has some opacity
gl_FragColor = vec4(
mix(color.rgb,
gl_FragColor.rgb,
gl_FragColor.a / (gl_FragColor.a + alpha)),
1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
} else {
gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
}
}
}

gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,


u_renpy_alpha, u_renpy_alpha * u_renpy_over);
}

--------------------------------------------------------------------------------
Error compiling shader ('remix.smoothstep_outline', 'renpy.alpha',
'renpy.geometry', 'renpy.texture'):
1 #version 100
2 precision mediump float;
3 uniform float u_lod_bias;
4 uniform float u_low_color_fade;
5 uniform float u_mesh_pad;
6 uniform float u_renpy_alpha;
7 uniform float u_renpy_over;
8 uniform float u_step_end;
9 uniform float u_step_start;
10 uniform float u_threshold;
11 uniform float u_width;
12 uniform sampler2D tex0;
13 uniform vec2 u_model_size;
14 uniform vec4 u_color;
15 uniform vec4 u_far_color;
16 uniform vec4 u_low_color;
17 varying vec2 v_tex_coord;
18
19 # line 74 "outline_shader.rpy "
20
21 // given a 0.0 to 1.0 distance, return alpha based on smoothstep values
22 float get_step_alpha(float d, float s, float e)
23 {
24 return smoothstep(s, s + 1.0 - e, d) * (1.0 - smoothstep(e, 1.0, d));
25 }
26
27 bool find_opaque(float x, float y, vec2 pos, vec2 pxo, float lod, sampler2D
tex0, float threshold) {
28 // x,y
29 if (texture2D(tex0, clamp(pos + pxo, 0.0, 1.0), lod).a >= threshold) {
30 return true;
31 }
32
33 // -x, y (if x is not 0)
34 if (x > 0.1) {
35 if (texture2D(tex0, clamp(pos + vec2(-pxo.x, pxo.y), 0.0, 1.0), lod).a
>= threshold) {
36 return true;
37 }
38 }
39
40 // x, -y (if y is not 0)
41 if (y > 0.1) {
42 if (texture2D(tex0, clamp(pos + vec2(pxo.x, -pxo.y), 0.0, 1.0), lod).a
>= threshold) {
43 return true;
44 }
45
46 // -x, -y (if both x and y not 0)
47 if (x > 0.1) {
48 if (texture2D(tex0, clamp(pos - pxo, 0.0, 1.0), lod).a >=
threshold) {
49 return true;
50 }
51 }
52 }
53 return false;
54 }
55
56 float opaque_distance(vec2 pos, float lod, sampler2D tex0, float threshold,
57 float u_width, vec2 pixel_size, float max_dist) {
58 float nearest = 0.0;
59 for (float x = 1.0; x <= u_width; x += 1.0) {
60 float x_dist = pow(x, 2);
61 for (float y = 0.0; y <= x; y += 1.0) {
62 float d = pow(y, 2) + x_dist;
63 if (nearest > 0.1) max_dist = nearest;
64 if (d > max_dist) break;
65
66 vec2 pxo = vec2(x, y) * pixel_size;
67 // best of the four pixels (-x, y), (x, y), (-x, -y), (x, -y)
68 if (find_opaque(x, y, pos, pxo, lod, tex0, threshold)) {
69 nearest = d;
70 }
71
72 if (x > y) {
73 vec2 pyo = vec2(y, x) * pixel_size;
74 // best of the four pixels (-y, x), (y, x), (-y, -x), (y, -x)
75 if (find_opaque(y, x, pos, pyo, lod, tex0, threshold)) {
76 nearest = d;
77 }
78 }
79 }
80 }
81 return nearest;
82 }
83
84 void main() {
85
86 gl_FragColor = texture2D(tex0, v_tex_coord.xy, u_lod_bias);
87
88 # line 140 "outline_shader.rpy "
89
90 vec2 padded_size = u_model_size;
91 if (u_mesh_pad > 0.5) padded_size += vec2(u_width) * 2;
92
93 vec2 pos = v_tex_coord.xy;
94 vec2 pixel_size = (vec2(1.) / padded_size);
95
96 float max_dist = pow(u_width, 2);
97
98 // only want outlines where the image is part or fully transparent
99 if (gl_FragColor.a < 0.98) {
100 // the square distance of nearest threshold alpha pixel
101 float near = opaque_distance(pos, u_lod_bias, tex0, u_threshold,
102 u_width, pixel_size, max_dist);
103 if (near > 0.1) {
104 // Now we can do the sqrt
105 float dist = sqrt(near) / u_width;
106 float color_dist = (dist - u_step_start) / (u_step_end -
u_step_start);
107 vec4 color = mix(u_color, u_far_color, color_dist);
108 float alpha = get_step_alpha(dist, u_step_start, u_step_end);
109 if (u_low_color != u_color && alpha < 0.99) {
110 color = (u_low_color_fade > 0.5) ?
111 mix(u_low_color, color, clamp(alpha * alpha, 0.0, 1.0)) :
112 u_low_color;
113 }
114 alpha *= u_color.a;
115 // this pixel should be altered
116 if (gl_FragColor.a > 0.05 && alpha > 0.05) {
117 // some edge pixel that has some opacity
118 gl_FragColor = vec4(
119 mix(color.rgb,
120 gl_FragColor.rgb,
121 gl_FragColor.a / (gl_FragColor.a + alpha)),
122 1.0) * (1.0, 1.0, 1.0, max(alpha, gl_FragColor.a));
123 } else {
124 gl_FragColor = vec4(color * (1.0, 1.0, 1.0, alpha));
125 }
126 }
127 }
128
129 gl_FragColor = gl_FragColor * vec4(u_renpy_alpha, u_renpy_alpha,
u_renpy_alpha, u_renpy_alpha * u_renpy_over);
130 }
Precompiling shader ('renpy.alpha', 'remix.smoothstep_outline', 'renpy.texture',
'renpy.texture'):
Traceback (most recent call last):
File "renpy/gl2\gl2shadercache.py", line 430, in load
File "renpy/gl2\gl2shadercache.py", line 352, in get
File "gl2shader.pyx", line 315, in renpy.gl2.gl2shader.Program.load
File "gl2shader.pyx", line 298, in renpy.gl2.gl2shader.Program.load_shader
renpy.gl2.gl2shader.ShaderError: ERROR: 0:19: '' : GLSL compile error:
malformed preprocessor directive
ERROR: 0:60: 'pow' : no matching overloaded function found
ERROR: 0:62: 'pow' : no matching overloaded function found
ERROR: 0:88: '' : GLSL compile error: malformed preprocessor directive
ERROR: 0:91: '*' : wrong operand types no operation '*' exists that takes a left-
hand operand of type '2-component vector of float' and a right operand of type
'const int' (or there is no acceptable conversion)
ERROR: 0:96: 'pow' : no matching overloaded function found
ERROR: 6 compilation errors. No code generated.

Maximum texture size: 2624x2048


controller: '05000000660600008808000001780000' 'uinput-goodix' 1
Total time until interface ready: 32.32568407058716s.
Hid presplash.
Loading mod 26.0 (test_clothing_mod).
Loading mod 0.2 (test_mod).
3 mods loaded.
Loading mod 0.1 (test_phone_mod).
Applying patch 31.3 (test_clothing_mod).
Applying patch 31.5 (test_clothing_mod).
Applying patch 32.25 (test_clothing_mod).
Applying patch 33.0 (test_clothing_mod).
Pausing audio.
Disabling periodic events.
Saving.
Freeing memory.
Releasing wakelock.
Entered background. --------------------------------------------

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy