From eb3840a3f88dd9902ff1c5ea50d90a7f33e08d82 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Mon, 25 Jan 2016 13:33:22 +0100 Subject: Filmic HDR tone mapping --- src/defaultsettings.cpp | 1 + src/shader.cpp | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 957857976..271214a4f 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -160,6 +160,7 @@ void set_default_settings(Settings *settings) settings->setDefault("texture_clean_transparent", "false"); settings->setDefault("texture_min_size", "64"); settings->setDefault("preload_item_visuals", "false"); + settings->setDefault("tone_mapping", "false"); settings->setDefault("enable_bumpmapping", "false"); settings->setDefault("enable_parallax_occlusion", "false"); settings->setDefault("generate_normalmaps", "false"); diff --git a/src/shader.cpp b/src/shader.cpp index 917d878bb..a2473ffbf 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -764,6 +764,9 @@ ShaderInfo generate_shader(std::string name, u8 material_type, u8 drawtype, else shaders_header += "0\n"; + if (g_settings->getBool("tone_mapping")) + shaders_header += "#define ENABLE_TONE_MAPPING\n"; + if(pixel_program != "") pixel_program = shaders_header + pixel_program; if(vertex_program != "") -- cgit v1.2.3