Eloraams Blog

1.8.1 Lighting

So I’ve been studying the 1.8.1 lighting code. In some ways, it’s not as big a change as I’d been afraid of, but it’s still going to take me a few hours to work through.

The overview is basically this: - The glColor channels on blocks are now baked ambient occlusion. That doesn’t change when the lighting conditions change, so that actually makes some sense. - A second texture unit is initialized and used for all lighting information. The texture used is 2 dimensional, with one coordinate being the sky occlusion, and the other being local lights. Since sky occlusion doesn’t change when the sun rises or sets, this allows the instant sunrise/sunset that 1.8.1 brings. It also allows tinting various lights at various times of day.

The good news: - The RedPower rendering code isn’t a total loss. The same design can work, but I have to make a bunch of changes. - I think the new lighting code is pretty cool.

The bad news: - While not a total loss, the RedPower renderer does need a lot of work. It’ll probably be hours before I can get a good fix for this. - This makes it much, much harder to ever add RGB lighting.