0 like 0 dislike

I'm trying to create a distortion trail for a laser beam, but in unity the distortion effect is rendered even if the particles are behind other scene objects.

Tried modifying the distortion shader to work only conditionally if the depth of the particles is less than the depth of the scene, but i'm unable to get any reasonable depth data from the distortion RenderTexture.

float4 frag (v2f i) : SV_Target
    float partZ = UNITY_SAMPLE_DEPTH(tex2D(_DistortionTex, i.uv.xy));
    float linearPartZ = Linear01Depth(partZ);

    return linearPartZ;

... yields this being rendered when clearly this is not a correct depth data.

Are there any workarounds to this problem? Is there a way to get it to work properly with current popcorn version? Is there a solution in development?

by Ingvar (160 points)

2 Answers

1 like 0 dislike
Best answer
Problem fixed in the plugin version 2.9p2
by Valentin (7.1k points)
0 like 0 dislike

Hi Ingvar,

Could you send us a package with your Fx at support _at_ popcornfx _dot_ com ?


by Valentin (7.1k points)
Sent the minimal unity project to showcase the issue.