Class QuadLighter
java.lang.Object
net.minecraftforge.client.model.lighting.QuadLighter
- Direct Known Subclasses:
- FlatQuadLighter,- SmoothQuadLighter
Base class for all quad lighting providers.
 
 Contains all the shared elements needed for BakedQuad processing and defers lighting logic to inheritors.
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final float[]private final float[]private intprivate final BlockColorsprivate intprivate BlockAndTintGetterprivate final int[]private final byte[][]private final int[]private BlockPosprivate final float[][]private BlockStateprivate static final float[]
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract floatcalculateBrightness(float[] position) protected abstract intcalculateLightmap(float[] position, byte[] normal) static floatcalculateShade(float normalX, float normalY, float normalZ, boolean constantAmbientLight) protected abstract voidcomputeLightingAt(BlockAndTintGetter level, BlockPos pos, BlockState state) private float[]getColorFast(int tintIndex) protected static intgetLightColor(BlockAndTintGetter level, BlockPos pos, BlockState state) Deprecated.final voidprocess(VertexConsumer consumer, PoseStack.Pose pose, BakedQuad quad, int overlay) final voidreset()final voidsetup(BlockAndTintGetter level, BlockPos pos, BlockState state) 
- 
Field Details- 
WHITEprivate static final float[] WHITE
- 
colors
- 
currentHashprivate int currentHash
- 
level
- 
pos
- 
state
- 
cachedTintIndexprivate int cachedTintIndex
- 
cachedTintColorprivate final float[] cachedTintColor
- 
brightnessprivate final float[] brightness
- 
lightmapprivate final int[] lightmap
- 
positionsprivate final float[][] positions
- 
normalsprivate final byte[][] normals
- 
packedLightmapsprivate final int[] packedLightmaps
 
- 
- 
Constructor Details- 
QuadLighter
 
- 
- 
Method Details- 
computeLightingAt
- 
calculateBrightnessprotected abstract float calculateBrightness(float[] position) 
- 
calculateLightmapprotected abstract int calculateLightmap(float[] position, byte[] normal) 
- 
setup
- 
resetpublic final void reset()
- 
processpublic final void process(VertexConsumer consumer, PoseStack.Pose pose, BakedQuad quad, int overlay) 
- 
getColorFastprivate float[] getColorFast(int tintIndex) 
- 
calculateShadepublic static float calculateShade(float normalX, float normalY, float normalZ, boolean constantAmbientLight) 
- 
getLightColor@Deprecated(since="1.20.1") protected static int getLightColor(BlockAndTintGetter level, BlockPos pos, BlockState state) Deprecated.Note: This method is subtly different thanLevelRenderer.getLightColor(BlockAndTintGetter, BlockState, BlockPos)as it only uses the state for querying if the state has emissive rendering but instead looks up the state at the given position for checking the light emission.
 
-