Skip to content

Commit 164b23f

Browse files
authored
Fixed anisotropy zero strength (#27164)
* fix ssl error * fixed divide by zero * updated screenshot * fix screenshot
1 parent 2564e4f commit 164b23f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
38 Bytes
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"test": "npm run lint && npm run test-unit",
4545
"build": "rollup -c utils/build/rollup.config.js",
4646
"build-module": "rollup -c utils/build/rollup.config.js --configOnlyModule",
47-
"dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080 --ssl\"",
47+
"dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080\"",
4848
"lint-core": "eslint src",
4949
"lint-addons": "eslint examples/jsm --ext .js --ignore-pattern libs --ignore-pattern ifc",
5050
"lint-examples": "eslint examples --ext .html",

src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,13 @@ material.roughness = min( material.roughness, 1.0 );
133133
#endif
134134
135135
material.anisotropy = length( anisotropyV );
136-
anisotropyV /= material.anisotropy;
137-
material.anisotropy = saturate( material.anisotropy );
136+
137+
if( material.anisotropy == 0.0 ) {
138+
anisotropyV = vec2( 1.0, 0.0 );
139+
} else {
140+
anisotropyV /= material.anisotropy;
141+
material.anisotropy = saturate( material.anisotropy );
142+
}
138143
139144
// Roughness along the anisotropy bitangent is the material roughness, while the tangent roughness increases with anisotropy.
140145
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );

0 commit comments

Comments
 (0)