mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-12 22:56:06 +09:00
IngameRenderer: damned thing finally works somewhat
This commit is contained in:
@@ -8,10 +8,13 @@ varying vec2 v_texCoords;
|
||||
uniform sampler2D u_texture; // world texture, has alpha value that is meaningful
|
||||
|
||||
uniform sampler2D tex1; // lightmap texture
|
||||
uniform vec2 tex1Offset;
|
||||
|
||||
void main() {
|
||||
vec4 colorTex0 = texture2D(u_texture, v_texCoords); // world texture
|
||||
vec4 colorTex1 = texture2D(tex1, v_texCoords); // lightmap (RGBA)
|
||||
|
||||
gl_FragColor = colorTex0 * vec4(colorTex1.aaa, 1.0);
|
||||
colorTex1 = vec4(colorTex1.www, 1.0);
|
||||
|
||||
gl_FragColor = colorTex0 * colorTex1;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ varying vec2 v_texCoords;
|
||||
uniform sampler2D u_texture;
|
||||
|
||||
void main(void) {
|
||||
float alpha = texture2D(u_texture, v_texCoords).a;
|
||||
gl_FragColor = vec4(alpha, alpha, alpha, 1.0);
|
||||
vec3 alpha = texture2D(u_texture, v_texCoords).aaa;
|
||||
gl_FragColor = vec4(alpha, 1.0);
|
||||
}
|
||||
@@ -40,6 +40,6 @@ void main(void) {
|
||||
out_color = out_color * scanline_darkening;
|
||||
}
|
||||
|
||||
gl_FragColor = vec4(out_color, 0.5);
|
||||
gl_FragColor = vec4(out_color, 1);
|
||||
|
||||
}
|
||||
@@ -8,10 +8,14 @@ varying vec2 v_texCoords;
|
||||
uniform sampler2D u_texture; // world texture, has alpha value that is meaningful
|
||||
|
||||
uniform sampler2D tex1; // lightmap texture
|
||||
uniform vec2 tex1Offset;
|
||||
uniform vec2 tex1Resolution;
|
||||
|
||||
void main() {
|
||||
vec4 colorTex0 = texture2D(u_texture, v_texCoords); // world texture
|
||||
vec4 colorTex0 = texture2D(u_texture, v_texCoords + vec2(0.5, 0.5)); // world texture
|
||||
vec4 colorTex1 = texture2D(tex1, v_texCoords); // lightmap (RGBA)
|
||||
|
||||
gl_FragColor = colorTex0 * vec4(colorTex1.rgb, 1.0);
|
||||
colorTex1 = vec4(colorTex1.xyz, 1.0);
|
||||
|
||||
gl_FragColor = colorTex0 * colorTex1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user