Search code examples
openglrenderingreal-timelightingminecraft

How does Minecraft perform lighting?


The only model I'm familiar with is diffuse lighting but this look way more complicated than that.


Solution

  • Each square has a light level from 15 to 0. Each level is 20% less than the level above it. If a square contains a light source it gets the luminosity of that light source, otherwise it gets one less than the brightest neighbor.

    Sunlight is special, it suffers no vertical attenuation.