Nevcairiel

Untitled

Nov 24th, 2021
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.95 KB | None | 0 0
  1. PL(5): fragment shader GLSL source:
  2. PL(5): [ 1] #version 450
  3. PL(5): [ 2] #extension GL_ARB_uniform_buffer_object : enable
  4. PL(5): [ 3] #extension GL_ARB_texture_gather : enable
  5. PL(5): [ 4] layout(binding=0) uniform sampler2D _osd_tex_0_0;
  6. PL(5): [ 5] layout(std140, binding=1) uniform _UBO_13_0 {
  7. PL(5): [ 6] layout(offset=0) mat3 _cms_matrix_11_0;
  8. PL(5): [ 7] };
  9. PL(5): [ 8] layout(location=1) in vec2 coord;
  10. PL(5): [ 9] layout(location=0) out vec4 out_color;
  11. PL(5): [ 10]
  12. PL(5): [ 11] const float _const_1_0 = 0.05958483740687370300;
  13. PL(5): [ 12] const float _const_2_0 = 0.87031054496765136718;
  14. PL(5): [ 13] const float _const_3_0 = 0.25000000000000000000;
  15. PL(5): [ 14] const float _const_4_0 = 1.00000000000000000000;
  16. PL(5): [ 15] const float _dst_range_5_0 = 4.92608356475830078125;
  17. PL(5): [ 16] const float _src_floor_6_0 = 0.00100000004749745130;
  18. PL(5): [ 17] const float _dst_peak_7_0 = 4.92610836029052734375;
  19. PL(5): [ 18] const float _dst_floor_8_0 = 0.00002463054079271387;
  20. PL(5): [ 19] const float _const_9_0 = 0.08332741260528564453;
  21. PL(5): [ 20] const float _const_10_0 = -0.06825106590986251831;
  22. PL(5): [ 21] vec4 _main_14_0() {
  23. PL(5): [ 22] // overlay
  24. PL(5): [ 23] vec4 color = texture(_osd_tex_0_0, coord);
  25. PL(5): [ 24] // pl_shader_decode_color
  26. PL(5): [ 25] {
  27. PL(5): [ 26] color.rgb *= vec3(color.a);
  28. PL(5): [ 27] }
  29. PL(5): [ 28] // pl_shader_color_map
  30. PL(5): [ 29] {
  31. PL(5): [ 30] // pl_shader_linearize
  32. PL(5): [ 31] color.rgb = max(color.rgb, 0.0);
  33. PL(5): [ 32] color.rgb = vec3(_const_2_0) * pow(color.rgb + vec3(_const_1_0), vec3(2.4));
  34. PL(5): [ 33] // pl_shader_tone_map
  35. PL(5): [ 34] {
  36. PL(5): [ 35] float sig_peak = _const_4_0;
  37. PL(5): [ 36] float sig_avg = _const_3_0;
  38. PL(5): [ 37] vec3 sig = clamp(color.rgb, 0.0, sig_peak);
  39. PL(5): [ 38] vec3 sig_orig = color.rgb;
  40. PL(5): [ 39] vec4 sig_pq = vec4(sig.rgb, sig_peak);
  41. PL(5): [ 40] sig_pq *= vec4(1.0/49.26108374384236298501);
  42. PL(5): [ 41] sig_pq = pow(max(sig_pq, 0.0), vec4(0.15930175781250000000));
  43. PL(5): [ 42] sig_pq = (vec4(0.83593750000000000000) + vec4(18.85156250000000000000) * sig_pq)
  44. PL(5): [ 43] / (vec4(1.0) + vec4(18.68750000000000000000) * sig_pq);
  45. PL(5): [ 44] sig_pq = pow(sig_pq, vec4(78.84375000000000000000));
  46. PL(5): [ 45] float scale = 1.0 / (sig_pq.a - _const_9_0);
  47. PL(5): [ 46] sig = clamp(vec3(scale) * (sig_pq.rgb - vec3(_const_9_0)), 0.0, 1.0);
  48. PL(5): [ 47] float minLum = _const_10_0 * scale;
  49. PL(5): [ 48] float p = 4.0;
  50. PL(5): [ 49] if (minLum >= 0.0)
  51. PL(5): [ 50] p = min(1.0 / minLum, 4.0);
  52. PL(5): [ 51] vec3 boost = vec3(minLum) * pow(vec3(1.0) - sig, vec3(p));
  53. PL(5): [ 52] vec3 sig_lift = sig + boost;
  54. PL(5): [ 53] sig = mix(sig, sig_lift, bvec3(lessThan(sig, vec3(1.0))));
  55. PL(5): [ 54] sig = vec3(sig_pq.a - _const_9_0) * sig + vec3(_const_9_0);
  56. PL(5): [ 55] sig = pow(max(sig, 0.0), vec3(1.0/78.84375000000000000000));
  57. PL(5): [ 56] sig = max(sig - vec3(0.83593750000000000000), 0.0) /
  58. PL(5): [ 57] (vec3(18.85156250000000000000) - vec3(18.68750000000000000000) * sig);
  59. PL(5): [ 58] sig = pow(sig, vec3(1.0/0.15930175781250000000));
  60. PL(5): [ 59] sig *= vec3(49.26108374384236298501);
  61. PL(5): [ 60] color.rgb = sig;
  62. PL(5): [ 61] }
  63. PL(5): [ 62] color.rgb = _cms_matrix_11_0 * color.rgb;
  64. PL(5): [ 63] // pl_shader_delinearize
  65. PL(5): [ 64] color.rgb = max(color.rgb, 0.0);
  66. PL(5): [ 65] color.rgb *= vec3(1.0/49.26108374384236298501);
  67. PL(5): [ 66] color.rgb = pow(color.rgb, vec3(0.15930175781250000000));
  68. PL(5): [ 67] color.rgb = (vec3(0.83593750000000000000) + vec3(18.85156250000000000000) * color.rgb)
  69. PL(5): [ 68] / (vec3(1.0) + vec3(18.68750000000000000000) * color.rgb);
  70. PL(5): [ 69] color.rgb = pow(color.rgb, vec3(78.84375000000000000000));
  71. PL(5): [ 70] }
  72. PL(5): [ 71] // pl_shader_encode_color
  73. PL(5): [ 72] {
  74. PL(5): [ 73] }
  75. PL(5): [ 74] vec4 _orig_color_12_0 = color;
  76. PL(5): [ 75] color = vec4(0.0, 0.0, 0.0, 1.0);
  77. PL(5): [ 76] color[0] = _orig_color_12_0[0];
  78. PL(5): [ 77] color[1] = _orig_color_12_0[1];
  79. PL(5): [ 78] color[2] = _orig_color_12_0[2];
  80. PL(5): [ 79] color.a = _orig_color_12_0.a;
  81. PL(5): [ 80] return color;
  82. PL(5): [ 81] }
  83. PL(5): [ 82]
  84. PL(5): [ 83] void main() {
  85. PL(5): [ 84] out_color = _main_14_0();
  86. PL(5): [ 85] }
Advertisement
Add Comment
Please, Sign In to add comment