Add note about average being calculated to scale thickness
This commit is contained in:
parent
a48a3132c3
commit
cbafe430ef
@ -109,6 +109,8 @@ fn fragment(
|
||||
thickness *= textureSample(pbr_bindings::thickness_texture, pbr_bindings::thickness_sampler, uv).g;
|
||||
}
|
||||
#endif
|
||||
// scale the thickness by the average length of basis vectors for the transform matrix
|
||||
// this is a rough way to approximate the average “scale” applied to the mesh as a single scalar
|
||||
thickness *= (length(mesh.model[0].xyz) + length(mesh.model[1].xyz) + length(mesh.model[2].xyz)) / 3.0;
|
||||
pbr_input.material.thickness = thickness;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user