Skip to content

[Enhancement] onBeforeCompile may break material's .clone() method #14009

@pailhead

Description

@pailhead
Description of the problem

onBeforeCompile seems to be ignored when cloning materials:

https://codepen.io/anon/pen/yjPLrJ?editors=1010

Expected result is equal amount of yellow and red cubes.

Proposing to either:

  1. consider Material.onBeforeCompile when cloning
  2. document that there should be no cloning happening after setting this callback
  3. document that .clone() is non deterministic, it's going to be a different clone depending on the presence of onBeforeCompile
Three.js version
  • Dev
  • r92
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions