Search Unity

Official New Post-processing Stack (Pre-Release)

Discussion in 'Image Effects' started by Chman, Oct 10, 2016.

  1. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,838
  2. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    It's on the right on the same page.
     
  3. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    I'm using 2017.1.1f1 right now. Isn't there any other way except updating unity?
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah just update to the unity version (Unity calls them patches) for your particular timeline if you need to do so. I'm on 2017.1.2p3 at the moment.

    Or did I misunderstand?
     
    ksam2 likes this.
  5. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,838
    It's not on the same page. Example: v2 adds a "diffusion" option to the Bloom. This is not explained anywhere.
    I can't contribute to beta testing if I don't know what the settings are supposed to do.
     
  6. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    I'm trying to port my title over to UWP for the Windows Mixed Reality Headset and I'm getting build errors from the Post Processing Stack.
    I'm currently using Post-processing Stack 2.0.0-Beta4 and Unity 2017.2.0p2

    When I build the project I'm getting these errors from the Post Processing Stack.

     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    Hey, I noticed that the stack changed license.

    It used to be MIT but now it's "Unity Companion License". Why did it change?

    Also, from reading it, it seems the major change is that it can now only be used in conjunction with Unity? Am I correct?
     
  8. eron82

    eron82

    Joined:
    Mar 10, 2017
    Posts:
    83
    Post process layer (V2) causes a huge drop of framerate
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well it's not hard to deconstruct the code for any other engines and considerable work went into it. So up until now anyone can have the work we're paying for.
     
    AcidArrow likes this.
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    Yeah, that was my guess too, I guess I wanted an official confirmation.
     
    hippocoder likes this.
  11. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    :) some official confirmation would be nice.
     
  12. Coltrain

    Coltrain

    Joined:
    Mar 4, 2015
    Posts:
    8
    Any idea on a time frame for a full v2 release? I could do a lot of important things with the v2 volume blending but I'm a little skittish about incorporating the beta into a production project when I am not an expert graphics programmer.
     
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'm not feeling skittish with V2. Feels pretty solid assuming you're on the latest 2017.1 (patched) or above.
     
  14. scvnathan

    scvnathan

    Joined:
    Apr 29, 2016
    Posts:
    75
    Unfortunately, XR support isn't quite up to par :( It's getting there though...
     
  15. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    try using bloom from v2 on an apple tv and you get artifacts
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    XR and mobile is a bit WIP indeed. In fact I wouldn't expect to use it with either for performance reasons alone.
     
  17. scvnathan

    scvnathan

    Joined:
    Apr 29, 2016
    Posts:
    75
    You're right post processing is very demanding for XR and mobile -- but don't make other's decisions for them, its up to the developer to manage performance (mostly). There are good reasons that someone might want to use post processing outside of a desktop. Not everyone is making a game with Unity ;)
     
    265lutab likes this.
  18. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    I don't understand which it's saying that settings isn't a variable... it's got a setter
     
  19. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
    It's a struct, so I think you have to modify it in the same way you'd modify transform.position etc. i.e. copy the settings struct to a local variable, make the change and pass the copy back.
     
  20. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    thx
    Looking forward to the day when c# no longer requires this
     
  21. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    Whenever I try to destroy a scripted quick volume I'm getting a null error. I can change the weight of the volume so I know the reference is valid.

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Rendering.PostProcessing.RuntimeUtilities.DestroyProfile (UnityEngine.Rendering.PostProcessing.PostProcessProfile profile, Boolean destroyEffects) (at Assets/PostProcessing/Runtime/Utils/RuntimeUtilities.cs:309)
    UnityEngine.Rendering.PostProcessing.RuntimeUtilities.DestroyVolume (UnityEngine.Rendering.PostProcessing.PostProcessVolume volume, Boolean destroySharedProfile) (at Assets/PostProcessing/Runtime/Utils/RuntimeUtilities.cs:319)
    PickupItem+<FadeEffects>c__Iterator1.MoveNext () (at Assets/Scripts/Item Pickup/PickupItem.cs:144)
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
     
  22. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    Here is the script where I'm getting the error.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Rendering.PostProcessing;
    5. //using DG.Tweening;
    6.  
    7. [System.Serializable]
    8. public class PostProcessingEffectSettings //Post processing effect settings dropdown
    9. {
    10.     //Color Grading settings
    11.     public float saturation = 80f;
    12.     public float contrast = 40f;
    13.     public float toneToeStrength = 0.4f;
    14.     public float toneToeLength = 0.6f;
    15.     public float toneShoulderStrength = 0.221f;
    16.     public float toneShoulderLength = 0.81f;
    17.     public float toneShoulderAngle = 0f;
    18.     public float toneGama = 1.1f;
    19.     public float mixerBlue = 105f;
    20.     public Vector4 colorGain = new Vector4(1.4f, 1.4f, 1.4f, 1.4f);
    21.  
    22.     //Bloom Settings
    23.     public float bloomIntensity = 7f;
    24.     public float bloomThreshold = 0.6f;
    25.  
    26.     //vignette settings
    27.     public float vignetteIntensity = 0.5f;
    28.  
    29. }
    30.  
    31. public class PickupItem : MonoBehaviour {
    32.  
    33.     public int pickupGroup; //The set of pickups this belongs to. A different set is used for inside and outside.
    34.     public Animator anim; //animator that is triggered by CollectItem()
    35.     public string animTrigger = "pickup"; //Animation trigger peramitor name
    36.     [Tooltip("Set this to the lenth of the pickup animation so particle burst, post processing effects and score are triggered after the animation finishes")]
    37.     public float pickupAnimationLenth = 1.5f; //Delay time that should be set to match pickup animation lenth
    38.     public GameObject pickup; //Pickup item gameobject that is destroyed when pickup is done
    39.     public GameObject particleBurst; //particle effect that is instatiated on pickup
    40.     public Color particleColor = new Color(1.00f, 0.78f, 0.26f, 0.72f); //color of particles in particle effect
    41.     public LensFlareFixedDistance flareAndGlow; //script that controls the lens flare size
    42.     public float effectTime = 2f; //the time that the post processing effects last for
    43.     public int effectLayer = 21; //the layer that the post processing effects are on
    44.     [Header("Settings for post processing effect")]
    45.     public PostProcessingEffectSettings postProcessingEffectSettings;
    46.     public bool myDebug; //debug print messages will be shown if this is ture
    47.     private ParticleSystem burst; //The instatiated instance of the particle system. Used to change particle color after instatiation.
    48.     private bool pickedUp; //used to keep the pickup from being triggered more than once
    49.     private SystemController mySystem; //refference to the system controller that tracks the number of pickups the play has
    50.     private PickupController myPickupController; //used to update light ball settings baised on the number of pickups
    51.  
    52.     //private float t = 0; //timer that is used for animation delay
    53.  
    54.     public void CollectItem() //function that is triggered by PickupItemCollection script on controllers if PickupItem has the tag pickupItemTag
    55.     {
    56.         if (!pickedUp) //keeps the animation from being triggered more than once per PickupItem
    57.         {
    58.             if (myDebug)
    59.                 print("Item Collected");
    60.             pickedUp = true;
    61.             StartCoroutine(PickupAnimation()); //starts the pickup animation
    62.         }
    63.     }
    64.  
    65.     IEnumerator PickupAnimation()
    66.     {
    67.         yield return new WaitForEndOfFrame(); //pause to avoid errors
    68.         anim.SetTrigger(animTrigger); //starts the animation on anim
    69.         mySystem = FindObjectOfType<SystemController>(); //finds the system controller for score keeping
    70.         myPickupController = FindObjectOfType<PickupController>();
    71.         yield return new WaitForSeconds(pickupAnimationLenth); //waits until pickup animation has finished
    72.         mySystem.myPickups[pickupGroup]++; //adds one to the stored number of pickups
    73.         myPickupController.UpdateSettings();
    74.         if (myDebug)
    75.             print("Number of Pickups: " + mySystem.myPickups[pickupGroup] + " In Group: " + pickupGroup);
    76.  
    77.         flareAndGlow.active = false; //stops the lens flaire distance from updating
    78.         //DOTween.To(() => flareAndGlow.FlareComponent.brightness, x => flareAndGlow.FlareComponent.brightness = x, 0f, 1f); //fades out the lens flare over 1 second
    79.         StartCoroutine(FlareFade(0, 1));
    80.  
    81.         burst = Instantiate(particleBurst, anim.gameObject.transform).GetComponent<ParticleSystem>(); //instatiates the particle burst
    82.         var pSystemMain = burst.main; //local reference to the main module of the particle system
    83.         pSystemMain.startColor = particleColor; //sets the start color on the instatiated particle system
    84.         ColorBoost(); //starts the color boost post processing effect
    85.         yield return new WaitForSeconds(effectTime); //waits until the post processing effect is done
    86.         flareAndGlow.FadeOutLight(); //fades out the pickup light
    87.         if (myDebug)
    88.             print("Item Pickup Animation Done");
    89.     }
    90.  
    91.     void ColorBoost() //post processing effect that fades to the settings in postProcessingEffectSettings for effectTime in secconds then fades them back out before destroying the pickup gameobject and effect instance
    92.     {
    93.         //applies vignette settings to new effect instance
    94.         var vignette = ScriptableObject.CreateInstance<Vignette>();
    95.         vignette.enabled.Override(true);
    96.         vignette.intensity.Override(postProcessingEffectSettings.vignetteIntensity);
    97.  
    98.         //applies color grading settings to new effect instance
    99.         var colorGrading = ScriptableObject.CreateInstance<ColorGrading>();
    100.         colorGrading.enabled.Override(true);
    101.         colorGrading.gradingMode.Override(GradingMode.HighDefinitionRange);
    102.         colorGrading.saturation.Override(postProcessingEffectSettings.saturation);
    103.         colorGrading.contrast.Override(postProcessingEffectSettings.contrast);
    104.         colorGrading.tonemapper.Override(Tonemapper.Custom);
    105.         colorGrading.toneCurveToeStrength.Override(postProcessingEffectSettings.toneToeStrength);
    106.         colorGrading.toneCurveToeLength.Override(postProcessingEffectSettings.toneToeLength);
    107.         colorGrading.toneCurveShoulderStrength.Override(postProcessingEffectSettings.toneShoulderStrength);
    108.         colorGrading.toneCurveShoulderLength.Override(postProcessingEffectSettings.toneShoulderLength);
    109.         colorGrading.toneCurveShoulderAngle.Override(postProcessingEffectSettings.toneShoulderAngle);
    110.         colorGrading.toneCurveGamma.Override(postProcessingEffectSettings.toneGama);
    111.         colorGrading.mixerBlueOutBlueIn.Override(postProcessingEffectSettings.mixerBlue);
    112.         colorGrading.gain.Override(postProcessingEffectSettings.colorGain);
    113.  
    114.         //applies bloom settings to new effect instance
    115.         var bloom = ScriptableObject.CreateInstance<Bloom>();
    116.         bloom.enabled.Override(true);
    117.         bloom.intensity.Override(postProcessingEffectSettings.bloomIntensity);
    118.         bloom.threshold.Override(postProcessingEffectSettings.bloomThreshold);
    119.  
    120.         //Creates the new post processing instance with a weight of 0 on the effectLayer and a prioirty of 100
    121.         var volume = PostProcessManager.instance.QuickVolume(effectLayer, 100f, vignette, colorGrading, bloom);
    122.         volume.weight = 0f;
    123.  
    124.         StartCoroutine(FadeEffects(volume));
    125.         /*Sequence mySequence = DOTween.Sequence(); //doTween sequence that fades the post effect in and then out
    126.         mySequence.Append(DOTween.To(() => volume.weight, x => volume.weight = x, 1f, 1f)) //fades the volume weight in so it overrides the default volume
    127.             .AppendInterval(effectTime) //waits for effect time with new volume at full
    128.             .Append(DOTween.To(() => volume.weight, x => volume.weight = x, 0f, 2f)) //fades the effect volume out
    129.             .AppendCallback(() => EndPickup()) //destroys the pickup gameobject (happens after DestroyHiddenVolume)
    130.             .AppendCallback(() => DestroyHiddenVolume(volume)); //destroys the volume instance*/
    131.     }
    132.  
    133.     IEnumerator FadeEffects(PostProcessVolume volume)
    134.     {
    135.         if (myDebug)
    136.             print("Fade Effects");
    137.         StartCoroutine(VolumeFade(volume, 1f, 1f));
    138.         yield return new WaitForSeconds(effectTime);
    139.         StartCoroutine(VolumeFade(volume, 0.1f, 2f));
    140.         yield return new WaitForSeconds(2.5f);
    141.         if (myDebug)
    142.             print("Done With Effects");
    143.         RuntimeUtilities.DestroyVolume(volume, true);
    144.         Destroy(pickup);
    145.         //DestroyHiddenVolume(volume);
    146.         //EndPickup();
    147.     }
    148.  
    149.     IEnumerator VolumeFade(PostProcessVolume volume, float endWeight, float fadeTime)
    150.     {
    151.         float t = 0;
    152.         float startWeight = volume.weight;
    153.         while (t < 1)
    154.         {
    155.             volume.weight = Mathf.Lerp(startWeight, endWeight, t);
    156.             t += Time.deltaTime / fadeTime;
    157.             yield return new WaitForEndOfFrame();
    158.         }
    159.         volume.weight = endWeight;
    160.  
    161.     }
    162.  
    163.     IEnumerator FlareFade(float endBrightness, float fadeTime)
    164.     {
    165.         float t = 0;
    166.         float startBrightness = flareAndGlow.FlareComponent.brightness;
    167.         while (t < 1)
    168.         {
    169.             flareAndGlow.FlareComponent.brightness = Mathf.Lerp(startBrightness, endBrightness, t);
    170.             t += Time.deltaTime / fadeTime;
    171.             yield return new WaitForEndOfFrame();
    172.         }
    173.         flareAndGlow.FlareComponent.brightness = endBrightness;
    174.  
    175.     }
    176.  
    177.     void DestroyHiddenVolume(PostProcessVolume volume)
    178.     {
    179.         if (myDebug)
    180.             print("** Destory Volume **");
    181.         RuntimeUtilities.DestroyVolume(volume, true);
    182.      
    183.     }
    184.  
    185.     void EndPickup()
    186.     {
    187.         if (myDebug)
    188.             print("** Volume Destroid **");
    189.         Destroy(pickup);
    190.     }
    191. }
    192.  
     
  23. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    798
    Are you sure it's not the GameObject called "Pickup" that's null?
     
  24. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    Yes if I comment out "RuntimeUtilities.DestroyVolume(volume, true);" it runs without errors.
     
  25. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
    OK, so... I just need to rant for a second. There is a very bad 'artifact' (to put it lightly) involving temporal anti-aliasing, which involves this crazy black fog that eventually 'corrupts' adjacent pixels and eventually takes over the entire screen, rendering the game completely UNPLAYABLE. This was alluded to in an earlier post, I believe, but I don't feel like reading through them to find it.

    This same issue was present in v1 as well--however, with v1, I used a workaround that essentially disabled anti-aliasing for a few frames, then turned it back on as the player was loading into a scene. This method, unfortunately, does not work for v2. In fact, nothing really works except disabling the PostProcessingLayer, but hey, surprise, surprise, re-enabling it again effectively disables all the post-processing. (Uh, ok?)

    This seems to happen when switching scenes (and therefore, switching the active camera.) Other than that, I'm at a loss as it tends to 'emanate' from what appear to be random pixels on the screen. I feel like the new setting that disables NaN propagation was an attempt to mitigate this and possibly other problems. The only issue: it doesn't help! Should I even select it?

    Beyond frustrated at this point--how is it that people are touting this v2 stack (including Unity devs themselves) when there is such an obviously messed-up problem just waiting beneath the surface? Is there a way to clear this buffer or something--anything?! Does anyone have any idea how to get around this?

    Par for the course though, I guess, releasing terribly broken/incomplete features (don't even get me started on Timeline) and yes, I understand that this on a github repo, but when I'm urged to upgrade to fix another issue and then find out that my previous 'workaround' for broken v1 TAA doesn't work anymore--yeah, it tends to piss me off a little.
     
  26. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    Thank you for pointing this out. It sounds aggravating. Hopefully they'll be able to get this fixed before moving v2 out of beta.
     
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It is fixed, tick prevent nan. That effect will never go away. It's caused by numbers running wildly out of range.

    I haven't said any such thing. I told you what *I* wouldn't do.
     
  28. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
    Assuming you're responding to me, I'm confused. You say it's fixed if I tick prevent NaN (which doesn't fix it) and then say that the effect will never go away (IE, to me, meaning that it's unfixable.)
     
  29. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I see, what other post are you running, or what is your setup, unity version, linear, deferred etc...

    Sounds like if it's just Unity's post it should be fixed, @Chman is the man to speak to.
     
  30. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
    Yeah, it'd be really nice to try to nail this down. Again, I get that it's probably a rare problem and I'd love to be able to reproduce it reliably myself, but at this point, I'm mainly interested in any kind of workaround. As for more details, we're using 2017.2.0f3, and rendering in deferred.

    As for other post-processing, we're using bloom, AO, color grading, fog and motion blur. And obviously TAA. Other types of AA do not exhibit the problem (probably obvious, but wanted to point it out.)

    Also, if it helps, here's a video demonstrating the problem as it appeared in v1 (still using TAA) of the post-processing stack:


    Note that the offending 'effect' here seems to be the bloom induced by the particle effect lighting--this happened consistently with v1 and seemed to occur in the editor when a particular particle shader was used (sorry, don't remember exactly what it was) but also in other situations when loading into a new scene. We use asynchronous loading and have a loading screen 'scene', but it might be worthwhile to see if this problem occurs when async loading is not used, as it could be something with the camera in that scene. Perhaps it's also possible that the effect occurs in general, because we are switching cameras (so, every scene has its own unique camera instead of a DontDestroyOnLoad, but I imagine this is a fairly common use-case?) In the v1 case, however, as mentioned, I was able to fix it by disabling AA when a scene loaded and quickly re-enabling it. For whatever reason, this does not work with this newest iteration of TAA.

    I'll try to get a repro video of the v2 version of this artifact. I should also note that @Chman has not been active in months, so--is this still being worked on in any capacity?
     
    ksam2 likes this.
  31. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yes - are you using the version from github?
     
  32. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
    Yes, that is correct.

    Now that I'm poking around on there, I see that this particular issue is exactly what is happening--except, I'm guessing TAA kicks this into overdrive so that it soon overtakes the entire screen. We could probably live without bloom if that is indeed the offending effect--TAA not so much.

    Final edit: I believe this is the exact issue: https://github.com/Unity-Technologies/PostProcessing/issues/337
     
  33. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Don't know if this was brought up already, but V2's SSR generates some NASTY black spots at gazing angles! It totally ruins the image, it just becomes black in some places, which should not occur. Here is an example. SSR just writes black where it otherwise should be just left blank so that RP's reflections could be used. Anyone else experiencing this?
     

    Attached Files:

  34. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    104
    In V1 of the PostFX stack I would use this in the graphic settings to be able to turn on and off FX for performance:
    Code (CSharp):
    1.        
    2. var postfx = mainCamera.GetComponent<PostProcessLayer>();
    3. _profile = postfx.profile;
    4. postfx.profile = _profile;
    5. _profile.bloom.enabled = false;
    6. _profile.colorGrading.enabled = true;
    7. _profile.ambientOcclusion.enabled = false;
    How do you do the same using V2?
    Using something like _profile = mainCamera.GetComponent<PostProcessVolume>().profile;

    I can get the profile, but once I have a reference to the profile I can only add or remove settings or ask if their are settings there with TryGetSettings<>
     
  35. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
    @Justin-Wasilenko

    I did something like this to disable/enable a specific effect--not sure if it's the most efficient/best way, but it seems to work OK. Note that the shared profile will actually 'alter' the profile itself (and not just a copy of it)

    Code (CSharp):
    1.  
    2. UnityEngine.Rendering.PostProcessing.MotionBlur mb = null;
    3. GameManager.instance.MainCamera.GetComponentInChildren<PostProcessVolume().sharedProfile.TryGetSettings<UnityEngine.Rendering.PostProcessing.MotionBlur>(out mb);
    4.              
    5. if (mb != null)
    6. {
    7.      BoolParameter b = new BoolParameter();
    8.      b.value = false;
    9.      mb.enabled = b;
    10. }
     
    Last edited: Jan 11, 2018
    Justin-Wasilenko likes this.
  36. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
  37. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
  38. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    104
    Great thanks for that. Ran into a problem when I think the code is working. But while trying to turn effects on and off while in Play mode doesn't work. Going back to V1 stack since V2 just isn't working for me yet.
     
  39. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,838
    Surely there is a way to enable/disable the individual effects in V2. I wouldn't roll back back to V1 until I've exhausted all options. (I'm still using V1 so I don't how to do it in V2)
    Also, your code you have looks strange.
    Code (csharp):
    1.  
    2. _profile = postfx.profile;
    3. postfx.profile = _profile;
    4.  
    Did you mean?:
    Code (csharp):
    1.  
    2. _profile = Instantiate(postfx.profile);
    3. postfx.profile = _profile;
    4.  
    (I don't know if that's related or not)
     
    Last edited: Jan 13, 2018
    hopeful likes this.
  40. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    104
    Even when trying to use the On/Off buttons in the editor they don't work while in Play mode. Doesn't give me hope it's going to work by script either.
     
  41. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
    It's because a lot of this stuff (par the course!) is either broken (TAA), incomplete (SSR/missing settings not carried from v1), woefully underexplained (scripting the stack in general) or outright misleading (both an active AND an enabled variable for effects). The change you need to make is relatively simple if you want to change it during runtime.

    In the code I provided above, just set mb.active = [your value]. That should do the trick. The on/off buttons are apparently for priority (however the hell that's implemented under the hood) To Unity devs, I would strongly recommend changing this--it makes 0 sense to have both an active and an enabled variable.
     
  42. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    I figured out what I was doing wrong. In case anyone else has the same problem.
    RuntimeUtilities.DestroyVolume(volume, true);
    needed to be
    RuntimeUtilities.DestroyVolume(volume, false);

    I was creating the volume in my script and it was an instance not a shared volume.
     
    flashframe likes this.
  43. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    is there any more resource for writing custom effects? i did check the documentation and got the gray scale example running but i´m not sure how to get custom image samplers etc in.
     
  44. Sebioff

    Sebioff

    Joined:
    Dec 22, 2013
    Posts:
    218
    MSVO looks very promising but I'm getting these line artefacts on non-occluded surfaces. Any ideas? Using the latest v2 branch.
    ao.png ao2.gif
     
    RafayAli and Lex4art like this.
  45. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    216
    Hello everyone!



    Yes, You're looking at Custom Effects Visual Scripting Editor for Post Processing Stack v2! It's now finished yet. I would like to know your opinions about it, like how much should it cost? Is there any sense to develop it?
     
    Lex4art likes this.
  46. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    185
    I'm going through the v2 "Writing Custom Effects" wiki for the Grayscale effect, and have some feedback on the UI. Across the board in Unity I think it's time for a UX designer to think hard about improving consistency. The Inspector, Mecanim, Audio Mixers, Particles, and now Post Processing all have slightly different UI / UX. As more cool features get added, it's kind of getting confusing.

    With regards to the Post Process Volume, I'd argue that the effect parameter check boxes are confusing right now. In Image #1 below the grey circle next to the Blend parameter:
    1. Doesn't indicate a checkbox to me. I think it should be an actual box instead of a circle.
    2. The slider and float field are grey and can't be edited. As a user this leads me to believe the grey circle can't be changed either and enabling the circle requires checking something else (e.g. the way a Particle System "Looping" checkbox enables the "Prewarm" checkbox). After being confused, I randomly clicked the circle, and was surprised to learn it was possible to click.
    I'd recommend making these parameters have check boxes that look like the Particle System check boxes.

    Image #1
    Unity_2018-02-04_12-46-50.png

    Image #2
    Unity_2018-02-04_12-46-59.png
     
  47. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    But then the rest of Unity would be inconsistent. As far as I know @karl_jones mentioned in another thread that they were looking into unifying the UI experience if only for a better or newer API to move forward with.
     
  48. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    185
    Not sure what you mean.. If my suggestion was implemented the Post Processing Volume Effects check boxes would be consistent with the Particle System checkboxes, so there would be more overall consistency in Unity rather than making anything things more inconsistent.

    Or make them like the v1 Bloom Threshold check boxes shown below:
    quickstart-3.png
     
    Vagabond_ and hopeful like this.
  49. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,297
    The editor team don't like that the particle system has a completely custom style :pThe idea is for the whole editor to have the same feel no matter the feature and we break that. It was done before any of us were here though . We have not decided if we should change it though, still debating it.iThat's not to say you won't see particle system styles coming over to the main editor but it would need to be made more consistent. For example I recently added support for the min max curve and gradient to scripts, it has a custom editor that looks a lot like the particle system version but using the normal font and a slightly different icon.
     
    hippocoder likes this.
  50. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Which is the worst thing. In general the Unity editor... i find it really non user friendly because of the current uniform interface and the small gray icons it has... That's why i love particle system and the post process stack "V1" UIs ( and the audio mixer as well) . I even hope that the editor will receive an overall new UI look .

    And really when i found that the greyed out toggle can be toggled on/off i was like - "wait, what, what, why" :D it is not intuitive - i found the V1 UI much nicer...

    And one question - i tried the V2 only once some time ago and i had to toggle so many options ( per effect ) one by one - so why is this, are all the effect option enabled separately and if so is it for performance reasons mostly !???
     
    Kronnect and hopeful like this.