Code Monkey home page Code Monkey logo

Comments (5)

asny avatar asny commented on August 11, 2024

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?

from three-d.

briteroses avatar briteroses commented on August 11, 2024

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:

let mut bot_model_mesh: CpuMesh = raw_assets.deserialize("smallbot.obj").unwrap();
let mat4_from_pose: Matrix4<f32> = isometry_to_matrix(pose);
bot_model_mesh.transform(&mat4_from_pose).unwrap();
Rc::new(Gm::new(
    Mesh::new(context, &bot_model_mesh),
    PhysicalMaterial::default(),
))

and the error occurs on the frame_input render call,

frame_input.screen().render(camera, vec![bot_model], &[]);

from three-d.

asny avatar asny commented on August 11, 2024

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 bot_model_mesh.compute_normals().

from three-d.

rcywongaa avatar rcywongaa commented on August 11, 2024

three-d = "0.16.3"
Btw, this problem is reproducible with the shapes example by removing the lights on
https://github.com/asny/three-d/blob/master/examples/shapes/src/main.rs#L115 (playground)
Or by changing one light to AmbientLight and removing the other light (playground)

Having both lights as AmbientLight triggers a different error

from three-d.

asny avatar asny commented on August 11, 2024

@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.

from three-d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.