Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
CloserenderQueueRange | A RenderQueueRange struct that sets the value of renderQueueRange. Unity renders objects whose Material.renderQueue value is within the given range. The default value is RenderQueueRange.all . |
layerMask | A bit mask that sets the value of layerMask. Unity renders objects whose GameObject.layer value is enabled in this bit mask. The default value is -1 . |
renderingLayerMask | A bit mask that sets the value of renderingLayerMask. Unity renders objects whose Renderer.renderingLayerMask value is enabled in this bit mask. The default value is uint.MaxValue . |
excludeMotionVectorObjects | An int that sets the value of excludeMotionVectorObjects. When this is 1 , Unity excludes objects that have a motion pass enabled, or have changed position since the last frame. The default value is 0 . |
Creates a FilteringSettings
struct for use with Rendering.ScriptableRenderContext.DrawRenderers.
Note: If you call new FilteringSettings()
without any parameters, Unity creates an empty FilteringSettings
struct. An empty struct contains no data and all internal values default to 0; for example, it has a layerMask
value of 0, and so on. Unless you overwrite its properties, this empty struct tells Unity to exclude all objects.
If you call this constructor with one or more parameters, Unity sets any unspecified values to the default. The default value for each property performs no filtering. To create a FilteringSettings
struct with all default values, use FilteringSettings.defaultValue.
This example demonstrates the syntax for creating a FilteringSettings
struct with some non-default values.
using UnityEngine; using UnityEngine.Rendering;
public class FilteringSettingsExample { public FilteringSettings CreateFilteringSettings() { // Instantiate a RenderQueueRange struct that represents the RenderQueue values you want to render // In this example, render materials whose RenderQueue value is in the opaque range var desiredRenderQueueRange = RenderQueueRange.opaque;
// Create a bit mask that represents the layers you want to render // In this example, only render objects on layer 0 (the "Default" layer) int layerIndex = 0; int layerMask = 1 << layerIndex;
// Instantiate a FilteringSettings struct with the desired values // Unity sets any unspecified values to the same as FilteringSettings.default FilteringSettings filteringSettings = new FilteringSettings(desiredRenderQueueRange, layerMask);
return filteringSettings; } }
Additional resources: ScriptableRenderContext.DrawRenderers, Creating a simple render loop in a custom render pipeline.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.