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

node material not working with shadowmap.enabled = true #25218

Closed
patricklx opened this issue Jan 2, 2023 · 2 comments
Closed

node material not working with shadowmap.enabled = true #25218

patricklx opened this issue Jan 2, 2023 · 2 comments
Milestone

Comments

@patricklx
Copy link

Description

it will cause an error when setting a uniform value specific to MeshDistanceMaterial: Cannot read properties of undefined (reading 'value') at https://github.com/mrdoob/three.js/blob/master/src/renderers/webgl/WebGLMaterials.js#L665

that is because the node builder overwrites it here: https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js#L96

which happens because of this: https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/webgl/nodes/WebGLNodes.js#L13

the fix is to just overwrite onBuild again for MeshDistanceMaterial.

THREE.MeshDistanceMaterial.prototype.onBuild = () => undefined;

or disabling shadowmap...

Reproduction steps

n/a

Code

n/a

Live example

n/a

Screenshots

No response

Version

145

Device

Desktop

Browser

Chrome

OS

Windows

@sunag
Copy link
Collaborator

sunag commented Jan 5, 2023

Hi @patricklx

Are you using a NodeMaterial in MeshDistanceMaterial?
I was in doubt how material.isNodeMaterial === true in WebGLNodes for MeshDistanceMaterial?

https://github.com/mrdoob/three.js/blob/master/examples/jsm/renderers/webgl/nodes/WebGLNodes.js#L13

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 21, 2024

Node material integration into WebGLRenderer has been removed with r164, see #28167.

So this issue can be closed.

@Mugen87 Mugen87 closed this as completed Jun 21, 2024
@Mugen87 Mugen87 added this to the r166 milestone Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants