Legacy Documentation: Version 2017.1 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Experimental: this API is experimental and might be changed or removed in the future.

CullResults

struct in UnityEngine.Experimental.Rendering

Suggest a change

Success!

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.

Close

Submission failed

For 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.

Close

Cancel

Description

Culling results (visible objects, lights, reflection probes).

In a scriptable render loop, the rendering process is typically doing culling for each camera (CullResults.Cull), followed by rendering subsets of visible objects (RenderLoop.DrawRenderers) and processing visible lights (visibleLights, visibleReflectionProbes).

CullResults also provides several functions to aid shadow rendering (ComputeDirectionalShadowMatricesAndCullingPrimitives, ComputeSpotShadowMatricesAndCullingPrimitives, ComputePointShadowMatricesAndCullingPrimitives).

Variables

visibleLightsArray of visible lights.
visibleOffscreenVertexLightsOff screen lights that still effect visible scene vertices.
visibleReflectionProbesArray of visible reflection probes.

Public Functions

ComputeDirectionalShadowMatricesAndCullingPrimitivesCalculates the view and projection matrices and shadow split data for a directional light.
ComputePointShadowMatricesAndCullingPrimitivesCalculates the view and projection matrices and shadow split data for a point light.
ComputeSpotShadowMatricesAndCullingPrimitivesCalculates the view and projection matrices and shadow split data for a spot light.
FillLightIndicesFills a compute buffer with per-object light indices.
GetLightIndicesCountGets the number of per-object light indices.
GetShadowCasterBoundsReturns the bounding box that encapsulates the visible shadow casters. Can be used to, for instance, dynamically adjust cascade ranges.

Static Functions

CullPerform culling for a Camera.
GetCullingParametersGet culling parameters for a camera.

Did you find this page useful? Please give it a rating: