Way to exclude objects from "opaqueSceneTexture"?

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:

Any ideas?

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

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

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:

You can remove the block from the opaque texture:

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.

Mmmm, it still appears in the refraction:

Here’s what I see on my end:

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

OK, that line change makes my happy :slight_smile:

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.

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

Thank you very much.