HDRP-Custom-Passes icon indicating copy to clipboard operation
HDRP-Custom-Passes copied to clipboard

Could you manage a Screen Space Snow / Wet effect?

Open djzombie84 opened this issue 3 years ago • 2 comments

Hey, I am looking for a Screen Space Snow effect like a wet effect. And wonder if you could do it? It should also be feasible to use a mask. So a box that could get out of the effect. Like, for example, there is snow or wet and inside it should be dry. Since it is a construction game, everything should be able to work without baking, as the players can build anywhere and to build a roof every time.

Translated with Google

djzombie84 avatar Jul 02 '21 18:07 djzombie84

Hello,

Yes, that should be possible by modifying the roughness parameter in the normal buffer to give a "wet" look. You can look at the EncodeIntoNormalBuffer function to write into the normal buffer: https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl#L20

For the snow, you also need to modify at least the color of the object, this is harder because you don't have access to the GBuffer in HDRP. An alternative to modifying the GBuffer color is to use a Fullscreen pass with depth displacement (depth offset in ShaderGraph) to move the pixels where the geometry is and overwrite their color with a transparent/opaque shader. There is an example of this in the Liquid pass of this repo: https://github.com/alelievr/HDRP-Custom-Passes#liquid but it's a bit complicated though.

Otherwise, you can maybe use a generic big shader graph that can apply both wet and snow look on all your objects? that would be much simpler I think :) But it also adds more constraints artistically.

alelievr avatar Jul 05 '21 14:07 alelievr

I also thought about Shader. I would have to look like the performance then when the whole world changes to snow + the things that a roof did not change. I had a shader with snow and rain, which you can do it by Bool and out. I just realized that the ground of a roof has made the rake in the shader and thus all over the same material is. Thus, I had to clone the materials that led to more calls. Thank you for your answer :)

djzombie84 avatar Jul 05 '21 19:07 djzombie84