Performant version of setReflectionTextureMatrix

Is setReflectionTextureMatrix performant enough that it can be called at every render? If not (which is my assumption), what is the best way to detect if the externally set rotation value is different from what has already been applied to the cubemap?

I am controlling the rotation of a Cube Map outside from BJS and need to update it from externally updated data. I want to avoid comparing previous data values with the incoming values and make the update only if the value has changed.

Hey and welcome!
setReflectionTextureMatrix is definitely fast enough to be called once a frame.

Internally matrices store a flag that you can store to see if the value changes. Every time a matrix is updated its matrix.updateFlag gets increased.

setReflectionTextureMatrix will use that flag to avoid unnecessary updates: Babylon.js/cubeTexture.ts at master · BabylonJS/Babylon.js · GitHub

If the matrix is built outside of Babylon.js then you may want to test values manually maybe