Reflection on Texture with EQUIRECTANGULAR_MODE

I want to manipulate the reflection on a mesh by using BABYLON.Matrix.RotationXToRef(Math.PI, reflectionMatrix) (or Y or Z).
Although, when running my code, the reflection is not affected at all.

I set up a playground with a change of the X, Y and Z to the reflection-matrix of one sphere. Although, there is no change of the reflection compared to the second sphere which has an unaltered version of the reflection-matrix:

From line 18 to 20 you just calculate matrix, but you don’t apply them to something.

I’m not comfortable with matrix concepts, so can’t help more than that, however few months ago I’ve asked to get the possibility to update the reflectionTexture position when in skybox_mode. Maybe this playground could help you (check line 86) :

Thanks for the reply. I also checked this playground, but the “normal” Texture has no setReflectionTextureMatrix function, the BABYLON.CubeTexture has the setReflectionTextureMatrix function implemented.
Although, when you check the console, the reflection-matrix of the BABYLON.Texture gets updated.

When using equirectangular mode the reflection matrix is not used:

Hmm, but when I change the mode to SPHERICAL_MODE, also nothing happens:

Does this mean the most modes will not recognize the transformation of the reflection?

The only reflection that uses the transformMatrix are:

Wow, gorgeous code-paste, Deltakosh. GitHub Code-Quoter Discourse Plugin? Sweet!

1 Like

@Deltakosh my initial intention is to use a dome in JPG format and rotate the reflection. Since I can’t use HDRCubeTexture, which allows reflection rotation, my current workaround is this:

Is there maybe a smoother way? Or is there a possibility to allow JPG-domes for HDRCubeTexture?

Could you convert your texture to fit with a different projection mode ?

@sebavan using the BABYLON.Texture or my previous example with the probe?

I was more thinking about an offline conversion to what your probe does :slight_smile: so that you do not need to handle the probe code at runtime.

In general this could work. I could save the generated cube reflection images from the probe and reuse them. Unfortunately, this is not an option in my case. I just have the JPG-dome and thats it.