mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-06 18:42:19 +00:00
e2637115df
The shadow pass draws the dense copy and displaces it like the 3D view, so a displaced surface shadows itself instead of being shadowed as if it were still smooth. - shaders/displace.wgsl: displace_by_height, shared by mesh.wgsl and shadow.wgsl - the shadow pipeline takes the set bind group (height and sampler) and a displacement vec4 (on, world units per unit of height with the height strength, vertex spacing) - while it displaces, the cached shadow map is re-rendered when the set textures change - test: with flat height, displaced shadows match the plain mesh's