Hdr texture as video not image

I searched this and couldn’t find an answer to it, nor could I find a demo of this, but can an hdr texture be a video?

so, e.g., if you get a video of a lake glistening, can you make that your hdr, so that your pbr materials object has a more dynamic reflection going on?

Babylon.js is using a HTMLVideoElement under the hood for videos, so if hdr video is supported by this element it is supported by Babylon.

Well, let me ask this another way, a more beginner way. Is there a method where I can do

BABYLON.CubeTexture.showVideoOnCubeMap(“link to video”) ← or some kind of equivalent to this?

I’m trying to get a dynamic rather than static reflection on the pbr object from a video (so not using reflection probes).

I think this is a trick that a lot of audio-visual artists use in their sets.

//

If there is no easy way to do this, then I think a back up option could be:
-create a central sphere
-make a reflection probe for that central sphere
-make a bunch of cool stuff happening around the sphere
-hide all those meshes
-put all those meshes in reflection probe
-then you have a sphere with a really rad neat dynamic pbr surface’

What I guess I’m wondering is if you can just “cheat” by getting a cool video to reflect on the surface instead.

One way would be to use a photodome with a video and use a probe to create a cubemap from this photodome, then use this cubemap as your reflection texture… It’s a bit involved but should work.

1 Like

I think that makes a lot of sense.

so because I am crazy, I tried to do what you suggested, but there is a deep babylon engine error

https://playground.babylonjs.com/#KA93U#470

this is the console message; do you have any suggestions?

I think the effect could be… significantly interesting if I can get it to work.

babylon.js:16 Uncaught TypeError: Cannot read property ‘_currentLODIsUpToDate’ of undefined
at t._prepareRenderingManager (babylon.js:16)
at t.renderToTarget (babylon.js:16)
at t.render (babylon.js:16)
at t._renderForCamera (babylon.js:16)
at t._processSubCameras (babylon.js:16)
at t.render (babylon.js:16)
at babylon.playground.js:16
at t._renderFrame (babylon.js:16)
at t._renderLoop (babylon.js:16)

You should push the video dome mesh to the render list (videoDome.mesh):

https://playground.babylonjs.com/#KA93U#471

1 Like

fml lol thank you!

https://playground.babylonjs.com/#KA93U#481 ← take a look at this guy, kinda interesting

I’m now trying to hide the video dome, but when I hide the mesh, the reflection probe doesn’t reflect anything (kind of logically)

Is there a way, you think, to hide the video dome but keep its reflection on that sphere?

update:

post aggressive googling = videoDome.mesh.layerMask = 0; ← is that an OK way to do it?

Yes it is.

1 Like