Fixed custom depth rendering
This commit is contained in:
committed by
Nicolas F
parent
acf6479f4c
commit
7a55d33e8f
@@ -1101,10 +1101,10 @@ Depth
|
|||||||
**Options**
|
**Options**
|
||||||
|
|
||||||
min
|
min
|
||||||
lowest level of blocks to render. Default: 0
|
lowest level of blocks to render. Default: -64
|
||||||
|
|
||||||
max
|
max
|
||||||
highest level of blocks to render. Default: 255
|
highest level of blocks to render. Default: 319
|
||||||
|
|
||||||
Exposed
|
Exposed
|
||||||
Only renders blocks that are exposed (adjacent to a transparent block).
|
Only renders blocks that are exposed (adjacent to a transparent block).
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ class HeightFading(RenderPrimitive):
|
|||||||
class Depth(RenderPrimitive):
|
class Depth(RenderPrimitive):
|
||||||
name = "depth"
|
name = "depth"
|
||||||
options = {
|
options = {
|
||||||
"min": ("lowest level of blocks to render", 0),
|
"min": ("lowest level of blocks to render", -64),
|
||||||
"max": ("highest level of blocks to render", 255),
|
"max": ("highest level of blocks to render", 319),
|
||||||
}
|
}
|
||||||
|
|
||||||
class Exposed(RenderPrimitive):
|
class Exposed(RenderPrimitive):
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ depth_start(void* data, RenderState* state, PyObject* support) {
|
|||||||
static bool
|
static bool
|
||||||
depth_hidden(void* data, RenderState* state, int32_t x, int32_t y, int32_t z) {
|
depth_hidden(void* data, RenderState* state, int32_t x, int32_t y, int32_t z) {
|
||||||
PrimitiveDepth* self = (PrimitiveDepth*)data;
|
PrimitiveDepth* self = (PrimitiveDepth*)data;
|
||||||
y += 16 * state->chunky;
|
y += 16 * (state->chunky - 4);
|
||||||
if (y > self->max || y < self->min) {
|
if (y > self->max || y < self->min) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user