#  GLSL.std.450mainj{ rend3-pbr/shaders/src/blit.fragrend3-pbr/shaders/src/lighting/tonemapping.glsl rend3-pbr/shaders/src/math.glsl// OpModuleProcessed entry-point main // OpModuleProcessed client vulkan100 // OpModuleProcessed target-env vulkan1.0 // OpModuleProcessed entry-point main #line 1 #version 440 #include "lighting/tonemapping.glsl" #include "math.glsl" layout(location = 0) in vec2 tex_coords; layout(location = 0) out vec4 color; layout(set = 0, binding = 0) uniform sampler primary_sampler; layout(set = 1, binding = 0) uniform texture2D source; void main() { vec4 input_color = texture(sampler2D(source, primary_sampler), tex_coords); vec4 tonemapped = vec4(uncharted2_filmic(input_color.rgb), input_color.a); #ifdef SRGB_CONVERT color = linear_to_srgb(tonemapped); #else // SRGB_CONVERT color = tonemapped; #endif }#ifndef SHADER_LIGHTING_TONEMAPPING_GLSL #define SHADER_LIGHTING_TONEMAPPING_GLSL vec3 uncharted2_tonemap_partial(vec3 x) { float A = 0.15f; float B = 0.50f; float C = 0.10f; float D = 0.20f; float E = 0.02f; float F = 0.30f; return ((x*(A *x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F; } vec3 uncharted2_filmic(vec3 v) { float exposure_bias = 2.0f; vec3 curr = uncharted2_tonemap_partial(v * exposure_bias); vec3 W = vec3(11.2f); vec3 white_scale = vec3(1.0f) / uncharted2_tonemap_partial(W); return curr * white_scale; } #endif #ifndef SHADER_MATH_GLSL #define SHADER_MATH_GLSL #define PI 3.14159265359 #define HALF_PI 1.570796327 float saturate(float x) { return clamp(x, 0.0, 1.0); } vec4 srgb_to_linear(vec4 srgb) { vec3 color_srgb = srgb.rgb; vec3 selector = ceil(color_srgb - 0.04045); // 0 if under value, 1 if over vec3 under = color_srgb / 12.92; vec3 over = pow((color_srgb + 0.055) / 1.055, vec3(2.4)); vec3 result = mix(under, over, selector); return vec4(result, srgb.a); } vec4 linear_to_srgb(vec4 linear) { vec3 color_linear = linear.rgb; vec3 selector = ceil(color_linear - 0.0031308); // 0 if under value, 1 if over vec3 under = 12.92 * color_linear; vec3 over = 1.055 * pow(color_linear, vec3(0.41666)) - 0.055; vec3 result = mix(under, over, selector); return vec4(result, linear.a); } #endif GL_GOOGLE_cpp_style_line_directiveGL_GOOGLE_include_directivemain`sourcedprimary_samplerjtex_coords{colorG`"G`!Gd"Gd!GjG{!  + >+ ?+ E@[  ^  _^;_`b cb;cdf^h  ih;ij z[;z{+ L=, + o;, , + u=, + =, + .?, 6=^a`=bedVfgae=hkjW[lgkO pll pE           Q ulQ vQ wQ xP[yvwxu>{y8