-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Panic when normalMatrix uniform is sent to the shader but not used #404
Comments
Thanks for reporting 🙏 can you try to update to version 0.16 and see if it's still a problem? I guess the mesh you are loading doesn't contain normals? |
Thanks for the tip! My project currently uses 0.15.0, and it looks like I can't update three-d to 0.16.1 for my project, as that breaks too many things in my project. For the mesh, I'm loading from a .obj and .mtl that I export out of Blender. This is the code I'm using to load an obj mesh:
and the error occurs on the frame_input render call,
|
It's not a great error message, but the problem is probably that your mesh doesn't contain any normals, at least please check that! The PhysicalMaterial requires normals, so you need to have them on the mesh. You can compute them by |
Having both lights as |
@rcywongaa I don't get that error when removing the lights on the shapes example, my guess is that you are on Linux or Chrome OS? The shader compilers are different depending on the OS. I've tried fixing this particular error in 17b1f13 but since I can't reproduce, it's difficult to know if I solved both of your problems (they might be different problems). At least it should work on Linux/Chrome OS now. |
Hi, I want to load an object with the three_d_asset load utility and display it in my 3d environment. I'm loading the object as a mesh so I can translate and rotate it before adding it to a Gm, and all of this works, but when I call frame_input().screen().render() on it, I get the error
thread 'main' panicked at 'the uniform normalMatrix is sent to the shader but not defined or never used'
I haven't found a way around this order yet, and an not sure what it means. For reference, the version of three_d and three_d_asset I am using is
three-d = "0.15.0"
three-d-asset = {version="0.5.0", features=["obj"]}
Would greatly appreciate any pointers here!
The text was updated successfully, but these errors were encountered: