Added dawn
This commit is contained in:
1 parent
83b92e9881
commit
c8d743b932
13 files changed
+88
-40
No files matched your search
@@ -6,6 +6,8 @@ uniform int uPointLightCount;
|
||||
uniform vec3 uPointLightPos[4];
|
||||
uniform vec3 uPointLightDir[4];
|
||||
uniform vec3 uPointLightColor[4];
|
||||
uniform vec3 uAmbientColor;
|
||||
uniform vec3 uFogColor;
|
||||
|
||||
varying vec2 texCoord;
|
||||
varying float fogDistance;
|
||||
@@ -23,8 +25,7 @@ void main()
|
||||
if (color.a < 0.1)
|
||||
discard;
|
||||
|
||||
float ambient = 0.37;
|
||||
vec3 lighting = vec3(ambient);
|
||||
vec3 lighting = uAmbientColor;
|
||||
|
||||
bool hasNormal = dot(fragNormal, fragNormal) > 0.001;
|
||||
vec3 N = hasNormal ? normalize(fragNormal) : vec3(0.0);
|
||||
@@ -50,7 +51,7 @@ void main()
|
||||
|
||||
color.rgb *= lighting;
|
||||
|
||||
vec3 fogColor = vec3(0.01, 0.01, 0.05);
|
||||
vec3 fogColor = uFogColor;
|
||||
float fogFactor = clamp((fogDistance - 15.0) / 8.0, 0.0, 1.0);
|
||||
color.rgb = mix(color.rgb, fogColor, fogFactor);
|
||||
|
||||
|
||||
Reference in new issue
Block a user