CesiumGS/obj2gltf

minFilter 9986 vs 9987 - Moiré pattern on model viewer

lanxinger opened this issue · 4 comments

Hi,

We have been a long time user and have been using google's model viewer implementation which relies on the threeJS library.

We recently found an issue with the model textures that they appear to show a moiré pattern (upon closer inspection) as has also been discussed on this model viewer issue:
google/model-viewer#936

I have then gone ahead and edited the glb files manually and changed the minFilter value to the proposed 9987 and the issue disappeared.

How can we create a .glb file that uses minFilter 9987 instead of 9986.

Has anyone run into this issue before?

@lanxinger I think NEAREST_MIPMAP_LINEAR (9986) is a good default given the runtime/quality trade-off. Though I'm not opposed to removing the defaults and letting the runtime engine decide. Would that work for model-viewer?

@lilleyse thank you for your reply.

yes I think that would work. I checked the gltf export from blender and they are not using the minFilter at all and the exported file doesn’t cause moire issues. If people would still need it would it be a good option to have a flag that people can pass via CLI?

@lilleyse according to one of the Google model viewer developers:

"Yes, removing the default would be ideal. Technically that's not letting
the engine decide, as the glTF spec specifies which default the engines
must use. However, they chose that default with input from the engines, as
we know anything other than LINEAR_MIPMAP_LINEAR results in significant
rendering artifacts. The performance difference from this is small since it
is handled in hardware anyway.

Thanks,"

google/model-viewer#936 (comment)

@lanxinger opened a PR here: #240