How to blur environment texture

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 :face_with_hand_over_mouth: :wink:… 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.

This is my PlayGround (you might have seen this quite often by now :sweat_smile: :confused:)

EDIT: I would like to blur the texture inside of Babylon (if possible) because i don’t know how to edit a HDR / .env File

Nah, it’s fine. You can continue post it until it looks amazing :grin: :heart_eyes:

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 :wink:) 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 :sunglasses:

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! :slight_smile:

I noticed this a couple of weeks ago but did not understand where the problem was :smiley: 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.

acknowledged, i am new to CG-speak :+1:

By this you mean before even importing it, outside of the babylon application right?

This sounds pretty much like what i am trying to do here :smiley:

Correct. Here it’s the image/texture that is already blurry.

In that case, wait for ‘the hero’ :man_superhero: to kick-in :grin: Better than taking my clumsy assumptions :crazy_face: 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.

1 Like

I think @mawa nailed it: you should blur the texture (in Photoshop, for eg.), then recreate your .env file from this blurred picture.

1 Like

Alright then :slight_smile: Thank you for showing me the options, I’ll see what works best for me (my boss :wink: )

1 Like

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 :grin:

Oh well… i tried :relieved:

Thank you once again :smiling_face:

1 Like

No worries. Try, fail, over and over again, try harder and then eventually succeed is the way (the only way) I know :grin:… Just don’t tell anyone :face_with_hand_over_mouth: