0
\$\begingroup\$

I'm attempting to recreate this effect using a shader in Unity, using version 2023 with HDRP:

The effect appears to be pinching pixels behind the object the shader is applied to and dragging them towards the center like this:

enter image description here

Below is an attempt to create a transparent distortion using the twirl node in a shader graph as a first step:enter image description here

The result is very jagged, I suspect this might be because the Normal from Height texture is very pixelated. I did try to reduce the strength of the effect but then the effect became too minimal to notice. You can see below the shader is breaking the lines in the background:

enter image description here

I'd appreciate any advice on how to implement this effect. I'm currently using the twirl node as a start because I don't quite understand how to implement this pinching distortion effect yet. I'm new to shaders, so perhaps I'm using the wrong method for this kind of effect?

I've also posted this question on the offcial Unity forums here but did not receive any replies.

\$\endgroup\$
2
  • \$\begingroup\$ Do you want a pinch or a twirl? \$\endgroup\$
    – DMGregory
    Commented Mar 10 at 13:29
  • \$\begingroup\$ Pinch, I''ve just started with a twirl to ensure I can distort the background of the object the shader is applied to - but the goal is to create a pinch. \$\endgroup\$
    – Sean2148
    Commented Mar 10 at 13:32

1 Answer 1

2
\$\begingroup\$

You could do something like this: image of the nodes in shadergraph

Where you use the difference between the UV coordinates of the fragment and (0.5, 0.5) as the offset, but flippling the magnitude so it is strongest at the center and 0 at the edge.

Image of the pinching effect

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .