Skip to content
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

Update normal map with viewer.setMaterial doesn't work if the model doesn't have a normal map in the gltf file. #90

Open
aseriousname opened this issue Aug 16, 2018 · 1 comment

Comments

@aseriousname
Copy link

i was converting FBX with fbx2gltf.py and often it doesnt find the textures to put in the .gtlf file.

This isnt a problem for me as I plan to have the user selecting what textures they want to see on the model.

However using clay_viewer.js if the model doesn't have a normal-map in the gltf file when it is loaded you can never change the normal map with viewer.setMaterial. All the other textures (diffuse, emissive, MR etc) will change but normal will not be shown.

If i edit the .gltf and manually add any image as a normal map then when i call viewer.SetMaterial then can successfully change normal maps. So right now I just edit and add a tiny 32x32 png as a normal map then at runtime i can update the normal map to the one i want.

I guess this is because the feature of displaying the normal isn't implemented if it doesn't have a normal map when originally loaded??

Anyway my workaround isn't very complicated but I thought I would mention this as it was tripping me up for a while. Or maybe there's something else i need to call on the viewer to turn normal maps on after load?

@aseriousname
Copy link
Author

I'm sorry i meant to put this in the clay-viewer Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant