With volume extension, some objects show behind glass, other don't

Hi there,

I’m trying to create a glass aquarium using the volume extension in order to create a more convincing refraction effect.

My problem is that although one test card I’ve put into the glass shows correctly through the refraction, another object next to it doesn’t.

I’m sending the glTF scene just in case you can check it.

Thanks in advance for your help.

Prueba_Acuario.zip (4.5 MB)

The sponge material has the volume / transmission extensions applied to it. You should remove these extensions if you want to see the sponge in the refraction texture.

It is quite strange.

If I uncheck the refraction attribute and then just change its material to the “Test_material” used in the scene and then reassign the original sponge material and reactivate the refraction, then it works. Super wierd.

Anyway, are you telling me I can’t have TWO different materials with volume extension in the same scene?

Because my goal was to have the glass aquarium AND SSS (AKA Subsurface Scattering) sponges in the same scene. I need to put algae too, which also have translucent materials.

You can have multiple materials with transmission enabled in the same scene, but transmissive meshes won’t refract in other transmissive materials.

Transmission is implemented by rendering all non transmissive objects in a texture T, and this texture is used as the refraction texture for all transmissive materials. We would need to render a different T texture for each transmissive mesh if we wanted other transmissive objects to be visible in the refraction texture of a given transmissive mesh (we would also have ordering problems when generating this texture). It would be too taxing on performance, that’s why we generate a single texture as a compromise.

Translucent/transparent materials are ok, they are not transmissive. They will be rendered in T as part as the non transmissive materials.

In your case, only the aquarium container will be transmissive.

With translucency you mean the diffuse transmission extension?
If so, I’ll have the possibility to render several objects with that kind of material or is there any similar limitation?

No, transmissive materials are those with the KHR_material_transmission extension. Materials can be transparent (opacity / alpha < 1) without being transmissive.

The restriction with transmissive materials is that no transmissive meshes will be visible in a refraction texture of a transmissive material, because they are all excluded from the generation of this texture.

My brain is exploding right now LOL

To put it simply: you won’t see any transmissive meshes in the refraction texture of a transmissive material (mesh) :slight_smile: