Hello, I am looking for a way to blur my environment texture so the reflections in mirrors dont look so strange.
Currently i am creating it like this:
const hdrTexture = BABYLON.CubeTexture.CreateFromPrefilteredData(".../Path", scene );
scene.environmentTexture = hdrTexture;
When looking this tutorial i noticed the blurry effect on the environment texture, but I was not able to recreate it for the reflections in my Scene. When exporting the .env file from this tutorial, the reflections from the environment are not blurry.
Could you please tell me how to blur my environment texture like this?
Are you using a probe or a mirror material? Else, speaking about PBR mats, I would simply use ‘roughness’ to blur the env. Or you could use a blured env texture (but it will be blured for all).
Not sure I fully understand the question … Would you have a PG?
My question had a fatal flaw…! I am sorry about that.
I would like to achieve that the reflection in this mirror (reflection is based on my environment Texture) is very blurry and not such a pixelated mess.
Nah, it’s fine. You can continue post it until it looks amazing
Yeah, well a number of options I believe. But since, as I thought, this is a PBR mat imported, I guess the easiest would be to use ‘roughness’ of the metallic workflow.
Very quickly (and dirty ) done from your PG, something like that:
Side note: Open the console. There seems to be an error with your import. Nothing to do with it but I thought I would mention.
Hope this solution works for you. Else, let us know…
Meanwhile, have a great day
Thank you! That might be the solution (looks perfect). But is there also a way that does not change the model in any way, but only the env texture or other environment data?
Thank you for your time!
I noticed this a couple of weeks ago but did not understand where the problem was appreciate the effort though
Well, first things first: it doesn’t change the model. Only the material.
Next, to answer your question, the answer is ‘YES’. You can do so either at source, very simple, blur the texture. Downside: All materials using this texture for env/reflection will use a blured texture.
Else, at an in-between stage, before rendering, apply a blur to the texture and pass this texture to the ‘reflection texture’. I’m not sure though if this can be achieved without using NME/a shader. May be, may be not. If you need that, better ask the expert @Evgeni_Popov.
Correct. Here it’s the image/texture that is already blurry.
In that case, wait for ‘the hero’ to kick-in Better than taking my clumsy assumptions But then, jokes apart, there would be a need for it (which I do not see here, not yet) because it’s gonna add to the load and require a pre-pass.
The problem is with your ‘performance improvement’ (lines 66 to 70) called within the mesh import and therefor, part of the promise.
You are calling on ‘mesh’ but ‘mesh’ does not exist. And then if it would exist, the way it is now, it would be the parent, which is the ‘root’ and your meshes would not be optimized anyways. So know that currently, you are not optimizing anything