You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i've got customer models of furniture objects that are buggy in their uv coordinates. This is of course less an issue of threejs, more an issue of the models. Anyway, i'd like to check out if there is a way to handle it with the shader. The Material is MeshPhongMaterial and the problem occurs only if a normalmap is activated and the uv coordinates don't represent triangles but lines.
The code responsible for the normalmapping is found in perturbNormal2Arb. I think the problem might be the dFdy/dFdy of vUv, where the errourneous uv coodrinates deliver vec2(0, 0). However, if i add
st0.xy += 0.0000001;
the artifacts are gone.
I don't know if it really is an issue of threejs, but maybe it is a solution for others to come...
The tangential space is derived at run time from the UV map. When there is a zero gradient (one value is always the same), the resulting space collapses into singularity. If you can't use a proper UV map, you can use a custom shader that only considers .s ("U") or .t ("V") which then results in missing S or T in the above code. You can set it to an axis orthogonal to the other and N using a normalized cross product.
Description of the problem
Hello,
i've got customer models of furniture objects that are buggy in their uv coordinates. This is of course less an issue of threejs, more an issue of the models. Anyway, i'd like to check out if there is a way to handle it with the shader. The Material is MeshPhongMaterial and the problem occurs only if a normalmap is activated and the uv coordinates don't represent triangles but lines.
The code responsible for the normalmapping is found in perturbNormal2Arb. I think the problem might be the dFdy/dFdy of vUv, where the errourneous uv coodrinates deliver vec2(0, 0). However, if i add
st0.xy += 0.0000001;
the artifacts are gone.
I don't know if it really is an issue of threejs, but maybe it is a solution for others to come...
Three.js version
Browser
OS
The text was updated successfully, but these errors were encountered: