ReflectionProbe Prefiltering, .env file from reflection

Let me show you a typical sponza, but with prefiltered reflections (reflection and global illumination is from a ReflectionProbe, not loaded from an .env file):

I think this looks good. I’m really early with this, this first version does the prefiltering in javascript Float32 arrays, so it’s too slow for realtime. It “bakes” the lighting+reflection in around 4-5 seconds. Uploads the different mipmap levels as a PNG image.

I’m working on a next version with cascaded downscaling and gaussian blur postprocesses, kind of works, but I have problems uploading to a cube texture. It generates the textures in 6-8ms, so it may be still slow for 60fps realtime, but it will be usable for example generating the reflection after loading the scene.

I will update you about this process :smiley:

4 Likes

This shows that roughness works well.
(Standard PBR spheres.)

1 Like

It is excellent!

Yeah this is indeed rad!


Some update: this works really well, around 1300-1500ms for a reflection capture and filtering - most of it, about 1000ms is encoding the mipmap levels to RGBE PNG.
But, the first time I render the ReflectionProbe, the browser freezes for about 15s, I suppose some kind of slowness in shader compilation, or the allocation of many buffers. I hope I can figure it out.

The picture shows secondary reflections. (when a previous reflection texture is used) This looks really nice, like a ray-traced image, reflection of a reflection of a reflection…

3 Likes

I found the problem with the slowness, so now it’s kind of usable:
https://bitofgold.github.io/BabylonUtilities/prefilter/demo.html

source is here:

If someone is interested in features, or using it somewhere, I can help.

4 Likes

This is really good. You should add it as a community demo in our homepage!

1 Like

That’s a relly great implementation, nice work!

1 Like

goooooooooood!!!
I’ve been looking for this effect!:smiley:

1 Like