Comments (5)
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.
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.
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.
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.
@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)
- Add Shadow Catcher material support HOT 3
- glow, egui, and three-d dependency issue, mostly just needs a coordinated release HOT 1
- Uncaught runtime errors
- "You forgot to call destroy() on the egui glow painter. Resources will leak!" HOT 3
- Centering the camera on a model HOT 4
- `Camera` is trying to do too much - not compatible with custom camera implementations HOT 2
- Headless on windows HOT 2
- Weird stretching when rendering finite terrain HOT 2
- Converting between ui space and screen space? HOT 2
- How to control occlusion for 2D shapes? HOT 7
- InstancedMesh but with different material for each instance HOT 5
- Run three-d from egui app HOT 1
- Camera position_at_pixel() is missing window_scale_factor on HiDPI displays HOT 2
- Any plans to support custom buffer element types for interleaved data? HOT 1
- ColorMaterial Transparency breaks when renderered at negative Y position? HOT 2
- Upgrading V0.16.1 => V0.17 breaks loading a 1x1 pixel white texture HOT 2
- Some kind of blend/alpha issue with some models (inside-out models) HOT 1
- Trying to use PhysicalMaterial without lights crashes the program HOT 1
- Warning when running on the browser / crash in debug mode HOT 3
- InstancedMesh Individual Animations HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from three-d.