This repository was archived by the owner on Nov 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
PostProcessing/Shaders/Debug Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ Shader "Hidden/PostProcessing/Debug/Histogram"
22{
33 HLSLINCLUDE
44
5- #pragma exclude_renderers gles gles3
65 #pragma target 4.5
76 #include "../StdLib.hlsl"
87
@@ -46,19 +45,29 @@ Shader "Hidden/PostProcessing/Debug/Histogram"
4645 o.texcoord = o.texcoord * float2 (1.0 , -1.0 ) + float2 (0.0 , 1.0 );
4746 #endif
4847
48+ #if SHADER_API_GLES3 // No texture loopup in VS on GLES3/Android
49+ o.maxValue = 0 ;
50+ #else
4951 o.maxValue = _Params.y / FindMaxHistogramValue ();
52+ #endif
5053
5154 return o;
5255 }
5356
5457 float4 Frag (VaryingsHistogram i) : SV_Target
5558 {
59+ #if SHADER_API_GLES3
60+ float maxValue = _Params.y / FindMaxHistogramValue ();
61+ #else
62+ float maxValue = i.maxValue;
63+ #endif
64+
5665 const float kBinsMinusOne = HISTOGRAM_BINS - 1.0 ;
5766 float remapI = i.texcoord.x * kBinsMinusOne;
5867 uint index = floor (remapI);
5968 float delta = frac (remapI);
60- float v1 = float (_HistogramBuffer[index]) * i. maxValue;
61- float v2 = float (_HistogramBuffer[min (index + 1 , kBinsMinusOne)]) * i. maxValue;
69+ float v1 = float (_HistogramBuffer[index]) * maxValue;
70+ float v2 = float (_HistogramBuffer[min (index + 1 , kBinsMinusOne)]) * maxValue;
6271 float h = v1 * (1.0 - delta) + v2 * delta;
6372 uint y = (uint )round (i.texcoord.y * _Params.y);
6473
You can’t perform that action at this time.
0 commit comments