Log
Log
Alternative_Saves_Android_Port
Ren'Py 8.3.7.25031702
void main() {
gl_Position = a_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() {
--------------------------------------------------------------------------------
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;
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
v_tex_coord = a_tex_coord;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.matrixcolor ---------------------------------------
#version 100
attribute vec4 a_position;
uniform mat4 u_transform;
void main() {
gl_Position = a_position;
--------------------------------------------------------------------------------
fragment renpy.geometry, renpy.matrixcolor -------------------------------------
#version 100
precision mediump float;
uniform mat4 u_renpy_matrixcolor;
void main() {
--------------------------------------------------------------------------------
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
v_tex_coord = a_tex_coord;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
v_tex_coord = a_tex_coord;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
v_tex_coord = a_tex_coord;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
vertex renpy.geometry, renpy.solid ---------------------------------------------
#version 100
attribute vec4 a_position;
uniform mat4 u_transform;
void main() {
gl_Position = a_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;
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
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;
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 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;
}
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() {
--------------------------------------------------------------------------------
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.
void main() {
gl_Position = a_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() {
--------------------------------------------------------------------------------
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;
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
v_tex_coord = a_tex_coord;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
v_tex_coord = a_tex_coord;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
vertex renpy.geometry ----------------------------------------------------------
#version 100
attribute vec4 a_position;
uniform mat4 u_transform;
void main() {
gl_Position = a_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;
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() {
--------------------------------------------------------------------------------
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;
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
v_tex_coord = a_tex_coord;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
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;
}
--------------------------------------------------------------------------------
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;
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() {
--------------------------------------------------------------------------------
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;
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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;
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 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;
}
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() {
--------------------------------------------------------------------------------
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.
void main() {
gl_Position = a_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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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.;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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;
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 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;
}
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() {
--------------------------------------------------------------------------------
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.
void main() {
gl_Position = a_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;
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 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;
}
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() {
--------------------------------------------------------------------------------
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.
void main() {
gl_Position = a_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.;
--------------------------------------------------------------------------------
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;
--------------------------------------------------------------------------------
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() {
--------------------------------------------------------------------------------
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;
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;
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 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;
}
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() {
--------------------------------------------------------------------------------
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.
void main() {
gl_Position = a_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.;
--------------------------------------------------------------------------------
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;
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 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;
}
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() {
--------------------------------------------------------------------------------
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.