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

WebGPURenderer: AttributeNode: Vertex attribute "normal" not found on geometry #28939

Closed
WestLangley opened this issue Jul 22, 2024 · 3 comments · Fixed by #29137
Closed

WebGPURenderer: AttributeNode: Vertex attribute "normal" not found on geometry #28939

WestLangley opened this issue Jul 22, 2024 · 3 comments · Fixed by #29137
Labels
Milestone

Comments

@WestLangley
Copy link
Collaborator

Description

Cleaning up the examples a bit...

The following examples display the warning:

AttributeNode: Vertex attribute "normal" not found on geometry.

Due to use of QuadMesh

- webgpu_rtt.html
- webgpu_multisampled_renderbuffers.html
- webgpu_multiple_rendertargets_readback.html
- webgpu_depth_texture.html

Due to Horse.glb

- webgpu_instancing_morph.html

Due to RectAreaLightHelper

- webgpu_lights_rectarealight.html

Perhaps the warning can be suppressed?

Reproduction steps

see example list above

Code

n/a

Live example

see example list above

Screenshots

No response

Version

r167 dev

Device

Desktop

Browser

Chrome

OS

MacOS

@Spiri0
Copy link
Contributor

Spiri0 commented Jul 23, 2024

I know that when I create buffer geometries myself and don't create an attribute for "normal" because I create normal vectors myself in the shader.
Since this is just a warning that never affected my app, I didn't see it as critical.

So the reason for this warning is that the corresponding geometry does not contain a “normal” attribute.

I then simply solved this by creating a “normal” attribute for my custom geometries. However, not because it was necessary but in order not to confuse other users who download my repository because of the warning in the console.

A clean solution would be to check whether the attribute "normal" is present in the geometry. If not, it should not be used.
As I understand it, the QuadMesh is mainly used for post-processing and a normal vector is not necessary for the QuadMesh, which serves as a ScreenQuad. I suspect that's why no "normal" attribute was created for the QuadMesh.

@WestLangley WestLangley added this to the r168 milestone Jul 25, 2024
@WestLangley
Copy link
Collaborator Author

AttributeNode: Vertex attribute "normal" not found on geometry.

Why is the renderer expecting a normal to be present?

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 31, 2024

There is an open issue with MeshBasicNodeMaterial which is responsible for most of the warnings.

NodeMaterial.normals controls whether the material process geometry normals or not. It could be set to false for MeshBasicNodeMaterial however this breaks cube map sampling. The current workaround is to not change normals to false but overwrite the transformedNormalView node instead, see #28839. However, the current code requires to have normals present in the geometry which is not correct. Ideally, we only define transformedNormalView if an environment map is in place.

The one I'm not sure about is webgpu_instancing_morph. It uses MeshStandardNodeMaterial with flat shading and that should actually overwrite transformedNormalView and thus ignoring geometry data. It looks wrong when the material still complains about missing geometry data.

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

Successfully merging a pull request may close this issue.

3 participants