mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-02-20 17:05:32 +01:00
Move constant ambient light uniform to level group
This commit is contained in:
parent
206aa8d312
commit
b53c6c60bd
2 changed files with 10 additions and 10 deletions
|
@ -128,9 +128,6 @@ public class FrameUniforms implements UniformProvider {
|
|||
MemoryUtil.memPutFloat(ptr, Minecraft.getInstance().gameRenderer.getDepthFar());
|
||||
ptr += 4;
|
||||
|
||||
MemoryUtil.memPutInt(ptr, getConstantAmbientLightFlag(context));
|
||||
ptr += 4;
|
||||
|
||||
ptr = writeTime(ptr);
|
||||
|
||||
ptr = writeCameraIn(ptr);
|
||||
|
@ -220,11 +217,4 @@ public class FrameUniforms implements UniformProvider {
|
|||
Vec3 cameraPos = camera.getPosition();
|
||||
return Uniforms.writeInFluidAndBlock(ptr, level, blockPos, cameraPos);
|
||||
}
|
||||
|
||||
private static int getConstantAmbientLightFlag(RenderContext context) {
|
||||
var constantAmbientLight = context.level()
|
||||
.effects()
|
||||
.constantAmbientLight();
|
||||
return constantAmbientLight ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,9 @@ public class LevelUniforms implements UniformProvider {
|
|||
MemoryUtil.memPutFloat(ptr, level.getSkyDarken(ptick));
|
||||
ptr += 4;
|
||||
|
||||
MemoryUtil.memPutInt(ptr, getConstantAmbientLightFlag(context));
|
||||
ptr += 4;
|
||||
|
||||
// TODO: use defines for custom dimension ids
|
||||
int dimensionId;
|
||||
ResourceKey<Level> dimension = level.dimension();
|
||||
|
@ -90,4 +93,11 @@ public class LevelUniforms implements UniformProvider {
|
|||
}
|
||||
MemoryUtil.memPutInt(ptr, dimensionId);
|
||||
}
|
||||
|
||||
private static int getConstantAmbientLightFlag(RenderContext context) {
|
||||
var constantAmbientLight = context.level()
|
||||
.effects()
|
||||
.constantAmbientLight();
|
||||
return constantAmbientLight ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue