mirror of
https://github.com/bevyengine/bevy
synced 2024-12-04 02:19:15 +00:00
Scale thickness with mesh transform (using average of X, Y and Z scales)
This commit is contained in:
parent
5d7f61911e
commit
13b1e596e9
1 changed files with 1 additions and 0 deletions
|
@ -99,6 +99,7 @@ fn fragment(in: FragmentInput) -> @location(0) vec4<f32> {
|
|||
if ((material.flags & STANDARD_MATERIAL_FLAGS_THICKNESS_TEXTURE_BIT) != 0u) {
|
||||
thickness *= textureSample(thickness_texture, thickness_sampler, uv).g;
|
||||
}
|
||||
thickness *= (length(mesh.model[0].xyz) + length(mesh.model[1].xyz) + length(mesh.model[2].xyz)) / 3.0;
|
||||
pbr_input.material.thickness = thickness;
|
||||
|
||||
var diffuse_transmission = material.diffuse_transmission;
|
||||
|
|
Loading…
Reference in a new issue