#Replacing the materials of a gltf asset
10 messages · Page 1 of 1 (latest)
I also wonder if I can't just hijack PBR_LIGHTING_HANDLE to override the pbr lighting
ooooh I can:
let s = shaders
.get_mut(&bevy::pbr::PBR_LIGHTING_HANDLE.typed())
.unwrap();
*s = new_shader;```
now if I can change that include_str to a proper async load...
Ooooh wow you can do that
Even with a proper load call, It breaks hot reloading as (I think?) the path ain't linked to the handle
I did hack a press r to reload button however
I was going to suggest using bevy-scene-hook (https://github.com/nicopap/bevy-scene-hook, just instead of using entity.get::<Name>(), use entity.contains::<StandardMaterial>() ) but your approach seems actually more reasonable.
I'll remember scene-hook, might come in handy too. thanks !
@spark owl check this out!
Ultimately I think this is a bit hackier than I'd like 🤔