Search Unity

Post Processing Effects

Discussion in 'Assets and Asset Store' started by DawidMoza, Sep 21, 2019.

  1. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    216

    Buy now! - http://u3d.as/1xKq



    Thread for questions, opinions, suggestions and support.​
     
    Last edited: Oct 4, 2019
  2. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Do you need Post Processing Ultimate for this package to work? It should probably be mentioned it is needed on the asset store if this is the intended use.

    Code (CSharp):
    1. Shader error in 'NTEC/Screen/Invert': failed to open source file: '../../Post Processing Ultimate/Functions/Invert.hlsl' at line 15 (on d3d11)
    2.  
    3. Shader error in 'NTEC/Screen/Blur': failed to open source file: '../../Post Processing Ultimate/Functions/Append2.hlsl' at line 15 (on d3d11)
    4.  
     
  3. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    216
    Hello, no You absolutely don't need it. I just somehow managed to forgot changing the path names and including the function folder. I'm deeply sorry about it, it will be fixed in the next update, please contact me via support mail and I will send You necessary files.
     
    Freznosis likes this.
  4. netosama

    netosama

    Joined:
    Jul 16, 2019
    Posts:
    2
    Hi. Does Post Processing Ultimate work with HDRP?
     
  5. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    216
    It's just a creator, so it works with HDRP as much as Post Processing Stack works. From my experience - there are some specific things that doesn't work. But overall it should be compatible. Please firstly check if standard Stack effects work on Your platform.
     
  6. ufmsp

    ufmsp

    Joined:
    Oct 3, 2017
    Posts:
    11
    Hello,

    I just bought this pack to check it out. It seems to be working great when using them for the main camera. However, when I use them for a camera that renders onto a Render Texture, they just output white. Have tried with several of them with same result.

    When I use the post processing filters from Unity in Post Processing Stack V2, they work fine when using a Render Texture. So the Render Texture itself is not the problem.

    Any chance you could get this fixed?
     
  7. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    216
    Maybe You need to try to edit effect .cs file to directly render to RenderTexture? It should work. I've never been testing them out of the main camera. Probably stack is not supporting custom effects for other outputs.
     
  8. ufmsp

    ufmsp

    Joined:
    Oct 3, 2017
    Posts:
    11
    When I look at the docs for writing post processing effects, then your .cs files looks fine. However the shaders themselves seem to not fully follow the recommended setup:

    https://docs.unity3d.com/Packages/com.unity.postprocessing@2.1/manual/Writing-Custom-Effects.html

    I was able to get one of your shaders working with RenderTextures by doing the following:

    1) Update the shader to follow the recommended format from the above Unity docs.

    2) Declare the CameraOutput variable like this:

    float4 CameraOutput = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);


    Would be great if you could update your shader pack to do this as well.

    Thanks.
     
  9. ufmsp

    ufmsp

    Joined:
    Oct 3, 2017
    Posts:
    11
    Hi again,

    I also noticed that your shaders aren't utilizing the "blend" parameter, which they should according to the Unity docs. This is used for blending between post process volumes.
     
  10. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    216
    That's very interesting, I definitely need to check docs again. Could You tell me more about that format recommendations that my effects should follow? What exactly seems wrong for You?
     
  11. ufmsp

    ufmsp

    Joined:
    Oct 3, 2017
    Posts:
    11
    I took the sample shader from the Unity Docs, and replaced their fragment part with your. The "Pixelize" shader looks like this, and works on Render Textures as well as Main Camera:

    Code (CSharp):
    1. Shader "Custom/PostProcess/Pixelize"
    2. {
    3.     HLSLINCLUDE
    4.  
    5.         #include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
    6.  
    7.         TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
    8.         float _Blend;
    9.         uniform half _Horizontal;
    10.         uniform half _Vertical;
    11.  
    12.         float4 Frag(VaryingsDefault i) : SV_Target
    13.         {
    14.             float4 CameraOutput = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord);
    15.             CameraOutput.rgb = ((_Horizontal && _Vertical) ? SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, half2((floor((i.texcoordStereo.x * _Horizontal)) / _Horizontal),(floor((i.texcoordStereo.y * _Vertical)) / _Vertical))).rgb : SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo).rgb);
    16.             return CameraOutput;
    17.         }
    18.  
    19.     ENDHLSL
    20.  
    21.     SubShader
    22.     {
    23.         Cull Off ZWrite Off ZTest Always
    24.  
    25.         Pass
    26.         {
    27.             HLSLPROGRAM
    28.  
    29.                 #pragma vertex VertDefault
    30.                 #pragma fragment Frag
    31.  
    32.             ENDHLSL
    33.         }
    34.     }
    35. }
    36.  
    I haven't yet integrated the blend variable, as they also recommend.
     
  12. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    216
    I will definitely work on that. Unfortunately I'm quite busy in January and February, but I will try to do by best and as fast as I can.
     
    ufmsp likes this.
  13. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    216

    Hey, it's the end of February, so as I have promised over a month ago I've stared working on it. That's why I need more information about the RenderTexture You're using. I've tried rendering pixelize effect to the RT and it worked fine. So I need more information in order to reconstruct Your exact situation, so I would be able to test what exactly should be changed in my shaders in order to work with Render Textures configured as in Your case.

    I'm really sorry that it took so long.