xiaoiver / infinite-canvas-tutorial

A tutorial on infinite canvas
https://infinitecanvas.cc
97 stars 6 forks source link

smoothstep throw an error in WGSL #9

Closed xiaoiver closed 2 weeks ago

xiaoiver commented 2 weeks ago

When switching to WebGPU renderer, we will get the following error. It seems that our grids have something wrong.

Error while parsing WGSL: :158:25 error: smoothstep called with 'low' (1.0) not less than 'high' (0.0)
                alpha = smoothstep(1f, 0f, (length(_e266) - ((BASE_DOT_SIZE * _e268) / _e271)));
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 - While validating [ShaderModuleDescriptor]
 - While calling [Device].CreateShaderModule([ShaderModuleDescriptor]).

https://github.com/gpuweb/gpuweb/issues/4561