asny / three-d

2D/3D renderer - makes it simple to draw stuff across platforms (including web)
MIT License
1.24k stars 105 forks source link

Rendering Voxel Grid Gives Error #381

Closed ThundR67 closed 6 months ago

ThundR67 commented 11 months ago

Trying to visualize a voxel grid

let cpu_voxel_grid = CpuVoxelGrid::default();
let voxel_grid: VoxelGrid<IsosurfaceMaterial> = VoxelGrid::new(&context, &cpu_voxel_grid);

Giver error

the uniform metallic is sent to the shader but not defined or never used

asny commented 11 months ago

Thanks for reporting 👍 I finally had some time to look at it, unfortunately, I cannot reproduce it. It works on my OS and on web, so I guess it's due to some special optimisation done by your compiler (wouldn't be the first time). That means, it's very difficult for me to fix since it's difficult to guess why the compiler removes this line and I can't test it. Can I get you to try to rearrange the code until it works?

Also, for the record, what OS are you using?