#Tutorial for frosted glass blur HDRP?

1 messages · Page 1 of 1 (latest)

dusty umbra
#

Does anyone know of a tutorial in HDRP to achieve frosted glass blur effect? I was able to get something together but it doesn't blur transparent objects through the glass.

I'm looking for a solution that will blur transparent objects as well.

finite lake
#

You can get that working with some pre-pass options IIRC but the performance implications are huge

glossy phoenix
# dusty umbra Does anyone know of a tutorial in HDRP to achieve frosted glass blur effect? I w...

This is a quite common issue with transparency.
The blur/frosted effect of transparency works by bluring the color buffer of what has been drawn before.
But in rendering, you are not allowed to at the same time read and write to the same buffer. Because pixels are rendered in parallel, it could lead to unexpected behaviour.

So what is happening in HDRP is that the color buffer is copied before transparent objects are drawn, and the refraction/blur is made by sampling from this copy, to write into the "original" buffer.

This graph shows in which order HDRP passes are drawn.

Focus on the Transparent section, and look at when the Color Pyramid PreRefraction is done. That the buffer copy I mentioned.

By default, all transparent object are drawn during the Transparents pass, that means that they will not show other transparent objects in their refraction.

If you want a transparent object to display in the refraction of an other transparent, you need to change its Rendering Pass to Before Refraction, in that case if will be rendered before the Color Pyramid, and be avalable to display in refractions.

finite lake
#

Right, I remember what I ran into now

#

This means transparent pixels behind opaque objects also get rendered. So if you have like a big ocean below your terrain, you're now rendering every pixel multiple times.

glossy phoenix
finite lake
#

Do wonder why it cost me 3ms to reorder these things then

dusty umbra
#

I'm also confused, by "in rendering, you are not allowed to at the same time read and write to the same buffer"

I guess I'm confused on why in a custom transparent shader I couldn't just access the current color buffer and blur the portion that is overlapping with the current object and set that to the shader's output?

glossy phoenix
# dusty umbra I'm also confused, by "in rendering, you are not allowed to at the same time rea...

Imagine that you are rendering a transparent object with rough refraction, that needs to blur+offset what is behind it to have the effect working.

Without the double buffered approach (color pyramid), you will try to read and write to the color buffer with this shader.

Bluring is basically the operation of fetching multiple pixels around a defined one and doing an average, and pure refraction is fetching a pixel that isn't directly under the one that is currently drawn.

With that in mind, also consider that all pixels are drawn in parallel : what waranty do you have that a pixel A, reading from the color buffer at an other place, isn't reading the data that was already written and modified by a pixel B ?

That why usually it's not allowed to read and write to a buffer at the same time, and we use a duplicate of the color buffer to warant a "safe ground" for reading pixels.

glossy phoenix
dusty umbra
glossy phoenix
dusty umbra
#

Okay ty, I think I have somewhat of a grasp on how to approach. Might need to do a bit more reasarch on rendering in general. It confuses the hell out of me lol

glossy phoenix
#

I can understand that feeling 😉

dusty umbra