Make OpenGL lightmap overexposure simpler

This commit is contained in:
MysterD 2023-06-10 15:33:59 -07:00
parent 6207f3ea01
commit 91b6514d8a

View file

@ -378,14 +378,12 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(struct ColorC
if (ccf.used_textures[1]) {
if (cc->cm.light_map) {
append_line(fs_buf, &fs_len, "vec4 texVal1 = sampleTex(uTex1, vLightMap, uTex1Size, uTex1Filter);");
append_line(fs_buf, &fs_len, "texVal1.rgb = texVal1.rgb * texVal1.rgb + texVal1.rgb;");
} else {
append_line(fs_buf, &fs_len, "vec4 texVal1 = sampleTex(uTex1, vTexCoord, uTex1Size, uTex1Filter);");
}
}
if (opt_light_map) {
append_str(fs_buf, &fs_len, "vec3 texel = texVal0.rgb * (texVal1.rgb * texVal1.rgb + texVal1.rgb);\n");
} else {
append_str(fs_buf, &fs_len, (opt_alpha) ? "vec4 texel = " : "vec3 texel = ");
for (int i = 0; i < (opt_2cycle + 1); i++) {
u8* cmd = &cc->shader_commands[i * 8];
@ -404,7 +402,6 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(struct ColorC
append_str(fs_buf, &fs_len, "texel = ");
}
}
}
if (opt_texture_edge && opt_alpha) {
append_line(fs_buf, &fs_len, "if (texel.a > 0.3) texel.a = 1.0; else discard;");