Skip to content

Commit 2df7dfd

Browse files
committed
categorized ready to test and debug
1 parent ea6ac62 commit 2df7dfd

File tree

80 files changed

+457
-449
lines changed

Some content is hidden

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

80 files changed

+457
-449
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-
MEDP vec3 B = cross(dVertexNormalW, vObjectSpaceUpW);
4-
MEDP vec3 T = cross(dVertexNormalW, B);
3+
MMEDP vec3 B = cross(dVertexNormalW, vObjectSpaceUpW);
4+
MMEDP vec3 T = cross(dVertexNormalW, B);
55

66
if (dot(B,B)==0.0) // deal with case when vObjectSpaceUpW dVertexNormalW are parallel
77
{
8-
MEDP float major=max(max(dVertexNormalW.x, dVertexNormalW.y),dVertexNormalW.z);
8+
MMEDP 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-
MEDP vec2 uv = $UV;
3+
MMEDP vec2 uv = $UV;
44

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

1111
// solve the linear system
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;
12+
MMEDP vec3 dp2perp = cross( dp2, dVertexNormalW );
13+
MMEDP vec3 dp1perp = cross( dVertexNormalW, dp1 );
14+
MMEDP vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;
15+
MMEDP vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;
1616

1717
// construct a scale-invariant frame
18-
MEDP float invmax = 1.0 / sqrt( max( dot(T,T), dot(B,B) ) );
18+
MMEDP 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 MEDP float alpha_ref;
1+
uniform MMEDP 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-
MEDP vec3 fixedReflDir = fixSeamsStatic(cubeMapRotate(dNormalW), 1.0 - 1.0 / 4.0);
7+
RMEDP 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-
MEDP vec3 fixedReflDir = fixSeamsStatic(cubeMapRotate(dNormalW), 1.0 - 1.0 / 4.0);
8+
RMEDP 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 MEDP vec3 ambientSH[9];
1+
uniform RMEDP vec3 ambientSH[9];
22

33
void addAmbient() {
4-
MEDP vec3 n = cubeMapRotate(dNormalW);
4+
RMEDP 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 MEDP float material_occludeSpecularIntensity;
1+
uniform OMEDP float material_occludeSpecularIntensity;
22

33
void occludeSpecular() {
44
// approximated specular occlusion from AO
5-
MEDP float specPow = exp2(dGlossiness * 11.0);
5+
OMEDP float specPow = exp2(dGlossiness * 11.0);
66
// http://research.tri-ace.com/Data/cedec2011_RealtimePBR_Implementation_e.pptx
7-
MEDP float specOcc = saturate(pow(dot(dNormalW, dViewDirW) + dAo, 0.01*specPow) - 1.0 + dAo);
7+
OMEDP 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-
MEDP float specPow = exp2(dGlossiness * 11.0);
3+
OMEDP float specPow = exp2(dGlossiness * 11.0);
44
// http://research.tri-ace.com/Data/cedec2011_RealtimePBR_Implementation_e.pptx
5-
MEDP float specOcc = saturate(pow(dot(dNormalW, dViewDirW) + dAo, 0.01*specPow) - 1.0 + dAo);
5+
OMEDP 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-
MEDP float specOcc = dAo;
2+
OMEDP 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 MEDP float material_occludeSpecularIntensity;
1+
uniform OMEDP float material_occludeSpecularIntensity;
22

33
void occludeSpecular() {
4-
MEDP float specOcc = mix(1.0, dAo, material_occludeSpecularIntensity);
4+
OMEDP 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-
MEDP vec4 dirLm = texture2D(texture_dirLightMap, vUv1);
1+
vec4 dirLm = texture2D(texture_dirLightMap, vUv1);
22

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

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 MEDP float material_clearCoat;
2+
uniform MMEDP 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 MEDP float material_clearCoatGlossiness;
2+
uniform MMEDP 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 MEDP float material_clearCoatBumpiness;
3+
uniform MMEDP float material_clearCoatBumpiness;
44
#endif
55

66
void getClearCoatNormal() {
77
#ifdef MAPTEXTURE
8-
MEDP vec3 normalMap = unpackNormal(texture2D(texture_clearCoatNormalMap, $UV));
8+
MMEDP 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 MEDP vec3 material_ambient;
1+
uniform LMEDP 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-
MEDP vec4 projPos = transform * MEDP vec4(vPositionW, 1.0);
2+
SMEDP vec4 projPos = transform * SMEDP 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-
MEDP vec4 projPos = transform * MEDP vec4(vPositionW, 1.0);
8+
SMEDP vec4 projPos = transform * SMEDP 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-
MEDP vec4 projPos = transform * MEDP vec4(vPositionW, 1.0);
15+
SMEDP vec4 projPos = transform * SMEDP 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-
MEDP vec4 projPos = transform * MEDP vec4(vPositionW, 1.0);
23+
SMEDP vec4 projPos = transform * SMEDP 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, MEDP float intensity) {
31+
vec4 getCookieCube(samplerCube tex, mat4 transform, SMEDP 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 MEDP vec3 envBoxMin, envBoxMax;
1+
uniform RMEDP vec3 envBoxMin, envBoxMax;
22

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

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

9-
MEDP vec3 rbminmax;
9+
RMEDP 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-
MEDP float fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);
14+
RMEDP float fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z);
1515

16-
MEDP vec3 posonbox = vPositionW + nrdir * fa;
17-
MEDP vec3 envBoxPos = (envBoxMin + envBoxMax) * 0.5;
16+
RMEDP vec3 posonbox = vPositionW + nrdir * fa;
17+
RMEDP 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 MEDP mat3 cubeMapRotationMatrix;
2+
uniform RMEDP 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 MEDP vec3 material_diffuse;
2+
uniform MMEDP 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-
MEDP vec3 albedoDetail = vec3(texture2D(texture_diffuseDetailMap, $UV).$CH);
7+
MMEDP vec3 albedoDetail = vec3(texture2D(texture_diffuseDetailMap, $UV).$CH);
88
return detailMode_$DETAILMODE(albedo, albedoDetail);
99
#else
1010
return albedo;

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-
MEDP float sqrDist = dot(dLightDirW, dLightDirW);
3-
MEDP float invRadius = 1.0 / lightRadius;
2+
LMEDP float sqrDist = dot(dLightDirW, dLightDirW);
3+
LMEDP float invRadius = 1.0 / lightRadius;
44
return square( saturate( 1.0 - square( sqrDist * square(invRadius) ) ) );
55
}
66

77
float getFalloffInvSquared(float lightRadius) {
8-
MEDP float sqrDist = dot(dLightDirW, dLightDirW);
9-
MEDP float falloff = 1.0 / (sqrDist + 1.0);
10-
MEDP float invRadius = 1.0 / lightRadius;
8+
LMEDP float sqrDist = dot(dLightDirW, dLightDirW);
9+
LMEDP float falloff = 1.0 / (sqrDist + 1.0);
10+
LMEDP 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-
MEDP float d = length(dLightDirW);
2+
LMEDP 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-
MEDP float scale = 1.0 - exp2(mipmapIndex) / 128.0;
3-
MEDP float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
2+
RMEDP float scale = 1.0 - exp2(mipmapIndex) / 128.0;
3+
RMEDP 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-
MEDP float scale = 1.0 - 1.0 / 128.0;
12-
MEDP float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
11+
RMEDP float scale = 1.0 - 1.0 / 128.0;
12+
RMEDP 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-
MEDP float scale = invRecMipSize;
21-
MEDP float M = max(max(abs(vec.x), abs(vec.y)), abs(vec.z));
20+
RMEDP float scale = invRecMipSize;
21+
RMEDP 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-
MEDP vec3 avec = abs(vec);
30-
MEDP float M = max(avec.x, max(avec.y, avec.z));
29+
RMEDP vec3 avec = abs(vec);
30+
RMEDP 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 MEDP vec3 fog_color;
2-
uniform MEDP float fog_density;
3-
MEDP float dBlendModeFogFactor = 1.0;
1+
uniform FMEDP vec3 fog_color;
2+
uniform FMEDP float fog_density;
3+
FMEDP float dBlendModeFogFactor = 1.0;
44

55
vec3 addFog(vec3 color) {
6-
MEDP float depth = gl_FragCoord.z / gl_FragCoord.w;
7-
MEDP float fogFactor = exp(-depth * fog_density);
6+
FMEDP float depth = gl_FragCoord.z / gl_FragCoord.w;
7+
FMEDP float fogFactor = exp(-depth * fog_density);
88
fogFactor = clamp(fogFactor, 0.0, 1.0);
99
return mix(fog_color * dBlendModeFogFactor, color, fogFactor);
1010
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
uniform MEDP vec3 fog_color;
2-
uniform MEDP float fog_density;
1+
uniform FMEDP vec3 fog_color;
2+
uniform FMEDP float fog_density;
33
float dBlendModeFogFactor = 1.0;
44

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

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
uniform MEDP vec3 fog_color;
2-
uniform MEDP float fog_start;
3-
uniform MEDP float fog_end;
4-
MEDP float dBlendModeFogFactor = 1.0;
1+
uniform FMEDP vec3 fog_color;
2+
uniform FMEDP float fog_start;
3+
uniform FMEDP float fog_end;
4+
FMEDP float dBlendModeFogFactor = 1.0;
55

66
vec3 addFog(vec3 color) {
7-
MEDP float depth = gl_FragCoord.z / gl_FragCoord.w;
8-
MEDP float fogFactor = (fog_end - depth) / (fog_end - fog_start);
7+
FMEDP float depth = gl_FragCoord.z / gl_FragCoord.w;
8+
FMEDP float fogFactor = (fog_end - depth) / (fog_end - fog_start);
99
fogFactor = clamp(fogFactor, 0.0, 1.0);
1010
fogFactor = gammaCorrectInput(fogFactor);
1111
return mix(fog_color * dBlendModeFogFactor, color, fogFactor);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MEDP float dBlendModeFogFactor = 1.0;
1+
FMEDP float dBlendModeFogFactor = 1.0;
22

33
vec3 addFog(vec3 color) {
44
return color;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Schlick's approximation
2-
uniform MEDP float material_fresnelFactor; // unused
2+
uniform LMEDP float material_fresnelFactor; // unused
33

44
void getFresnel() {
5-
MEDP float fresnel = 1.0 - max(dot(dNormalW, dViewDirW), 0.0);
6-
MEDP float fresnel2 = fresnel * fresnel;
5+
LMEDP float fresnel = 1.0 - max(dot(dNormalW, dViewDirW), 0.0);
6+
LMEDP float fresnel2 = fresnel * fresnel;
77
fresnel *= fresnel2 * fresnel2;
88
fresnel *= dGlossiness * dGlossiness;
99
dSpecularity = dSpecularity + (1.0 - dSpecularity) * fresnel;

0 commit comments

Comments
 (0)