mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.38k stars 35.35k forks source link

Playground: adding a texture and using it as "normal" slot input results in exceptions #29650

Open hybridherbst opened 1 week ago

hybridherbst commented 1 week ago

Description

Adding a texture and using it as "normal" slot input results in exceptions. I'm not sure if I'm expected to swizzle it down to three components – but I think at least there shouldn't be renderloop-breaking exceptions when not doing that.

Reproduction steps

  1. Drop a texture (any texture) into https://threejs.org/playground
  2. Add a "Texture" node
  3. Connect the output of "Texture" to the "normal" slot
  4. Note exceptions in console

EDIT: Looks like as a workaround, a UV node can be added – in other node-based shader editors UV0 is implicit, so I didn't expect that.

image

Code

-

Live example

https://threejs.org/playground/

Screenshots

image

Version

latest

Device

Desktop

Browser

Chrome

OS

Windows, MacOS

hybridherbst commented 1 week ago

Fyi, #29652 does not close this issue, I just happened to run into this one here while looking at normal maps. I think it should be reopened!