URP Shaders - Distortion effect

Hi everyone,

There is a distortion effect in the Particle System shader called Distortion. It should cause the light of the image behind it to refract, giving a water effect to it.
Any idea how I should set it up? I tried many different setups but it is not working.
My rain drop is a white image surrounded by alpha. It does appear when I use it in a unity particle system component, but it doesn’t refract anything. It just maintains a grey colour.

6779000--784409--upload_2021-1-29_12-19-23.png

Hi!

The distortion effect uses the normal map to determine how to sample the background color so you will need a normal map that matches the shape of your raindrop.
You also need to enable the Opaque Texture on the pipeline asset as it is needed for the effect.

Here is an example material setup with opaque texture enabled on the pipeline asset:

Hope that helps! :slight_smile:

3 Likes

Hi,

Thanks for the reply.
I forgot to point out that I am in a 2D environment with a 2D renderer and 2D lights here… will it still work?
Even with the normal map and the opaque texture option ON it doesn’t seem to work.
I do render my particle system on top of the sprite behind it (they are on two different sorting layers.

Cheers

Oh okay. This will not work in that case. 2D renderer doesn’t support the needed opaque texture in the same way. This thread contains a lot of information that might be relevant to you though. Unfortunately I’m not that familiar with the 2D renderer.

Yeah after some further research I realised that it is not possible.
I’ll see if I can find some workaround and in case I do, I’ll post it here.
Thanks!

Is supported before 2020.2.

Not working… Have already normal map