bevyengine / bevyengine/bevy

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

未关闭
#20,249 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
A-Rendering C-Feature S-Needs-Design X-Uncontroversial
主要语言
Rust
星标
48.2k
派生
4.8k
平均合并
3 天 15 小时
30 天内合并 PR
168

描述

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

贡献指南

打开贡献指南

调研方向

首先定位声明为 cull_mode: Option 的材质字段,并检查其 #[reflect(ignore, clone)] 属性如何影响反射和序列化。确认 cull_mode 可以针对 TOML 材质配置进行序列化和反序列化,并检查 issue 中描述的 double_sided 行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
rust
领域
computer-graphics, game-dev
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。