Skip to content

Commit

Permalink
Remove banding in PerformanceModel quality rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Apr 21, 2021
1 parent d48c20b commit 635b69f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ class TrianglesBatchingColorQualityRenderer {
}

if (lightsState.reflectionMaps.length > 0) {
src.push(" vec3 reflectVec = reflect(-geometry.viewEyeDir, geometry.viewNormal);");
src.push(" vec3 reflectVec = reflect(geometry.viewEyeDir, geometry.viewNormal);");
src.push(" reflectVec = inverseTransformDirection(reflectVec, viewMatrix);");
src.push(" float blinnExpFromRoughness = GGXRoughnessToBlinnExponent(material.specularRoughness);");
src.push(" vec3 radiance = getLightProbeIndirectRadiance(reflectVec, blinnExpFromRoughness, 8);");
Expand Down Expand Up @@ -718,7 +718,7 @@ class TrianglesBatchingColorQualityRenderer {
src.push("material.specularColor = mix(vec3(dielectricSpecular), diffuseColor, metallic);");

src.push("geometry.position = vViewPosition.xyz;");
src.push("geometry.viewNormal = -vViewNormal;");
src.push("geometry.viewNormal = -normalize(vViewNormal);");
src.push("geometry.viewEyeDir = normalize(vViewPosition.xyz);");

if (lightsState.lightMaps.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class TrianglesInstancingColorQualityRenderer {

src.push("vec4 modelNormal = vec4(octDecode(normal.xy), 0.0); ");
src.push("vec4 worldNormal = worldNormalMatrix * vec4(dot(modelNormal, modelNormalMatrixCol0), dot(modelNormal, modelNormalMatrixCol1), dot(modelNormal, modelNormalMatrixCol2), 0.0);");
src.push("vec3 viewNormal = normalize(vec4(viewNormalMatrix * worldNormal).xyz);");
src.push("vec3 viewNormal = vec4(viewNormalMatrix * worldNormal).xyz;");

src.push("vec4 clipPos = projMatrix * viewPosition;");
if (scene.logarithmicDepthBufferEnabled) {
Expand Down Expand Up @@ -698,7 +698,7 @@ class TrianglesInstancingColorQualityRenderer {
}

if (lightsState.reflectionMaps.length > 0) {
src.push(" vec3 reflectVec = reflect(-geometry.viewEyeDir, geometry.viewNormal);");
src.push(" vec3 reflectVec = reflect(geometry.viewEyeDir, geometry.viewNormal);");
src.push(" reflectVec = inverseTransformDirection(reflectVec, viewMatrix);");
src.push(" float blinnExpFromRoughness = GGXRoughnessToBlinnExponent(material.specularRoughness);");
src.push(" vec3 radiance = getLightProbeIndirectRadiance(reflectVec, blinnExpFromRoughness, 8);");
Expand Down Expand Up @@ -767,7 +767,7 @@ class TrianglesInstancingColorQualityRenderer {
src.push("material.specularColor = mix(vec3(dielectricSpecular), diffuseColor, metallic);");

src.push("geometry.position = vViewPosition.xyz;");
src.push("geometry.viewNormal = -vViewNormal;");
src.push("geometry.viewNormal = -normalize(vViewNormal);");
src.push("geometry.viewEyeDir = normalize(vViewPosition.xyz);");
if (lightsState.lightMaps.length > 0) {
src.push("geometry.worldNormal = normalize(vWorldNormal);");
Expand Down

0 comments on commit 635b69f

Please sign in to comment.