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 Summary
FieldsModifier 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 Summary
Constructors -
Method Summary
Modifier 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) final voidprocess(VertexConsumer consumer, PoseStack.Pose pose, BakedQuad quad, int overlay) final voidreset()final voidsetup(BlockAndTintGetter level, BlockPos pos, BlockState state)
-
Field Details
-
WHITE
private static final float[] WHITE -
colors
-
currentHash
private int currentHash -
level
-
pos
-
state
-
cachedTintIndex
private int cachedTintIndex -
cachedTintColor
private final float[] cachedTintColor -
brightness
private final float[] brightness -
lightmap
private final int[] lightmap -
positions
private final float[][] positions -
normals
private final byte[][] normals -
packedLightmaps
private final int[] packedLightmaps
-
-
Constructor Details
-
QuadLighter
-
-
Method Details
-
computeLightingAt
-
calculateBrightness
protected abstract float calculateBrightness(float[] position) -
calculateLightmap
protected abstract int calculateLightmap(float[] position, byte[] normal) -
setup
-
reset
public final void reset() -
process
public final void process(VertexConsumer consumer, PoseStack.Pose pose, BakedQuad quad, int overlay) -
getColorFast
private float[] getColorFast(int tintIndex) -
calculateShade
public static float calculateShade(float normalX, float normalY, float normalZ, boolean constantAmbientLight)
-