Skip to content

Commit

Permalink
Fix getEyeBrightness, add basic support for wetness and eyeBrightness…
Browse files Browse the repository at this point in the history
…Smooth
  • Loading branch information
coderbot16 committed Feb 20, 2021
1 parent fa5dcb0 commit 5f0e956
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/net/coderbot/iris/uniforms/CommonUniforms.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ public static void addCommonUniforms(UniformHolder uniforms, IdMap idMap) {
.uniform1f(PER_FRAME, "screenBrightness", () -> client.options.gamma)
.uniform1f(PER_TICK, "playerMood", CommonUniforms::getPlayerMood)
.uniform2i(PER_FRAME, "eyeBrightness", CommonUniforms::getEyeBrightness)
// TODO: This should be smoothed, but not smoothing it is better than nothing.
.uniform2i(PER_FRAME, "eyeBrightnessSmooth", CommonUniforms::getEyeBrightness)
.uniform1f(PER_TICK, "rainStrength", CommonUniforms::getRainStrength)
// TODO: This should be smoothed, but not smoothing it is better than nothing.
.uniform1f(PER_TICK, "wetness", CommonUniforms::getRainStrength)
.uniform3d(PER_FRAME, "skyColor", CommonUniforms::getSkyColor);
}

Expand Down Expand Up @@ -108,7 +112,7 @@ private static Vec2f getEyeBrightness() {
}
int blockLight = client.world.getLightLevel(LightType.BLOCK, client.cameraEntity.getBlockPos());
int skyLight = client.world.getLightLevel(LightType.SKY, client.cameraEntity.getBlockPos());
return new Vec2f(blockLight, skyLight);
return new Vec2f(blockLight * 16.0f, skyLight * 16.0f);
}

private static float getNightVision() {
Expand Down

0 comments on commit 5f0e956

Please sign in to comment.