@bghgary While I’m still fairly new to this, my current understanding is that to represent a projected material, we need to use a renderTargetTexture
that converts the entire screen into a texture. We then create a reflection texture from this and apply it to the projected material. This seems to be the standard approach I’ve observed in all the playground samples I’ve referenced. I’ve also come to understand that reflection probes are tools designed for creating mirror effects.
Here are the results after several adjustments.
While some effects were removed, the internal components have finally begun to be visible.
My target material is opaque glass
. Here’s the current status:
- Have the elements behind the glass been made opaque by applying a blur process to the reflection texture? Yes.
- Is the curvature of the glass (internal, adjusted alpha values) visible? Yes.
- Is the curvature of the glass within itself also blurred? No.
These are the references I’ve used.
- Babylon.js - MosquitoInAmber.gltf (babylonjs.com)
This piece is realistic, but the backside is not rendered. - According to
PatrickRyan
on the Babylon forum, the options for creating glass effects are as follows:
- Creating realistic glass is impossible.
- It’s more cost-effective to create slightly non-realistic glass, which is something only developers might fully understand.
- Alternatively, one must resort to using tricks.
(form blender)
To create internal refractions, I attempted to use a trick involving a dummy element.
This method involves overlapping two elements, where the dummy element is exposed only to the renderTargetTexture
and not displayed on the screen. Unfortunately, this approach did not work as intended.
dummy.layerMask = 0x10000000;
camera.layerMask = 0x0FFFFFFF;
renderTargetTexture.renderList.push(dummy);
The red color showed the internal light refraction I was aiming for, but the yellow color revealed the dummy edges due to light refraction, creating an unintended effect. This issue led me to remove the blur, which made this trick unviable.
Am I challenging an impossible area, or is it just because I’m not yet familiar with these techniques?