Clean up some

This commit is contained in:
Vladislav Khorev committed 2025-12-29 20:40:13 +03:00
1 parent 1af829bf49
commit f197dfcf02
10 files changed
+49 -352

No files matched your search

+8 -28
View File
@@ -2,10 +2,10 @@ varying vec2 TexCoord;
varying vec3 vViewDirTangent;
uniform sampler2D Texture;
uniform sampler2D BakedTexture;
uniform float uHeightScale;
uniform float uDistanceToPlanetSurface;
uniform float uCurrentZFar;
//varying float realDist;
varying vec3 worldPosition;
uniform vec3 uViewPos;
@@ -25,8 +25,14 @@ void main() {
vec2 finalTexCoord = TexCoord + p;
float realDist = distance(worldPosition, uViewPos);
float textureMixFactor = clamp((2000 - realDist) / 500.0, 0.0, 1.0);
vec4 bakedTextureColor = texture2D(BakedTexture, finalTexCoord);
vec4 textureColor = texture2D(Texture, TexCoord);
vec4 finalColor = texture2D(Texture, finalTexCoord);
vec4 finalColor = textureMixFactor*textureColor + (1 - textureMixFactor) * bakedTextureColor;
float fogFactor;
if (uDistanceToPlanetSurface > 1000)
@@ -61,30 +67,4 @@ void main() {
gl_FragColor = mix(vec4(finalColor.rgb, 1.0), FOG_COLOR, fogFactor);
}
/*
if (realDist < 500)
{
gl_FragColor = vec4(0.5, 0.0, 0.0, 1.0);
}
else if (realDist < 1000)
{
gl_FragColor = vec4(1.0, 0.2, 0.0, 1.0);
}
else if (realDist < 1800)
{
gl_FragColor = vec4(1.0, 0.7, 0.0, 1.0);
}
else if (realDist < 2400)
{
gl_FragColor = vec4(1.0, 0.7, 0.5, 1.0);
}
else if (realDist < 2700)
{
gl_FragColor = vec4(1.0, 0.7, 1.0, 1.0);
}
else
{
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}*/
}