Search Unity

Custom Effect removed from PostProcessingVolume on load

Discussion in 'Image Effects' started by IGameArt, Jul 18, 2018.

  1. IGameArt

    IGameArt

    Joined:
    Aug 30, 2013
    Posts:
    7
    So I have a custom effect, it looks great. I add it to the post processing stack, run around, and admire this great effect. However any time I save Unity, close out, and reopen, my custom effect is removed from the Post processing stack, meaning that every time I load my project, I have to reconfigure this effect. Apparently my code isn't serializing properly, but to me it looks fine.

    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using UnityEngine.Rendering.PostProcessing;
    4.  
    5. [Serializable]
    6. [PostProcess(typeof(RetroFxRenderer), PostProcessEvent.AfterStack, "I-Game-Art/RetroFxShader")]
    7.  
    8. public class RetroFXPost : PostProcessEffectSettings
    9. {
    10.     [Range(1, 128), Tooltip("Bit Depth Value")]
    11.     public IntParameter BitDepth = new IntParameter { value = 16 };
    12. }
    13.  
    14. public class RetroFxRenderer : PostProcessEffectRenderer<RetroFXPost>
    15. {
    16.     public override void Render(PostProcessRenderContext context)
    17.     {
    18.         int xScrn = Screen.width, yScrn = Screen.height;
    19.         //Texture2D Dith = Resources.Load(settings.DitherTexture) as Texture2D;
    20.  
    21.         //int xDith = Dith.width, yDith = Dith.height;
    22.         var sheet = context.propertySheets.Get(Shader.Find("RetroFxShader"));
    23.         sheet.properties.SetFloat("_Bdpth", settings.BitDepth);
    24.         context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0);
    25.     }
    26. }
     
    Last edited: Jul 18, 2018
  2. spetstnelis

    spetstnelis

    Joined:
    Jul 16, 2017
    Posts:
    1
    Hi did you ever figure out the solution for your problem? I downloaded a PPv2 custom effect asset from the store, and does the same thing. After opening Unity, the effect gets removed from the profile every time.
     
  3. cabbibo_

    cabbibo_

    Joined:
    Jul 17, 2017
    Posts:
    4

    SAME HERE!
     
  4. Pixstatic

    Pixstatic

    Joined:
    May 6, 2020
    Posts:
    1
    I've been having this same problem with my custom effects for months. Anyone ever figure out the cause?