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

Bundle multimaterial not updated correctly #30701

Open
Makio64 opened this issue Mar 10, 2025 · 1 comment
Open

Bundle multimaterial not updated correctly #30701

Makio64 opened this issue Mar 10, 2025 · 1 comment

Comments

@Makio64
Copy link
Contributor

Makio64 commented Mar 10, 2025

Description

Not sure its a bug or if it's limited by the api but in a bundle static if i update materials of the meshs inside only the first material is updated.

it does work if i call bundle.needsUpdate or if bundle.static = false

Reproduction steps

  1. create a bundle and add multiple mesh with differents material
  2. update opacity / color of the materials
  3. only first one is updated

Code

    let group = new THREE.BundleGroup()
    // mesh
    for(let i=0; i<10; i++){
      
      // material
      const material = new THREE.MeshBasicMaterial( {
        color: new THREE.Color(THREE.MathUtils.randInt(0,0xffffff)), 
        transparent: true,
        opacity:Math.random(),
        depthWrite:false
      } );
      
      
      const mesh = new THREE.Mesh( geometry, material );
      
      mesh.position.set(
        -5 + i,
        0,
        0
      )
      group.add( mesh )
      setInterval(()=>{
        material.opacity = Math.random()
      	//group.needsUpdate = true
      }, 100 + Math.random()*500)
    }
    //group.needsUpdate = true
    group.static = true
    scene.add( group );

Live example

https://jsfiddle.net/8z5qb9xs/15/

Screenshots

No response

Version

r174 dev

Device

No response

Browser

No response

OS

No response

@Makio64
Copy link
Contributor Author

Makio64 commented Mar 10, 2025

Note : Maybe in the renderBundle performance example dynamic options should be rename as static, as its the name of the property ?

Note 2 : It's a suggestions but add a little button ? over the one to see the code source< > with short explaination of the examples would be great to understand whats happening. ( can be another issue )

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

1 participant