happy-turtle / oit-unity

Order-independent Transparency Implementation in Unity with Per-Pixel Linked Lists
Apache License 2.0
181 stars 25 forks source link

Incorrect stride? #3

Closed bpepers-me closed 2 years ago

bpepers-me commented 2 years ago

In OrderIndependentTransparency.cs you define the buffer stride as:

int bufferStride = sizeof(float) * 5 + sizeof(uint);

But the actual struct has 5 float and 2 uints so it should be:

int bufferStride = sizeof(float) * 5 + sizeof(uint) * 2;

Perhaps this wasn't updated when coverage was added to the struct?

happy-turtle commented 2 years ago

Yes, I think you are absolutely right, thanks! That means the buffer is smaller than expected. Maybe fixing this will reduce the overall occurence of rendering errors.

happy-turtle commented 2 years ago

Should be fixed with 2f7e5d4.