# Way to exclude objects from "opaqueSceneTexture"?

**URL:** <https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530>\
**Category:** Questions\
**Tags:** material, pbr, glass\
**Created:** [May 25, 2026, 9:48am UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530 "2026-05-25T09:48:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![joie](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joie/32/24608_2.png) [@joie](https://forum.babylonjs.com/u/joie)\
**Post date:** [May 25, 2026, 9:48am UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/1 "2026-05-25T09:48:04Z")

</div>

Hi there,

We are doing a kind of giant aquarium, and tested the volume refraction for the glass, and it looks super cool.

But, since the aquarium is huge, we thought to add some structure in order to sell its size better.

The problem is that the structure also shows in the refraction of the glass, is it looks wierd and must be avoided.

My first thought it to ask if is there a way to exclude objects from being shown in the refraction texture (opaqueSceneTexture).

Os is there any way to have the refraction object inside another object?

All examples I’ve seen out there are almost the same: objects being refracted by another glass container, but no the other way around.

Here is the scene we are working on:

 ![imagen](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/2/e24db24c2e82153d27c01eab5791a36524474dd6.jpeg)

Any ideas?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [May 25, 2026, 11:01am UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/2 "2026-05-25T11:01:27Z")

</div>

You can remove an object from the opaque texture this way:

> **[Babylon.js Playground](https://playground.babylonjs.com/#SYQW69%231371)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

In this PG, I removed the mosquito from the list of opaque objects, so it doesn’t appear in the amber anymore.

---

<div class="post-metadata">

**Author:** ![joie](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joie/32/24608_2.png) [@joie](https://forum.babylonjs.com/u/joie)\
**Post date:** [May 25, 2026, 11:17am UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/3 "2026-05-25T11:17:10Z")

</div>

I see your point.

But that doesn’t solve the problem. OK, the mosquito is gone, but I need that to happen for an external object, not inside.

In order to illustrate this, in your playground, if you put the camera close to the “bloc.000” object, you will see it is refracted also through the amber, even when that object is outside the amber:

 ![imagen](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/1/b1b9d0ef279f3ca32c0cdabe24aad5a66daf816f.jpeg)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [May 25, 2026, 11:31am UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/4 "2026-05-25T11:31:08Z")

</div>

You can remove the block from the opaque texture:

> **[Babylon.js Playground](https://playground.babylonjs.com/#SYQW69%231372)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

Note that I had to wait for a few frames before removing the block from `opaqueTexture.renderList` to let the system time to add the objects loaded from the 2nd glTF file to the list.

---

<div class="post-metadata">

**Author:** ![joie](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joie/32/24608_2.png) [@joie](https://forum.babylonjs.com/u/joie)\
**Post date:** [May 25, 2026, 12:44pm UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/5 "2026-05-25T12:44:49Z")

</div>

Mmmm, it still appears in the refraction:

 ![imagen](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/8/682bb78bc2c6c9f3a2d2ac3469a49733283da643.jpeg)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [May 25, 2026, 1:42pm UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/6 "2026-05-25T13:42:38Z")

</div>

Here’s what I see on my end:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/5/a5b30ad7fdb62f7ecd5a6359d614e9d566565c88.jpeg)

Try to increase the timeout line 33 (try 1000).

---

<div class="post-metadata">

**Author:** ![joie](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joie/32/24608_2.png) [@joie](https://forum.babylonjs.com/u/joie)\
**Post date:** [May 26, 2026, 3:40am UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/7 "2026-05-26T03:40:30Z")

</div>

OK, that line change makes my happy 🙂

That fixes my problem, although I assume that can only be done by coding and can’t be implemented in the glTF file itself, can it?

Thanks for your appreciated help, as always.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [May 26, 2026, 8:18am UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/8 "2026-05-26T08:18:13Z")

</div>

> [@joie](#):
>
> That fixes my problem, although I assume that can only be done by coding and can’t be implemented in the glTF file itself, can it?

Indeed, it can only be done by code, as it’s quite specific.

---

<div class="post-metadata">

**Author:** ![joie](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joie/32/24608_2.png) [@joie](https://forum.babylonjs.com/u/joie)\
**Post date:** [May 27, 2026, 4:27am UTC](https://forum.babylonjs.com/t/way-to-exclude-objects-from-opaquescenetexture/63530/9 "2026-05-27T04:27:38Z")

</div>

Thank you very much.
