mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-02-21 17:35:33 +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());
|
MemoryUtil.memPutFloat(ptr, Minecraft.getInstance().gameRenderer.getDepthFar());
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
|
|
||||||
MemoryUtil.memPutInt(ptr, getConstantAmbientLightFlag(context));
|
|
||||||
ptr += 4;
|
|
||||||
|
|
||||||
ptr = writeTime(ptr);
|
ptr = writeTime(ptr);
|
||||||
|
|
||||||
ptr = writeCameraIn(ptr);
|
ptr = writeCameraIn(ptr);
|
||||||
|
@ -220,11 +217,4 @@ public class FrameUniforms implements UniformProvider {
|
||||||
Vec3 cameraPos = camera.getPosition();
|
Vec3 cameraPos = camera.getPosition();
|
||||||
return Uniforms.writeInFluidAndBlock(ptr, level, blockPos, cameraPos);
|
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));
|
MemoryUtil.memPutFloat(ptr, level.getSkyDarken(ptick));
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
|
|
||||||
|
MemoryUtil.memPutInt(ptr, getConstantAmbientLightFlag(context));
|
||||||
|
ptr += 4;
|
||||||
|
|
||||||
// TODO: use defines for custom dimension ids
|
// TODO: use defines for custom dimension ids
|
||||||
int dimensionId;
|
int dimensionId;
|
||||||
ResourceKey<Level> dimension = level.dimension();
|
ResourceKey<Level> dimension = level.dimension();
|
||||||
|
@ -90,4 +93,11 @@ public class LevelUniforms implements UniformProvider {
|
||||||
}
|
}
|
||||||
MemoryUtil.memPutInt(ptr, dimensionId);
|
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