2023-11-06 16:12:00 +03:00
|
|
|
package team.chisel.client.render;
|
|
|
|
|
|
|
|
|
|
import codechicken.lib.render.CCRenderState;
|
|
|
|
|
|
|
|
|
|
public class FullBrightLighting implements CCRenderState.IVertexOperation {
|
|
|
|
|
|
|
|
|
|
public static FullBrightLighting instance = new FullBrightLighting();
|
|
|
|
|
public int id;
|
|
|
|
|
|
|
|
|
|
public boolean load() {
|
2024-01-03 16:25:53 -06:00
|
|
|
final CCRenderState state = CCRenderState.instance();
|
|
|
|
|
|
|
|
|
|
if (!state.computeLighting) {
|
2023-11-06 16:12:00 +03:00
|
|
|
return false;
|
|
|
|
|
}
|
2025-05-10 11:05:52 -05:00
|
|
|
state.pipeline.addDependency(CCRenderState.instance().colourAttrib);
|
|
|
|
|
state.pipeline.addDependency(CCRenderState.instance().lightCoordAttrib);
|
2023-11-06 16:12:00 +03:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void operate() {
|
2024-01-03 16:25:53 -06:00
|
|
|
CCRenderState.instance()
|
|
|
|
|
.setBrightness(FULL_BRIGHT_BLOCK_BRIGHTNESS);
|
2023-11-06 16:12:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int operationID() {
|
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
id = CCRenderState.registerOperation();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// magic number from 'RenderBlocksCTMFullbright'
|
|
|
|
|
// this is the brightness of the neonite, anti, glotek blocks
|
|
|
|
|
// so we use it for custom microblock lighting
|
|
|
|
|
private final static int FULL_BRIGHT_BLOCK_BRIGHTNESS = 0xF000F0;
|
|
|
|
|
}
|