# Is it possible to set varying opacity for objects inside a InstancedMesh (filled with BoxBufferGeometry + MeshPongMaterial cubes)

**URL:** <https://discourse.threejs.org/t/is-it-possible-to-set-varying-opacity-for-objects-inside-a-instancedmesh-filled-with-boxbuffergeometry-meshpongmaterial-cubes/19181>\
**Category:** Questions\
**Tags:** opacity, materials, instanced-mesh\
**Created:** [September 28, 2020, 9:24am UTC](https://discourse.threejs.org/t/is-it-possible-to-set-varying-opacity-for-objects-inside-a-instancedmesh-filled-with-boxbuffergeometry-meshpongmaterial-cubes/19181 "2020-09-28T09:24:15Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Gangula](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/gangula/32/17731_2.png) [@Gangula](https://discourse.threejs.org/u/Gangula)\
**Post date:** [November 4, 2024, 10:12am UTC](https://discourse.threejs.org/t/is-it-possible-to-set-varying-opacity-for-objects-inside-a-instancedmesh-filled-with-boxbuffergeometry-meshpongmaterial-cubes/19181/10 "2024-11-04T10:12:27Z")

</div>

Combining links to related resources from multiple sources:

> It’s not possible, mainly because if that was allowed the first thing people bump into is that the order in which transparent objects get renderer is incorrect.
> 
> In order to render them correctly the instances will need to be reordered every time the camera moves.

- [Opacity for InstancedMesh - Questions - three.js forum](https://discourse.threejs.org/t/opacity-for-instancedmesh/42239)
- [Feature request: support InstancedMesh.setOpacityAt(index,color) · Issue #20431 · mrdoob/three.js](https://github.com/mrdoob/three.js/issues/20431)
- [BatchedMesh: add per-instance setOpacity by Kikedao · Pull Request #28151 · mrdoob/three.js](https://github.com/mrdoob/three.js/pull/28151)
- [add per-instance opacity by trusktr · Pull Request #35 · pailhead/three-instanced-mesh](https://github.com/pailhead/three-instanced-mesh/pull/35)
- [BatchedMesh set per-instance opacity - Questions - three.js forum](https://discourse.threejs.org/t/batchedmesh-set-per-instance-opacity/64170)
- [Opacity attribute for instanced geometry? - Questions - three.js forum](https://discourse.threejs.org/t/opacity-attribute-for-instanced-geometry/25958)
- [lume/three-instanced-mesh: A better InstancedMesh class for Three.js](https://github.com/lume/three-instanced-mesh)
- [three.js - Transparency within instanced shapes - Stack Overflow](https://stackoverflow.com/questions/43502415/transparency-within-instanced-shapes)

---

_[View the full topic](https://discourse.threejs.org/t/is-it-possible-to-set-varying-opacity-for-objects-inside-a-instancedmesh-filled-with-boxbuffergeometry-meshpongmaterial-cubes/19181)._
