trying to optimise the rendering, this is BEFORE job

This commit is contained in:
minjaesong
2018-06-26 09:10:05 +09:00
parent 8daf0a2c38
commit 9736d39e04
6 changed files with 60 additions and 3 deletions

17
assets/aaaxmul.frag Normal file
View File

@@ -0,0 +1,17 @@
#version 120
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 v_color;
varying vec2 v_texCoords;
uniform sampler2D u_texture; // world texture, has alpha value that is meaningful
uniform sampler2D tex1; // lightmap texture
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);
}

17
assets/rgbxmul.frag Normal file
View File

@@ -0,0 +1,17 @@
#version 120
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 v_color;
varying vec2 v_texCoords;
uniform sampler2D u_texture; // world texture, has alpha value that is meaningful
uniform sampler2D tex1; // lightmap texture
void main() {
vec4 colorTex0 = texture2D(u_texture, v_texCoords); // world texture
vec4 colorTex1 = texture2D(tex1, v_texCoords); // lightmap (RGBA)
gl_FragColor = colorTex0 * vec4(colorTex1.rgb, 1.0);
}