Open Mugen87 opened 2 weeks ago
According to the WGSL spec, derivative functions can only be used in a fragment shader stage.
https://www.w3.org/TR/WGSL/#derivative-builtin-functions
So it seems the TSL must avoid to use dFdx()
and dFdy()
in code assigned to vertex node.
Description
While working on
ShadowMapViewer
I have noticed that flat shaded objects that receive shadow produce a WGSL error which is logged in the browser console as a warning.The screen also gets white so nothing is rendered.
Commenting out
mesh.receiveShadow = true;
or disable flat shading fixes the issue.Reproduction steps
Live example
Version
r168
Device
Desktop, Mobile, Headset
Browser
Chrome
OS
MacOS