16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 00:49:19 +02:00

rename, configurable gamma mode

This commit is contained in:
milek7
2018-10-17 19:16:32 +02:00
parent 2ffdb35d0f
commit b9fbe7452b
14 changed files with 59 additions and 43 deletions

View File

@@ -10,7 +10,7 @@ void gl::glsl_common_setup()
"#define ENVMAP_ENABLED " + std::to_string((int)Global.gfx_envmap_enabled) + "\n" +
"#define MOTIONBLUR_ENABLED " + std::to_string((int)Global.gfx_postfx_motionblur_enabled) + "\n" +
"#define POSTFX_ENABLED " + std::to_string((int)!Global.gfx_skippipeline) + "\n" +
"#define USE_GLES " + std::to_string((int)Global.use_gles) + "\n" +
"#define USE_GLES " + std::to_string((int)Global.gfx_usegles) + "\n" +
"const uint MAX_LIGHTS = " + std::to_string(MAX_LIGHTS) + "U;\n" +
"const uint MAX_PARAMS = " + std::to_string(MAX_PARAMS) + "U;\n" +
R"STRING(

View File

@@ -203,7 +203,7 @@ gl::shader::shader(const std::string &filename)
{
name = filename;
std::string str;
if (!Global.use_gles)
if (!Global.gfx_usegles)
{
str += "#version 330 core\n";
}
@@ -213,6 +213,8 @@ gl::shader::shader(const std::string &filename)
str += "precision highp float;\n";
str += "precision highp sampler2DShadow;\n";
}
str += "vec4 FBOUT(vec4 x) { return " + (Global.gfx_shadergamma ? std::string("vec4(pow(x.rgb, vec3(1.0 / 2.2)), x.a)") : std::string("x")) + "; }\n";
str += read_file(filename);
process_source(str);
@@ -239,7 +241,6 @@ gl::shader::shader(const std::string &filename)
{
GLchar info[512];
glGetShaderInfoLog(*this, 512, 0, info);
ErrorLog(std::string(info));
std::cerr << std::string(info) << std::endl;
throw shader_exception("failed to compile " + filename + ": " + std::string(info));
}