Unity 6.3
0 онлайн 54 гостей 3 в системе
Вход

ScriptableCullingParameters.cullingOptions

Declaration

public Rendering.CullingOptions cullingOptions;

Описание

Флаги для настройки операции удаления в Scriptable Render Pipeline.

Unity устанавливает некоторые CullingOptions флаги со значениями по умолчанию и другие в зависимости от свойств Camera из которого вы получили ScriptableCullingParameters структура. Эти значения можно переопределить перед выполнением операции отсечения.

В следующем примере показано, как извлечь объект ScriptableCullingParameters из объекта Camera, отключить удаление окклюзии на объекте ScriptableCullingParameters путём снятия флага CullingOptions.OcclusionCull, а затем использовать объект ScriptableCullingParameters в операции удаления.

using UnityEngine;
using UnityEngine.Rendering;

public class ExampleRenderPipelineInstance : RenderPipeline { public ExampleRenderPipelineInstance() { }

protected override void Render(ScriptableRenderContext context, Camera[] cameras) { // Get the culling parameters from the desired Camera if (cameras[0].TryGetCullingParameters(out var cullingParameters)) { // Disable occlusion culling cullingParameters.cullingOptions &= ~CullingOptions.OcclusionCull;

// Schedule the cull operation CullingResults cullingResults = context.Cull(ref cullingParameters);

// Place code that schedules drawing operations using the CullingResults struct here // See ScriptableRenderContext.DrawRenderers for details and examples // …

// Execute all of the scheduled operations, in order context.Submit(); } } }

Дополнительные ресурсы: ,ScriptableRenderContext.Cull,, ,Camera,.