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

r151 throws error when THREE-CustomShaderMaterial is based on materials that have a map #25742

Closed
hamzakubba opened this issue Mar 31, 2023 · 1 comment

Comments

@hamzakubba
Copy link
Contributor

hamzakubba commented Mar 31, 2023

Description

Reference issue: FarazzShaikh/THREE-CustomShaderMaterial#35
Because #define USE_UV no longer happens (#25740), this code https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js#L4 never happens and vUv is now not defined. Any shaders or logic that previously relied on it will now break, e.g: https://github.com/FarazzShaikh/THREE-CustomShaderMaterial/blob/main/package/src/shaders.ts#L26

Reproduction steps

  1. Create base material that has a texture specified as its map
  2. Create a CustomShaderMaterial using that material as the base material
  3. Above works on 0.150.x, breaks on 0.151.x

Code

// roughly:
const material = new MeshStandardMaterial({ map: texture });
const extendedMaterial = new CustomShaderMaterial({ baseMaterial: material });

Live example

Screenshots

No response

Version

r151

Device

No response

Browser

No response

OS

No response

@hamzakubba hamzakubba changed the title 0.151.0 causes THREE-CustomShaderMaterial when based on materials that have a map r151 throws error when THREE-CustomShaderMaterial is based on materials that have a map Mar 31, 2023
@FarazzShaikh
Copy link
Contributor

FarazzShaikh commented Mar 31, 2023

I fixed it in CSM 5.3.4, vUv was replaced by vMapUv in <map_fragment>. Please close

@Mugen87 Mugen87 closed this as completed Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants