#adding png with transparency to base colored material

4 messages · Page 1 of 1 (latest)

peak hawk
#

how can i simply add a png texture with transparency (e.g. a black arrow surrounded in transparency) to a base colored material? this doesn't work and i've iterated over the AlphaMode's and a few diff _texture fields and haven't been able to figure it out 🤔

let texture_handle = asset_server.load("arrow.png");
let material_handle = materials.add(StandardMaterial {
    base_color: Color::RED,
    base_color_texture: Some(texture_handle.clone()),
    alpha_mode: AlphaMode::Premultiplied,
    ..default()
});

i want the red base color to show through the png's transparency

edgy imp
#

When you specify both base_color and base_color_texture, the two values gte multiplied together.

#

You probably need a custom shader

peak hawk
#

thanks @edgy imp