bevyengine / bevyengine/bevy

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

Open
#20,249 1 comment 0 reactions 0 assignees View on GitHub
A-Rendering C-Feature S-Needs-Design X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 15h
Merged PRs (30d)
168

Description

## 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,

```

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.

Contributor guide

Open the contributing guide

Research direction

Start by locating the material field declared as cull_mode: Option and inspect how its #[reflect(ignore, clone)] attribute affects reflection and serialization. Confirm that cull_mode can be serialized and deserialized for the TOML material configuration, and check the double_sided behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.