Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by curiouspers · Jun 03, 2020 at 10:03 AM · renderingrenderpipelineuniversal

URP how to change RenderFeatures properties/settings at runtime

Let's say I made custom Render Feature pass, with outlines, bloom, lut correction, etc. and I want the user/player to be able to change this settings in game to balance performance/quality, how can I do that?
I searched for methods in UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset and googled a lot, but can't find anything useful.


Update: I'm trying to change any of these settings from code:

alt text


Update 2: I think I found what I was looking for, but why is it protected?
What's the reason, and how do I change something in some RenderFeature if that list is protected how am I suppose to use it "the right way"? alt text

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image nickostan · Jun 03, 2020 at 11:20 AM 0
Share

Are you trying to change the settings of a Volume profile?

avatar image curiouspers nickostan · Jun 03, 2020 at 11:32 AM 0
Share

updated post to clarify

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by curiouspers · Jun 09, 2020 at 03:11 PM

Turns out I can get access to this list using reflections like this:

var _rendererFeatures = _pipelineAssetCurrent.scriptableRenderer.GetType() .GetProperty("rendererFeatures", BindingFlags.NonPublic | BindingFlags.Instance) ?.GetValue(_pipelineAssetCurrent.scriptableRenderer, null) as List<ScriptableRendererFeature>;
If somebody will find this useful, make sure you're executing it only one time on Awake or Init, cause it's quite expensive.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Aviryx · Jun 03, 2020 at 06:31 PM

Render pipeline data is stored in the relevant asset file.

 public class CustomRenderPipelineAsset : RenderPipelineAsset
 {
     public int someNumber;
 }

But you are (presumably) using one of Unity's built-in solutions (URP/HDRP etc) so I'm not sure if you can access the data using the same methods as a custom pipeline.

 public CustomRenderPipelineAsset customRenderPipelineAsset;

 customRenderPipelineAsset.someNumber = 10;

You are most likely going to have to reference the asset for whatever pipeline you are using and grab the info that way.


https://github.com/Unity-Technologies/Graphics/tree/master/com.unity.render-pipelines.universal/Runtime


You can see an example from the URP pipeline instance (https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipeline.cs)

 public class LightweightRenderPipeline
 {
     public LightweightRenderPipeline(LightweightRenderPipelineAsset asset)
     {
     }
 }

 public ExampleRenderPipelineAsset exampleRenderPipelineAsset;

 exampleRenderPipelineAsset.USE_BLOOM = false;
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image curiouspers · Jun 04, 2020 at 04:54 PM 0
Share

Thanks, but I want to change not the RenderPipelineAsset properties, but rather it's RenderFeature's properties. Have you used the URP yourself? I updated the question with new findings.

avatar image
0

Answer by JG-Denver · Jan 05, 2021 at 07:17 PM

I put a custom camera component on my camera and access it is the OnCameraSetup, you have access to the Camera object in the cameraData, so you can GetComponent with that. You then just update the custom camera component and change what you want in the pass.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

153 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Missing Method: BuiltInUpdate() android 1 Answer

Universal render pipeline point light shadows? 2 Answers

How to do texture bombing in shader graph 0 Answers

How to change Terrain Shaders at URP 10.4.0 1 Answer

Stencil Override not working in a renderer feature? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges