1 Shader "Hidden/PostProcessing/Debug/Waveform"
5 #pragma exclude_renderers gles gles3 d3d11_9x
7 #include "../StdLib.hlsl"
9 StructuredBuffer<uint4> _WaveformBuffer;
10 float3 _Params; // x: buffer width, y: buffer height, z: exposure, w: unused
12 float3 Tonemap(float3 x, float exposure)
19 x = max((0.0).xxx, x - (0.004).xxx);
20 x = (x * (a * x + b)) / (x * (a * x + c) + d);
24 float4 Frag(VaryingsDefault i) : SV_Target
26 const float3 red = float3(1.4, 0.03, 0.02);
27 const float3 green = float3(0.02, 1.1, 0.05);
28 const float3 blue = float3(0.0, 0.25, 1.5);
29 float3 color = float3(0.0, 0.0, 0.0);
31 uint2 uvI = i.vertex.xy;
32 float3 w = _WaveformBuffer[uvI.x * _Params.y + uvI.y].xyz;
37 color = Tonemap(color, _Params.z);
39 return float4(saturate(color), 1.0);
46 Cull Off ZWrite Off ZTest Always
52 #pragma vertex VertDefault