Skip to content

Allow cull_mode to be reflected so crates like bevy_materialize can set it #20249

@ethereumdegen

Description

@ethereumdegen

What problem does this solve or what need does it fill?

I am using bevy_materialize and i have trees whose leaves have a material defined in Toml.

type = "DoodadMaterial"

[material.base]  
base_color_texture="/textures/material_overrides/nature/MeadowFoliageAtlas.png" 
base_color = { LinearRgba = [0.33,0.55,0.22,1.0] }
perceptual_roughness= 0.9 
uv_transform = {  texture_subset_dimensions = { offset = [0,0], dimensions = [512, 512], base_texture_dimensions = [2048,2048] } }
double_sided= true
alpha_mode=  {Mask = 0.5 }        

[material.extension.custom_uniforms]
uv_input_scale= 1.0
 

At this point, the leaves have a cull_mode of BACK which absolutely sucks because it means my leaves dont show two-sided properly.

What solution would you like?

#[reflect(ignore, clone)]
pub cull_mode: Option<Face>,

Please make cull_mode not be ignored by reflect, allow it to be serialized and deserialized. !
Alternatively, make cull_mode be forced to NONE when double_sided is true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-FeatureA new feature, making something new possibleS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedX-UncontroversialThis work is generally agreed upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions