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

Commit

Permalink
Fixed rounding error in the waveform
Browse files Browse the repository at this point in the history
  • Loading branch information
Chman committed Jul 11, 2017
1 parent 8c0b594 commit adda4b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PostProcessing/Shaders/Debug/Waveform.compute
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void KWaveformGather(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupTh
// Convert channel values to histogram bins
uint3 idx = (uint3)(round(color * (_BufferParams.y - 1)));

uint bufferX = uint(floor(coords.x * _BufferParams.x));
uint bufferX = uint(round(coords.x * (_BufferParams.x - 1)));
if (idx.x > 0u) InterlockedAdd(_WaveformBuffer[idx.x * uint(_BufferParams.x) + bufferX].x, 1u); // Red
if (idx.y > 0u) InterlockedAdd(_WaveformBuffer[idx.y * uint(_BufferParams.x) + bufferX].y, 1u); // Green
if (idx.z > 0u) InterlockedAdd(_WaveformBuffer[idx.z * uint(_BufferParams.x) + bufferX].z, 1u); // Blue
Expand Down

0 comments on commit adda4b3

Please sign in to comment.