Fixed custom depth rendering

This commit is contained in:
Andrew Francis Thomas 2022-01-13 19:35:37 -07:00 committed by Nicolas F
parent acf6479f4c
commit 7a55d33e8f
3 changed files with 5 additions and 5 deletions

View File

@ -1101,10 +1101,10 @@ Depth
**Options**
min
lowest level of blocks to render. Default: 0
lowest level of blocks to render. Default: -64
max
highest level of blocks to render. Default: 255
highest level of blocks to render. Default: 319
Exposed
Only renders blocks that are exposed (adjacent to a transparent block).

View File

@ -67,8 +67,8 @@ class HeightFading(RenderPrimitive):
class Depth(RenderPrimitive):
name = "depth"
options = {
"min": ("lowest level of blocks to render", 0),
"max": ("highest level of blocks to render", 255),
"min": ("lowest level of blocks to render", -64),
"max": ("highest level of blocks to render", 319),
}
class Exposed(RenderPrimitive):

View File

@ -37,7 +37,7 @@ depth_start(void* data, RenderState* state, PyObject* support) {
static bool
depth_hidden(void* data, RenderState* state, int32_t x, int32_t y, int32_t z) {
PrimitiveDepth* self = (PrimitiveDepth*)data;
y += 16 * state->chunky;
y += 16 * (state->chunky - 4);
if (y > self->max || y < self->min) {
return true;
}