-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Transparent pixels are being rendered to the depth buffer, which causes them to incorrectly obscure pixels behind them.
After uncommenting and tweaking the debug code to render the depth buffer, this was my result:
This is a Minecraft skin where the outer layer is mostly transparent, but here it appears fully opaque.
This was the code I used to render the depth buffer:
// debug; draw zbuffer
for (var i = 0, l = zbuffer.length; i < l; i++) {
// This is a bit of a fine-tuning exercise.
// These numbers seem to work for my scene but may not work in all cases.
// My objects are between z=0 and z=10.
const o = i * 4;
var v = (1 - (zbuffer[i] / 100000 - 166)) * 255;
data[o + 0] = v;
data[o + 1] = v;
data[o + 2] = v;
data[o + 3] = 255;
}
If I find a fix I will post it here.
Metadata
Metadata
Assignees
Labels
No labels
