Can't reproduce results when using shadergraph shader inside VFX graph

I have a shader made in shader graph and when I use it in a VFX graph I cannot seem to get it to display correctly.

The left is using VFX Graph and the right is with the Unity particle system:

Here is the shader graph


and putting into vfx graph:

Any idea why it might not be playing correcting in VFX Graph?

How did you get the inputs without setting the Shader Graph Vfx Asset to the shader graph iself (it’s set to None)? Sorry, if this is a silly question :sweat_smile:

2 Likes

Hey @BigRookGames ,

If you are already using HDRP, you could just use the distortion output in the VFX Graph.
If you still would like to use shadergraph to get the distortion manually, there’s a URP example here which should be easy to switch to HDRP.

And as @florianhanke perceptively pointed out, looks like you may have lost your shader graph assignment in VFX:

6699487--768940--upload_2021-1-7_17-33-6.png

1 Like

Sorry, yeah I relinked the shader graph, must have not been present while I grabbed the screenshot.

I have messed around with the distortion node and I don’t know if it is capable of providing the same effects. It may, but I am not familiar enough with it. The distortion is biased to shift the screen space horizontally, where I want to negate the y vector and shift the distortion radially from the center out. Can this be done with the uv bias node in the output particle Distortion node?6699931--769030--upload_2021-1-7_14-30-46.png

You can see in the example, the distortion bias shifting left vs center out:
VFX Graph Distortion Node:
impurehomelybug

custom:
selfassuredinfantileemeraldtreeskink

1 Like

You shouldn’t need to play with the bias; just resize the particle themselves and reduce their alpha over time. Something like this?

I’ve attached a sample package. Two common pitfalls are that the sRGB should be off on the texture settings (so the distortion is centered at 0.5) and that the blue channel is used for the blur mask.

p.s. I see your Shader Graph also fades the distortion strength, you can just handle this directly in the VFX graph lerping between your values with age over lifetime.

6700066–769105–HDRPDistortionExample.unitypackage (122 KB)
6700066--769108--px83P3rv1j.gif

2 Likes

Oooh, okay. That was my misunderstanding.

Yeah, I am using a curve over lifetime to apply the distortion strength adjustments:
6700204--769147--upload_2021-1-7_16-5-56.png

And yes, something similar to your example but heavily focused on the outer ring. I am not great with the art side so you will have to excuse my lack of knowledge on color manipulation. The map I am using is a normal map with .5 saturation outside of the ring for R and B but there still seems to be distortion happening at the corner:
6700204--769141--upload_2021-1-7_16-3-6.png

I have the scale at 1000, but I would assume that only scales non 0 (non 0.5) values. What might I be doing wrong to cause distortion at .5 portions of the map?
6700204--769144--upload_2021-1-7_16-4-22.png

I was using the wrong map, and thought the sRGB was off, but I corrected it and now it works as intended. Thank you for your help!

1 Like