mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-09 16:45:46 -07:00
Improved fog distance scaling
This commit is contained in:
parent
fec94fe629
commit
f80d7cbb61
4 changed files with 5 additions and 4 deletions
|
|
@ -44,6 +44,7 @@ public class GlobalConfig {
|
|||
// default distance is 28
|
||||
public static int TILE_DISTANCE = 56;
|
||||
public static int VIEW_DISTANCE = TILE_DISTANCE * 128;
|
||||
public static float VIEW_FADE_DISTANCE = ((float) TILE_DISTANCE / 28.0f) * 256.0f;
|
||||
|
||||
public static boolean USE_TWEENING = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public final class Static156 {
|
|||
GlRenderer.setLightingEnabled(false);
|
||||
local1.glDisable(GL2.GL_DEPTH_TEST);
|
||||
local1.glPushAttrib(GL2.GL_FOG_BIT);
|
||||
local1.glFogf(GL2.GL_FOG_START, (float) GlobalConfig.VIEW_DISTANCE - 512.0f);
|
||||
local1.glFogf(GL2.GL_FOG_START, (float) GlobalConfig.VIEW_DISTANCE - (GlobalConfig.VIEW_FADE_DISTANCE * 2.0f));
|
||||
GlRenderer.disableDepthMask();
|
||||
for (@Pc(19) int local19 = 0; local19 < Static36.surfaceHdTiles[0].length; local19++) {
|
||||
@Pc(31) GlTile local31 = Static36.surfaceHdTiles[0][local19];
|
||||
|
|
|
|||
|
|
@ -94,12 +94,12 @@ public final class Static161 {
|
|||
gl.glFogf(GL2.GL_FOG_DENSITY, 0.95F);
|
||||
gl.glHint(GL2.GL_FOG_HINT, GL2.GL_FASTEST);
|
||||
int fogEnd = GlobalConfig.VIEW_DISTANCE;
|
||||
@Pc(65) int fogStart = fogEnd - 512 - offset;
|
||||
@Pc(65) int fogStart = fogEnd - (int)(GlobalConfig.VIEW_FADE_DISTANCE * 2.0f) - offset;
|
||||
if (fogStart < 50) {
|
||||
fogStart = 50;
|
||||
}
|
||||
gl.glFogf(GL2.GL_FOG_START, (float) fogStart);
|
||||
gl.glFogf(GL2.GL_FOG_END, (float) fogEnd - 256.0f);
|
||||
gl.glFogf(GL2.GL_FOG_END, (float) fogEnd - GlobalConfig.VIEW_FADE_DISTANCE);
|
||||
gl.glFogfv(GL2.GL_FOG_COLOR, fogColor, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ public final class WaterMaterialRenderer implements MaterialRenderer {
|
|||
local1.glCallList(this.anInt4440);
|
||||
@Pc(12) float local12 = 2662.4001F;
|
||||
local12 += (float) (Static254.anInt5559 - 128) * 0.5F;
|
||||
float max = (float) GlobalConfig.VIEW_DISTANCE - 256.0f;
|
||||
float max = (float) GlobalConfig.VIEW_DISTANCE - GlobalConfig.VIEW_FADE_DISTANCE;
|
||||
if (local12 >= max) {
|
||||
local12 = max - 1.0f;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue