#Replacing the materials of a gltf asset

10 messages · Page 1 of 1 (latest)

mighty vector
#

Hi all ! I'm having fun experimenting with bevy. I'm trying to get my entire scene cel shaded - afaik I have to replace all of the standard materials by my own. is there a way to specify how to create materials when importing gltf assets ? or should I just keep replacing them after the import ? thanks !

mighty vector
#

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...
errant blaze
#

Ooooh wow you can do that

mighty vector
#

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

errant blaze
#

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.

mighty vector
#

I'll remember scene-hook, might come in handy too. thanks !

smoky mirage
#

Ultimately I think this is a bit hackier than I'd like 🤔