New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird artifacts with MeshPhysicalMaterial on the sphere primitive when ANISOTROPY > 0 #28341
Comments
I think the THREE.MeshPhysicalMaterial doesn't have a phong, but I'm not sure. |
I am not sure what you mean by not having a phong. I forgot to mention that I see these artifacts on the sphere but not on the cylinder, which is also curved (and I was pretty surprised) |
I've now made myself a little smarter and yes, the MeshPhysicalMaterial has phong and usually looks very smooth. I've now made a CodePen myself with r164 and used something from the three.js example about physicalMaterial. https://codepen.io/Spiri0/pen/VwOYXXo This looks nice and smooth until I set the anisotropy value from 0 to a number. It's the same with r160. I admit I don't know why that is. One of the developers will certainly know that |
Thanks a lot for testing it out too! I hope someone knows what's going on and will help :) |
It must be related to the anisotropy code, since even if I modify this code in WebGLMaterials.js: if ( material.anisotropy > 0 ) {
uniforms.anisotropyVector.value.set( material.anisotropy * Math.cos( material.anisotropyRotation ), material.anisotropy * Math.sin( material.anisotropyRotation ) );
if ( material.anisotropyMap ) {
uniforms.anisotropyMap.value = material.anisotropyMap;
refreshTransformUniform( material.anisotropyMap, uniforms.anisotropyMapTransform );
}
} and I comment |
Duplicate of #27440 anisotropy requires tangents, and if the geometry does not have them, there are other conditions. See the glTF spec. Add this: geometry.computeTangents(); |
Ah, that's it thanks WestLangley. I added the tangent calculation to the CodePen example and it looks clean. |
Thanks a lot @WestLangley !! Makes sense :) |
Description
If I apply a MeshPhysicalMaterial to a sphere I get weird reflections for certain values of specular, roughness, metallic, when the anisotropy is > 0.
I pasted an example below where you can see these reflections are very smooth on the cube and the quad (floor) but on the sphere they look as if I am using flat shading (which I am not).
In the example I am using:
I see these "artifacts" only when the anisotropy is > 0
Does anyone have any idea why I get this only on the sphere and what is it caused by?
Reproduction steps
Use the html code below as the example
Code
Live example
Screenshots
Version
r164
Device
Desktop
Browser
Chrome
OS
MacOS
The text was updated successfully, but these errors were encountered: