Package codechicken.lib.render.lighting
Class LightMatrix
java.lang.Object
codechicken.lib.render.lighting.LightMatrix
- All Implemented Interfaces:
IVertexOperation
Note that when using the class as a vertex transformer, the vertices are assumed to be within the BB (x, y, z) -> (x+1, y+1, z+1)
-
Nested Class Summary
Nested classes/interfaces inherited from interface codechicken.lib.render.pipeline.IVertexOperation
IVertexOperation.VertexOperationRegistry -
Field Summary
FieldsModifier and TypeFieldDescriptionnet.minecraft.world.level.BlockAndTintGetterfloat[][]int[][]intstatic final intnet.minecraft.core.BlockPosstatic final int[][]static final float[]static final int[][]The 9 positions in the sample array for each side, sides >= 6 are centered on sample 13 (the block itself) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat[]ao(int side) int[]brightness(int side) protected voidinterp(int s, int q, int a, int b, int c, int d) static floatinterpAO(float a, float b, float c, float d) static intinterpBrightness(int a, int b, int c, int d) booleanload(CCRenderState ccrs) Load any required references and add dependencies to the pipeline based on the current model (may be null) Return false if this operation is redundant in the pipeline with the given modelvoidlocate(net.minecraft.world.level.BlockAndTintGetter a, net.minecraft.core.BlockPos bPos) voidoperate(CCRenderState ccrs) Perform the operation on the current render stateintGet the unique id representing this type of operation.voidsample(int i) voidsideSample(int side)
-
Field Details
-
operationIndex
public static final int operationIndex -
computed
public int computed -
ao
public float[][] ao -
brightness
public int[][] brightness -
access
public net.minecraft.world.level.BlockAndTintGetter access -
pos
public net.minecraft.core.BlockPos pos -
ssamplem
public static final int[][] ssamplemThe 9 positions in the sample array for each side, sides >= 6 are centered on sample 13 (the block itself) -
qsamplem
public static final int[][] qsamplem -
sideao
public static final float[] sideao
-
-
Constructor Details
-
LightMatrix
public LightMatrix()
-
-
Method Details
-
locate
public void locate(net.minecraft.world.level.BlockAndTintGetter a, net.minecraft.core.BlockPos bPos) -
sample
public void sample(int i) -
brightness
public int[] brightness(int side) -
ao
public float[] ao(int side) -
sideSample
public void sideSample(int side) -
interp
protected void interp(int s, int q, int a, int b, int c, int d) -
interpAO
public static float interpAO(float a, float b, float c, float d) -
interpBrightness
public static int interpBrightness(int a, int b, int c, int d) -
load
Description copied from interface:IVertexOperationLoad any required references and add dependencies to the pipeline based on the current model (may be null) Return false if this operation is redundant in the pipeline with the given model- Specified by:
loadin interfaceIVertexOperation
-
operate
Description copied from interface:IVertexOperationPerform the operation on the current render state- Specified by:
operatein interfaceIVertexOperation
-
operationID
public int operationID()Description copied from interface:IVertexOperationGet the unique id representing this type of operation. Duplicate operation IDs within the pipeline may have unexpected results. ID should be obtained from CCRenderState.registerOperation() and stored in a static variable- Specified by:
operationIDin interfaceIVertexOperation
-