Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit c6ac675

Browse files
committed
Expose TAA's sample index
1 parent dee1d8c commit c6ac675

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

PostProcessing/Runtime/Effects/TemporalAntialiasing.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum Pass
3636
bool m_ResetHistory = true;
3737

3838
const int k_SampleCount = 8;
39-
int m_SampleIndex;
39+
public int sampleIndex { get; private set; }
4040

4141
// Ping-pong between two history textures as we can't read & write the same target in the
4242
// same pass
@@ -71,12 +71,12 @@ Vector2 GenerateRandomOffset()
7171
// The variance between 0 and the actual halton sequence values reveals noticeable instability
7272
// in Unity's shadow maps, so we avoid index 0.
7373
var offset = new Vector2(
74-
HaltonSeq.Get((m_SampleIndex & 1023) + 1, 2) - 0.5f,
75-
HaltonSeq.Get((m_SampleIndex & 1023) + 1, 3) - 0.5f
74+
HaltonSeq.Get((sampleIndex & 1023) + 1, 2) - 0.5f,
75+
HaltonSeq.Get((sampleIndex & 1023) + 1, 3) - 0.5f
7676
);
7777

78-
if (++m_SampleIndex >= k_SampleCount)
79-
m_SampleIndex = 0;
78+
if (++sampleIndex >= k_SampleCount)
79+
sampleIndex = 0;
8080

8181
return offset;
8282
}
@@ -232,7 +232,7 @@ internal void Release()
232232
}
233233
}
234234

235-
m_SampleIndex = 0;
235+
sampleIndex = 0;
236236
m_HistoryPingPong[0] = 0;
237237
m_HistoryPingPong[1] = 0;
238238

0 commit comments

Comments
 (0)