objectFit: cover for babylon Video Textures (Video Textures)

Hello!
I have some code:


        let mat = new StandardMaterial("videoMat", scene)

        mat.diffuseTexture = new VideoTexture(name, videoEl, scene, true, true)
        mat.roughness = 1
        mat.emissiveColor = new Color3.White()
    
        videoPanel.material = mat 

Everything is fine, it works, but the video is narrow

I would like some kind of analogue of objectFit: cover from the css world for the babylon texture video.
Is there something similar? Or some other way to keep the aspect ratio?

It depends also on your UV - https://playground.babylonjs.com/#ZMCFYA#222

2 Likes