Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Basic question: How do you access to a post process volume from UVS?

Discussion in 'Visual Scripting' started by Marou1, Nov 6, 2022.

  1. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    141
    Hi,

    Do you know what nodes/types I should add in the project settings to be able to control a post process volume?

    PostProcess.png

    I cannot find anything that looks like a post process volume in the fuzzy finder.

    Thanks!
     
  2. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    141
    Hi,
    Anyone has an answer?

    @myanko : hope you're doing better.
    You told me you could provide some help on this, do you have some time now? Thanks!
     
  3. Welfarecheck

    Welfarecheck

    Joined:
    Jun 14, 2020
    Posts:
    98
    Far easier to use a script. If you use VS to do it, you have to do a janky workaround. Not fun.

    Add the script, add it to your VS types, and in VS you can set the value and execute. You can make a script that does any number of sets for whatever volume profile you need to change. (Ask ChatGPT to make you one if you can't code).


    Example;

    upload_2023-4-7_9-22-58.png

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Rendering;
    3. using UnityEngine.Rendering.Universal;
    4.  
    5. public class BloomControl : MonoBehaviour
    6. {
    7.     public float bloomIntensity = 1.0f;
    8.    
    9.     private Volume volume;
    10.     private Bloom bloom;
    11.  
    12.     private void Start()
    13.     {
    14.         volume = GetComponent<Volume>();
    15.  
    16.         if (!volume)
    17.         {
    18.             Debug.LogError("Volume component not found.");
    19.             return;
    20.         }
    21.  
    22.         if (!volume.profile.TryGet<Bloom>(out bloom))
    23.         {
    24.             bloom = volume.profile.Add<Bloom>();
    25.         }
    26.     }
    27.  
    28.     public void UpdateBloomIntensity()
    29.     {
    30.         bloom.intensity.Override(bloomIntensity);
    31.         volume.profile.TryGet<Bloom>(out bloom);
    32.     }
    33. }
    34.  
     
  4. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    141
    @jlbaker2779 : Thank you so much for providing the script! I added the other overrides using the same logic and it is working!
    I've been waiting for an answer for 5 months :)
    Thanks again!
     
  5. Welfarecheck

    Welfarecheck

    Joined:
    Jun 14, 2020
    Posts:
    98
    Awesome! Glad it's working!
     
    myanko and Marou1 like this.