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
}

0 commit comments

Comments
 (0)