Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ISHDRTonemapBlendCinematic
- */
- #include "ReShade.fxh"
- namespace Skyrim
- {
- texture TextureAdaptationTex : HDR_DOWNSAMPLE4;
- texture myTextureColorTex : t1;
- texture TextureBloomTex : HDR_BLOOM;
- sampler TextureAdaptation { Texture = TextureAdaptationTex; };
- sampler myTextureColor { Texture = myTextureColorTex; };
- sampler TextureBloom { Texture = TextureBloomTex; };
- texture myTextureColorTexout : o0;
- //sampler TextureOut { Texture = myTextureColorTexout; };
- uniform float4 Params01[6] < source = "Params01"; >;
- }
- #define LUM_709 float3(0.212500006,0.715399981,0.0720999986)
- #define DELTA 9.99999975e-06
- void PS_ISHDRTonemapBlendCinematic(in float4 position : SV_Position, in float2 texcoord : TEXCOORD, out float3 outcolor : SV_Target)
- {
- float4 color = tex2D(Skyrim::myTextureColor, texcoord).rgba;
- // float3 bloom = tex2D(Skyrim::TextureBloom, texcoord).rgba;
- // float2 middlegray = tex2D(Skyrim::TextureAdaptation, texcoord).xy;
- // bool useFilmic = (0.5 < Skyrim::Params01[2].z);
- // float WhiteFactor = Skyrim::Params01[2].y;
- // float original_lum = max(dot(LUM_709, color.rgb), DELTA);
- // float lum_scaled = original_lum ;
- // float lum_filmic = max(lum_scaled - 0.004, 0.0);
- // lum_filmic = lum_filmic * (lum_filmic * 6.2 + 0.5) / (lum_filmic * (lum_filmic * 6.2 + 1.7) + 0.06);
- // lum_filmic = pow(lum_filmic, 2.2); // de-gamma-correction for gamma-corrected tonemapper
- // lum_filmic = lum_filmic * WhiteFactor; // linear scale
- // float lum_reinhard = lum_scaled * (lum_scaled * WhiteFactor + 1.0) / (lum_scaled + 1.0);
- // float lum_mapped = useFilmic ? lum_filmic : lum_reinhard;
- // color.rgb = color.rgb * lum_mapped / original_lum;
- // //float bloomfactor = Skyrim::Params01[2].x;
- // //color.rgb = color.rgb + bloom.rgb * saturate(bloomfactor - lum_mapped);
- // float saturation = Skyrim::Params01[3].x; // 0 == gray scale
- // float contrast = Skyrim::Params01[3].z; // 0 == no contrast
- // float brightness = Skyrim::Params01[3].w; // intensity
- // float3 tint_color = Skyrim::Params01[4].rgb; // tint color
- // float tint_weight = Skyrim::Params01[4].w; // 0 == no tint
- // color.a = dot(color.rgb, LUM_709);
- // color.rgb = lerp(color.a, color.rgb, saturation);
- // color.rgb = lerp(color.rgb, tint_color * color.a, tint_weight);
- // //color.rgb = lerp(middlegray.x, color.rgb * brightness, contrast);
- // color.rgb = saturate(color.rgb);
- // float3 fade = Skyrim::Params01[4].xyz; // fade current scene to specified color, mostly used in special effects
- // float fade_weight = Skyrim::Params01[4].w; // 0 == no fade
- // color.rgb = lerp(color.rgb, fade, fade_weight);
- // color = saturate(color);
- // color = log2(color);
- // color = color * 1.5;
- // color = exp2(color);
- // color = pow(color, 1 /2.2);
- outcolor = color.rgb;
- }
- technique ISHDRTonemapBlendCinematic <
- ui_tooltip = "ISHDRTonemapBlendCinematic";
- >
- {
- pass
- {
- VertexShader = PostProcessVS;
- PixelShader = PS_ISHDRTonemapBlendCinematic;
- RenderTarget0 = Skyrim::myTextureColorTexout;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment