Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math Node 'MOD' WebGPU Error #27516

Closed
illestrater opened this issue Jan 6, 2024 · 0 comments · Fixed by #27517
Closed

Math Node 'MOD' WebGPU Error #27516

illestrater opened this issue Jan 6, 2024 · 0 comments · Fixed by #27517

Comments

@illestrater
Copy link

illestrater commented Jan 6, 2024

Description

Math Node 'MOD' produces error in WebGPU when input node is not a float, but works fine in WebGL

Reproduction steps

  1. Create a 'mod' math node
  2. Provide a TextureNode, rbga (or any other vector) as aNode
  3. Provide a TimerNode (or any other float) as bNode
  4. Attach mod node to material node's colorNode
  5. WebGL runs fine, WebGPU throws error

Code

1 error(s) generated while compiling the shader:
:112:30 error: type mismatch for argument 1 in call to 'threejs_mod', expected 'f32', got 'vec4<f32>'
  DiffuseColor = threejs_mod( nodeVar2, NodeUniforms.nodeUniform2 );
                              ^^^^^^^^

Live example

Working WebGL with nodes: https://codesandbox.io/p/sandbox/three-js-webgpu-directional-light-forked-48y9yt?file=%2Fsrc%2Findex.mjs%3A40%2C17

The above will break using WebGPU renderer.

Screenshots

No response

Version

r160

Device

Desktop

Browser

Chrome

OS

MacOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants