Search Unity

LWRP - Changing a render asset option through scripting (SOLVED)

Discussion in 'Scripting' started by Frostbite23, Dec 29, 2019.

  1. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Hello peeps, for my project I'm using LWRP as my pipeline.
    Currently I'm working on a video settings menu and I'm trying to find out a way to change a specific option in the render asset like Anti-Aliasing for example, yet searching around I can't seem to find a way to do it.

    QualitySettings.antiAliasing wont work and yes I have tried.

    I also grab the renderPipelineAsset and switch between different presets, which I already have set up, but can't I also access the renderPipelineAsset and change a specific option through there like
    renderPipelineAsset.antiAliasing (it doesnt exist, only options there are is stuff like autodeskInteractiveShader and defaultShader which arent useful for what I'm trying to do.) I dont want to create 10+ new renderPipelineAssets just to change a single option.

    If your confused as to what I'm talking about, its this puppy
    Unity_2019-12-28_19-09-24.png

    Any idea how?
     
    Last edited: Dec 29, 2019
  2. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    Welp I just realized that I need to specifically use the LightweightRenderPipelineAsset and not the RenderPipelineAsset. Thats my bad...


    For future reference if others can't figure it out either, for LWRP to change a specific option like AA its something like
    Code (CSharp):
    1. LightweightRenderPipelineAsset lightweightRenderPipelineAsset = GraphicsSettings.renderPipelineAsset as LightweightRenderPipelineAsset;
    2. lightweightRenderPipelineAsset.msaaSampleCount = 2;