Guest User

Untitled

a guest
Dec 10th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. /*
  2. ISHDRTonemapBlendCinematic
  3. */
  4.  
  5. #include "ReShade.fxh"
  6.  
  7. namespace Skyrim
  8. {
  9. texture TextureAdaptationTex : HDR_DOWNSAMPLE4;
  10. texture myTextureColorTex : t1;
  11. texture TextureBloomTex : HDR_BLOOM;
  12.  
  13. sampler TextureAdaptation { Texture = TextureAdaptationTex; };
  14. sampler myTextureColor { Texture = myTextureColorTex; };
  15. sampler TextureBloom { Texture = TextureBloomTex; };
  16.  
  17. texture myTextureColorTexout : o0;
  18. //sampler TextureOut { Texture = myTextureColorTexout; };
  19.  
  20. uniform float4 Params01[6] < source = "Params01"; >;
  21.  
  22. }
  23.  
  24. #define LUM_709 float3(0.212500006,0.715399981,0.0720999986)
  25. #define DELTA 9.99999975e-06
  26.  
  27. void PS_ISHDRTonemapBlendCinematic(in float4 position : SV_Position, in float2 texcoord : TEXCOORD, out float3 outcolor : SV_Target)
  28. {
  29. float4 color = tex2D(Skyrim::myTextureColor, texcoord).rgba;
  30. // float3 bloom = tex2D(Skyrim::TextureBloom, texcoord).rgba;
  31. // float2 middlegray = tex2D(Skyrim::TextureAdaptation, texcoord).xy;
  32.  
  33. // bool useFilmic = (0.5 < Skyrim::Params01[2].z);
  34. // float WhiteFactor = Skyrim::Params01[2].y;
  35.  
  36. // float original_lum = max(dot(LUM_709, color.rgb), DELTA);
  37. // float lum_scaled = original_lum ;
  38. // float lum_filmic = max(lum_scaled - 0.004, 0.0);
  39. // lum_filmic = lum_filmic * (lum_filmic * 6.2 + 0.5) / (lum_filmic * (lum_filmic * 6.2 + 1.7) + 0.06);
  40. // lum_filmic = pow(lum_filmic, 2.2); // de-gamma-correction for gamma-corrected tonemapper
  41. // lum_filmic = lum_filmic * WhiteFactor; // linear scale
  42. // float lum_reinhard = lum_scaled * (lum_scaled * WhiteFactor + 1.0) / (lum_scaled + 1.0);
  43. // float lum_mapped = useFilmic ? lum_filmic : lum_reinhard;
  44. // color.rgb = color.rgb * lum_mapped / original_lum;
  45.  
  46. // //float bloomfactor = Skyrim::Params01[2].x;
  47. // //color.rgb = color.rgb + bloom.rgb * saturate(bloomfactor - lum_mapped);
  48.  
  49. // float saturation = Skyrim::Params01[3].x; // 0 == gray scale
  50. // float contrast = Skyrim::Params01[3].z; // 0 == no contrast
  51. // float brightness = Skyrim::Params01[3].w; // intensity
  52. // float3 tint_color = Skyrim::Params01[4].rgb; // tint color
  53. // float tint_weight = Skyrim::Params01[4].w; // 0 == no tint
  54. // color.a = dot(color.rgb, LUM_709);
  55. // color.rgb = lerp(color.a, color.rgb, saturation);
  56. // color.rgb = lerp(color.rgb, tint_color * color.a, tint_weight);
  57. // //color.rgb = lerp(middlegray.x, color.rgb * brightness, contrast);
  58. // color.rgb = saturate(color.rgb);
  59. // float3 fade = Skyrim::Params01[4].xyz; // fade current scene to specified color, mostly used in special effects
  60. // float fade_weight = Skyrim::Params01[4].w; // 0 == no fade
  61. // color.rgb = lerp(color.rgb, fade, fade_weight);
  62. // color = saturate(color);
  63. // color = log2(color);
  64. // color = color * 1.5;
  65. // color = exp2(color);
  66. // color = pow(color, 1 /2.2);
  67. outcolor = color.rgb;
  68.  
  69. }
  70.  
  71. technique ISHDRTonemapBlendCinematic <
  72. ui_tooltip = "ISHDRTonemapBlendCinematic";
  73. >
  74.  
  75. {
  76. pass
  77. {
  78. VertexShader = PostProcessVS;
  79. PixelShader = PS_ISHDRTonemapBlendCinematic;
  80. RenderTarget0 = Skyrim::myTextureColorTexout;
  81. }
  82. }
  83.  
Advertisement
Add Comment
Please, Sign In to add comment