I have a question regarding HDR map reflections. The problem is that all objects in a scene reflect HDR map regardless of their positions, shadows, other objects reflections etc. This leads to very unnatural effects like in the scene below:
Obviously the HDR reflection shouldn’t be there, as we should see cubes reflections on the ground plane and additionally there is a shadow cast from the directional light as well.
My question is what are the best techniques to eliminate this visual inconsistency? Adjusting objects materials roughness and metalicness is obviously not a valid solution because there are scenes which require the materials to be reflective.
I think there should be some kind of a solution from the engine side, like using baked reflections or at least taking shadows into consideration while calculating those reflections.
Anyway the way it works and looks at the moment is very unnatural and generally not very much usable. So will anyone please share any thoughts on how this can be solved?
Oh yes, I know this doc page very well, thank you. Unfortunately those realtime reflections are really resource consuming, so it’s not really usable for such purposes. And I’m not sure if these reflection probes work correctly with HDR maps. I’ve set a scene with such a reflection probe here:
But as you see the performance is not nearly as acceptable despite the scene is rather simple. I’ve just put all objects in the scene into that reflection probe in an attempt to achieve a realistic look, but it doesn’t give a usable result.
But I haven’t seen any info about baked cubemaps for this. Could you please tell more about that? Or maybe I’ve got something wrong?
My solution here would be to BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE
You can also set the refreshRate to a higher value, like each 60 frames, but generate on the fly a cubemap is expensive, especially in JavaScript where we can only use one thread (if I’m not wrong?), and it’s freezing the render during this time…
That’s said, I don’t understand why it is laggy in your tiny playground scene, and not in the playground scene from the doc’.
It is laggy cause every is using realtime filtering even in the reflection themselves.
In GTA5 for instance, they only render one probe per frame with a reduced environment to give you an idea
Everything static should be rendered in only once and some probes could be shared without anybody noticing. Baking seems like the way to go as well for most of the objects
I’ve tried to turn off realtime filtering, but the result is equally laggy.
Yeah, this helped to achieve at least around 30 fps on a RX570 desktop, will try to test it on mobiles.
Yeah, this is what we’ve been using in Unity and Unreal for ages, but in Babylon it works a bit different, from what I’ve learnt. It’s because when you attach a probe not to the center of object, the reflections will be shifted then. Correct me if I’m wrong.
Could you please tell a bit more how to use it better? Maybe there is some kind of a documentation for that?
By the way there is another solution with Screen Space Reflections in Babylon. I’ve tried to use it, but I’ve found no detailed info about the reflectivity textures which should be used in this case. Could you please elaborate on this a little? Maybe there is some kind of a documentation or a tutorial about this?
Hi @artteq !
SSR uses reflectivity texture to determine the amount of reflection.
In future it should compute real roughness/metallic workflows. In other words it uses reflectivity textures like it uses spéculer textures. You have some more documentation here: Screen Space Reflections (SSR) Post Process | Babylon.js Documentation
Yeah, thanks for this, I’ve tried to implement it alrleady, but I don’t really understand how exactly these reflectivity textures should be prepared. Is it the same as a specular texture? Do you have some kind of documentation or a tutorial about how to prepare them correctly?