Skip to content

Commit ea6ac62

Browse files
committed
WIP precision - first full pass complete and compiling
1 parent ad37aab commit ea6ac62

File tree

84 files changed

+459
-448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+459
-448
lines changed

src/graphics/program-lib/chunks/TBNObjectSpace.frag

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
void getTBN() {
22

3-
vec3 B = cross(dVertexNormalW, vObjectSpaceUpW);
4-
vec3 T = cross(dVertexNormalW, B);
3+
MEDP vec3 B = cross(dVertexNormalW, vObjectSpaceUpW);
4+
MEDP vec3 T = cross(dVertexNormalW, B);
55

66
if (dot(B,B)==0.0) // deal with case when vObjectSpaceUpW dVertexNormalW are parallel
77
{
8-
float major=max(max(dVertexNormalW.x, dVertexNormalW.y),dVertexNormalW.z);
8+
MEDP float major=max(max(dVertexNormalW.x, dVertexNormalW.y),dVertexNormalW.z);
99

1010
if (dVertexNormalW.x==major)
1111
{
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// http://www.thetenthplanet.de/archives/1180
22
void getTBN() {
3-
vec2 uv = $UV;
3+
MEDP vec2 uv = $UV;
44

55
// get edge vectors of the pixel triangle
6-
vec3 dp1 = dFdx( vPositionW );
7-
vec3 dp2 = dFdy( vPositionW );
8-
vec2 duv1 = dFdx( uv );
9-
vec2 duv2 = dFdy( uv );
6+
MEDP vec3 dp1 = dFdx( vPositionW );
7+
MEDP vec3 dp2 = dFdy( vPositionW );
8+
MEDP vec2 duv1 = dFdx( uv );
9+
MEDP vec2 duv2 = dFdy( uv );
1010

1111
// solve the linear system
12-
vec3 dp2perp = cross( dp2, dVertexNormalW );
13-
vec3 dp1perp = cross( dVertexNormalW, dp1 );
14-
vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;
15-
vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;
12+
MEDP vec3 dp2perp = cross( dp2, dVertexNormalW );
13+
MEDP vec3 dp1perp = cross( dVertexNormalW, dp1 );
14+
MEDP vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;
15+
MEDP vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;
1616

1717
// construct a scale-invariant frame
18-
float invmax = 1.0 / sqrt( max( dot(T,T), dot(B,B) ) );
18+
MEDP float invmax = 1.0 / sqrt( max( dot(T,T), dot(B,B) ) );
1919
dTBN = mat3( T * invmax, B * invmax, dVertexNormalW );
2020
}

src/graphics/program-lib/chunks/alphaTest.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
uniform float alpha_ref;
1+
uniform MEDP float alpha_ref;
22

33
void alphaTest(float a) {
44
if (a < alpha_ref) discard;

src/graphics/program-lib/chunks/ambientPrefilteredCube.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ uniform samplerCube texture_prefilteredCubeMap4;
44
#endif
55

66
void addAmbient() {
7-
vec3 fixedReflDir = fixSeamsStatic(cubeMapRotate(dNormalW), 1.0 - 1.0 / 4.0);
7+
MEDP vec3 fixedReflDir = fixSeamsStatic(cubeMapRotate(dNormalW), 1.0 - 1.0 / 4.0);
88
#ifndef RIGHT_HANDED_CUBEMAP
99
fixedReflDir.x *= -1.0;
1010
#endif

src/graphics/program-lib/chunks/ambientPrefilteredCubeLod.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ uniform samplerCube texture_prefilteredCubeMap128;
55
#endif
66

77
void addAmbient() {
8-
vec3 fixedReflDir = fixSeamsStatic(cubeMapRotate(dNormalW), 1.0 - 1.0 / 4.0);
8+
MEDP vec3 fixedReflDir = fixSeamsStatic(cubeMapRotate(dNormalW), 1.0 - 1.0 / 4.0);
99
#ifndef RIGHT_HANDED_CUBEMAP
1010
fixedReflDir.x *= -1.0;
1111
#endif

src/graphics/program-lib/chunks/ambientSH.frag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
uniform vec3 ambientSH[9];
1+
uniform MEDP vec3 ambientSH[9];
22

33
void addAmbient() {
4-
vec3 n = cubeMapRotate(dNormalW);
4+
MEDP vec3 n = cubeMapRotate(dNormalW);
55

66
vec3 color =
77
ambientSH[0] +

src/graphics/program-lib/chunks/aoSpecOcc.frag

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
uniform float material_occludeSpecularIntensity;
1+
uniform MEDP float material_occludeSpecularIntensity;
22

33
void occludeSpecular() {
44
// approximated specular occlusion from AO
5-
float specPow = exp2(dGlossiness * 11.0);
5+
MEDP float specPow = exp2(dGlossiness * 11.0);
66
// http://research.tri-ace.com/Data/cedec2011_RealtimePBR_Implementation_e.pptx
7-
float specOcc = saturate(pow(dot(dNormalW, dViewDirW) + dAo, 0.01*specPow) - 1.0 + dAo);
7+
MEDP float specOcc = saturate(pow(dot(dNormalW, dViewDirW) + dAo, 0.01*specPow) - 1.0 + dAo);
88
specOcc = mix(1.0, specOcc, material_occludeSpecularIntensity);
99

1010
dSpecularLight *= specOcc;

src/graphics/program-lib/chunks/aoSpecOccConst.frag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
void occludeSpecular() {
22
// approximated specular occlusion from AO
3-
float specPow = exp2(dGlossiness * 11.0);
3+
MEDP float specPow = exp2(dGlossiness * 11.0);
44
// http://research.tri-ace.com/Data/cedec2011_RealtimePBR_Implementation_e.pptx
5-
float specOcc = saturate(pow(dot(dNormalW, dViewDirW) + dAo, 0.01*specPow) - 1.0 + dAo);
5+
MEDP float specOcc = saturate(pow(dot(dNormalW, dViewDirW) + dAo, 0.01*specPow) - 1.0 + dAo);
66

77
dSpecularLight *= specOcc;
88
dReflection *= specOcc;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
void occludeSpecular() {
2-
float specOcc = dAo;
2+
MEDP float specOcc = dAo;
33
dSpecularLight *= specOcc;
44
dReflection *= specOcc;
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
uniform float material_occludeSpecularIntensity;
1+
uniform MEDP float material_occludeSpecularIntensity;
22

33
void occludeSpecular() {
4-
float specOcc = mix(1.0, dAo, material_occludeSpecularIntensity);
4+
MEDP float specOcc = mix(1.0, dAo, material_occludeSpecularIntensity);
55
dSpecularLight *= specOcc;
66
dReflection *= specOcc;
77
}

src/graphics/program-lib/chunks/bakeDirLmEnd.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
vec4 dirLm = texture2D(texture_dirLightMap, vUv1);
1+
MEDP vec4 dirLm = texture2D(texture_dirLightMap, vUv1);
22

33
if (bakeDir > 0.5) {
44
if (dAtten > 0.00001) {

src/graphics/program-lib/chunks/bakeLmEnd.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
gl_FragColor.rgb = dDiffuseLight;
2-
gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(0.5));
2+
gl_FragColor.rgb = pow(gl_FragColor.rgb, MEDP vec3(0.5));
33
gl_FragColor.rgb /= 8.0;
44
gl_FragColor.a = clamp( max( max( gl_FragColor.r, gl_FragColor.g ), max( gl_FragColor.b, 1.0 / 255.0 ) ), 0.0,1.0 );
55
gl_FragColor.a = ceil(gl_FragColor.a * 255.0) / 255.0;

src/graphics/program-lib/chunks/clearCoat.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifdef MAPFLOAT
2-
uniform float material_clearCoat;
2+
uniform MEDP float material_clearCoat;
33
#endif
44

55
#ifdef MAPTEXTURE

src/graphics/program-lib/chunks/clearCoatGloss.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifdef MAPFLOAT
2-
uniform float material_clearCoatGlossiness;
2+
uniform MEDP float material_clearCoatGlossiness;
33
#endif
44

55
#ifdef MAPTEXTURE

src/graphics/program-lib/chunks/clearCoatNormal.frag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#ifdef MAPTEXTURE
22
uniform sampler2D texture_clearCoatNormalMap;
3-
uniform float material_clearCoatBumpiness;
3+
uniform MEDP float material_clearCoatBumpiness;
44
#endif
55

66
void getClearCoatNormal() {
77
#ifdef MAPTEXTURE
8-
vec3 normalMap = unpackNormal(texture2D(texture_clearCoatNormalMap, $UV));
8+
MEDP vec3 normalMap = unpackNormal(texture2D(texture_clearCoatNormalMap, $UV));
99
normalMap = normalize(mix(vec3(0.0, 0.0, 1.0), normalMap, material_clearCoatBumpiness));
1010
ccNormalW = dTBN * normalMap;
1111
#else

src/graphics/program-lib/chunks/combineDiffuseSpecularNoReflSeparateAmbient.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
uniform vec3 material_ambient;
1+
uniform MEDP vec3 material_ambient;
22

33
vec3 combineColor() {
44
return (dDiffuseLight - light_globalAmbient) * dAlbedo + dSpecularLight * dSpecularity + material_ambient * light_globalAmbient;
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
vec4 getCookie2D(sampler2D tex, mat4 transform, float intensity) {
2-
vec4 projPos = transform * vec4(vPositionW, 1.0);
2+
MEDP vec4 projPos = transform * MEDP vec4(vPositionW, 1.0);
33
projPos.xy /= projPos.w;
44
return mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);
55
}
66

77
vec4 getCookie2DClip(sampler2D tex, mat4 transform, float intensity) {
8-
vec4 projPos = transform * vec4(vPositionW, 1.0);
8+
MEDP vec4 projPos = transform * MEDP vec4(vPositionW, 1.0);
99
projPos.xy /= projPos.w;
1010
if (projPos.x < 0.0 || projPos.x > 1.0 || projPos.y < 0.0 || projPos.y > 1.0 || projPos.z < 0.0) return vec4(0.0);
1111
return mix(vec4(1.0), texture2D(tex, projPos.xy), intensity);
1212
}
1313

1414
vec4 getCookie2DXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {
15-
vec4 projPos = transform * vec4(vPositionW, 1.0);
15+
MEDP vec4 projPos = transform * MEDP vec4(vPositionW, 1.0);
1616
projPos.xy /= projPos.w;
1717
projPos.xy += cookieOffset;
1818
vec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);
1919
return mix(vec4(1.0), texture2D(tex, uv), intensity);
2020
}
2121

2222
vec4 getCookie2DClipXform(sampler2D tex, mat4 transform, float intensity, vec4 cookieMatrix, vec2 cookieOffset) {
23-
vec4 projPos = transform * vec4(vPositionW, 1.0);
23+
MEDP vec4 projPos = transform * MEDP vec4(vPositionW, 1.0);
2424
projPos.xy /= projPos.w;
2525
projPos.xy += cookieOffset;
2626
if (projPos.x < 0.0 || projPos.x > 1.0 || projPos.y < 0.0 || projPos.y > 1.0 || projPos.z < 0.0) return vec4(0.0);
2727
vec2 uv = mat2(cookieMatrix) * (projPos.xy-vec2(0.5)) + vec2(0.5);
2828
return mix(vec4(1.0), texture2D(tex, uv), intensity);
2929
}
3030

31-
vec4 getCookieCube(samplerCube tex, mat4 transform, float intensity) {
31+
vec4 getCookieCube(samplerCube tex, mat4 transform, MEDP float intensity) {
3232
return mix(vec4(1.0), textureCube(tex, dLightDirNormW * mat3(transform)), intensity);
3333
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
uniform vec3 envBoxMin, envBoxMax;
1+
uniform MEDP vec3 envBoxMin, envBoxMax;
22

33
vec3 cubeMapProject(vec3 nrdir) {
44
nrdir = cubeMapRotate(nrdir);
55

6-
vec3 rbmax = (envBoxMax - vPositionW) / nrdir;
7-
vec3 rbmin = (envBoxMin - vPositionW) / nrdir;
6+
MEDP vec3 rbmax = (envBoxMax - vPositionW) / nrdir;
7+
MEDP vec3 rbmin = (envBoxMin - vPositionW) / nrdir;
88

9-
vec3 rbminmax;
9+
MEDP vec3 rbminmax;
1010
rbminmax.x = nrdir.x>0.0? rbmax.x : rbmin.x;
1111
rbminmax.y = nrdir.y>0.0? rbmax.y : rbmin.y;
1212
rbminmax.z = nrdir.z>0.0? rbmax.z : rbmin.z;
1313

14-
float fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);
14+
MEDP float fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);
1515

16-
vec3 posonbox = vPositionW + nrdir * fa;
17-
vec3 envBoxPos = (envBoxMin + envBoxMax) * 0.5;
16+
MEDP vec3 posonbox = vPositionW + nrdir * fa;
17+
MEDP vec3 envBoxPos = (envBoxMin + envBoxMax) * 0.5;
1818
return posonbox - envBoxPos;
1919
}

src/graphics/program-lib/chunks/cubeMapRotate.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifdef CUBEMAP_ROTATION
2-
uniform mat3 cubeMapRotationMatrix;
2+
uniform MEDP mat3 cubeMapRotationMatrix;
33
#endif
44

55
vec3 cubeMapRotate(vec3 refDir) {

src/graphics/program-lib/chunks/diffuse.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifdef MAPCOLOR
2-
uniform vec3 material_diffuse;
2+
uniform MEDP vec3 material_diffuse;
33
#endif
44

55
#ifdef MAPTEXTURE

src/graphics/program-lib/chunks/diffuseDetailMap.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ uniform sampler2D texture_diffuseDetailMap;
44

55
vec3 addAlbedoDetail(vec3 albedo) {
66
#ifdef MAPTEXTURE
7-
vec3 albedoDetail = vec3(texture2D(texture_diffuseDetailMap, $UV).$CH);
7+
MEDP vec3 albedoDetail = vec3(texture2D(texture_diffuseDetailMap, $UV).$CH);
88
return detailMode_$DETAILMODE(albedo, albedoDetail);
99
#else
1010
return albedo;

src/graphics/program-lib/chunks/dilate.frag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
varying vec2 vUv0;
22

33
uniform sampler2D source;
4-
uniform vec2 pixelOffset;
4+
uniform MEDP vec2 pixelOffset;
55

66
void main(void) {
7-
vec4 c = texture2D(source, vUv0);
7+
MEDP vec4 c = texture2D(source, vUv0);
88
c = c.a>0.0? c : texture2D(source, vUv0 - pixelOffset);
99
c = c.a>0.0? c : texture2D(source, vUv0 + vec2(0, -pixelOffset.y));
1010
c = c.a>0.0? c : texture2D(source, vUv0 + vec2(pixelOffset.x, -pixelOffset.y));

src/graphics/program-lib/chunks/dpAtlasQuad.frag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
varying vec2 vUv0;
22

33
uniform sampler2D source;
4-
uniform vec4 params;
4+
uniform MEDP vec4 params;
55

66
void main(void) {
7-
vec2 uv = vUv0;
7+
MEDP vec2 uv = vUv0;
88
uv = uv * 2.0 - vec2(1.0);
99
uv *= params.xy;
1010
uv = uv * 0.5 + 0.5;

src/graphics/program-lib/chunks/emissive.frag

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#ifdef MAPCOLOR
2-
uniform vec3 material_emissive;
2+
uniform MEDP vec3 material_emissive;
33
#endif
44

55
#ifdef MAPFLOAT
6-
uniform float material_emissiveIntensity;
6+
uniform MEDP float material_emissiveIntensity;
77
#endif
88

99
#ifdef MAPTEXTURE
1010
uniform sampler2D texture_emissiveMap;
1111
#endif
1212

1313
vec3 getEmission() {
14-
vec3 emission = vec3(1.0);
14+
MEDP vec3 emission = vec3(1.0);
1515

1616
#ifdef MAPFLOAT
1717
emission *= material_emissiveIntensity;

src/graphics/program-lib/chunks/envMultiply.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
uniform float skyboxIntensity;
1+
uniform MEDP float skyboxIntensity;
22

33
vec3 processEnvironment(vec3 color) {
44
return color * skyboxIntensity;

src/graphics/program-lib/chunks/falloffInvSquared.frag

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
float getFalloffWindow(float lightRadius) {
2-
float sqrDist = dot(dLightDirW, dLightDirW);
3-
float invRadius = 1.0 / lightRadius;
2+
MEDP float sqrDist = dot(dLightDirW, dLightDirW);
3+
MEDP float invRadius = 1.0 / lightRadius;
44
return square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );
55
}
66

77
float getFalloffInvSquared(float lightRadius) {
8-
float sqrDist = dot(dLightDirW, dLightDirW);
9-
float falloff = 1.0 / (sqrDist + 1.0);
10-
float invRadius = 1.0 / lightRadius;
8+
MEDP float sqrDist = dot(dLightDirW, dLightDirW);
9+
MEDP float falloff = 1.0 / (sqrDist + 1.0);
10+
MEDP float invRadius = 1.0 / lightRadius;
1111

1212
falloff *= 16.0;
1313
falloff *= square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
float getFalloffLinear(float lightRadius) {
2-
float d = length(dLightDirW);
2+
MEDP float d = length(dLightDirW);
33
return max(((lightRadius - d) / lightRadius), 0.0);
44
}

src/graphics/program-lib/chunks/fixCubemapSeamsStretch.frag

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
vec3 fixSeams(vec3 vec, float mipmapIndex) {
2-
float scale = 1.0 - exp2(mipmapIndex) / 128.0;
3-
float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
2+
MEDP float scale = 1.0 - exp2(mipmapIndex) / 128.0;
3+
MEDP float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
44
if (abs(vec.x) != M) vec.x *= scale;
55
if (abs(vec.y) != M) vec.y *= scale;
66
if (abs(vec.z) != M) vec.z *= scale;
77
return vec;
88
}
99

1010
vec3 fixSeams(vec3 vec) {
11-
float scale = 1.0 - 1.0 / 128.0;
12-
float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
11+
MEDP float scale = 1.0 - 1.0 / 128.0;
12+
MEDP float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
1313
if (abs(vec.x) != M) vec.x *= scale;
1414
if (abs(vec.y) != M) vec.y *= scale;
1515
if (abs(vec.z) != M) vec.z *= scale;
1616
return vec;
1717
}
1818

1919
vec3 fixSeamsStatic(vec3 vec, float invRecMipSize) {
20-
float scale = invRecMipSize;
21-
float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
20+
MEDP float scale = invRecMipSize;
21+
MEDP float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
2222
if (abs(vec.x) != M) vec.x *= scale;
2323
if (abs(vec.y) != M) vec.y *= scale;
2424
if (abs(vec.z) != M) vec.z *= scale;
2525
return vec;
2626
}
2727

2828
vec3 calcSeam(vec3 vec) {
29-
vec3 avec = abs(vec);
30-
float M = max(avec.x, max(avec.y, avec.z));
29+
MEDP vec3 avec = abs(vec);
30+
MEDP float M = max(avec.x, max(avec.y, avec.z));
3131
return vec3(avec.x != M ? 1.0 : 0.0,
3232
avec.y != M ? 1.0 : 0.0,
3333
avec.z != M ? 1.0 : 0.0);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
uniform vec3 fog_color;
2-
uniform float fog_density;
3-
float dBlendModeFogFactor = 1.0;
1+
uniform MEDP vec3 fog_color;
2+
uniform MEDP float fog_density;
3+
MEDP float dBlendModeFogFactor = 1.0;
44

55
vec3 addFog(vec3 color) {
6-
float depth = gl_FragCoord.z / gl_FragCoord.w;
7-
float fogFactor = exp(-depth * fog_density);
6+
MEDP float depth = gl_FragCoord.z / gl_FragCoord.w;
7+
MEDP float fogFactor = exp(-depth * fog_density);
88
fogFactor = clamp(fogFactor, 0.0, 1.0);
99
return mix(fog_color * dBlendModeFogFactor, color, fogFactor);
1010
}

0 commit comments

Comments
 (0)