Add another element to the texture tuple with a mask for the lighting.
Make needed changes in textures.py. Because some textures have garbage in the alpha channel, this new method has some problems.
This commit is contained in:
@@ -206,19 +206,19 @@ rendermode_lighting_occluded(void *data, RenderState *state) {
|
||||
}
|
||||
|
||||
static void
|
||||
rendermode_lighting_draw(void *data, RenderState *state, PyObject *src, PyObject *mask) {
|
||||
rendermode_lighting_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObject *mask_light) {
|
||||
RenderModeLighting* self;
|
||||
int x, y, z;
|
||||
|
||||
/* first, chain up */
|
||||
rendermode_normal.draw(data, state, src, mask);
|
||||
rendermode_normal.draw(data, state, src, mask, mask_light);
|
||||
|
||||
self = (RenderModeLighting *)data;
|
||||
x = state->x, y = state->y, z = state->z;
|
||||
|
||||
if (is_transparent(state->block)) {
|
||||
/* transparent: do shading on whole block */
|
||||
do_shading_with_mask(self, state, x, y, z, mask);
|
||||
do_shading_with_mask(self, state, x, y, z, mask_light);
|
||||
} else {
|
||||
/* opaque: do per-face shading */
|
||||
do_shading_with_mask(self, state, x, y, z+1, self->facemasks[0]);
|
||||
|
||||
Reference in New Issue
Block a user