Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

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

LightmapParameters.backFaceTolerance

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

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public var backFaceTolerance: float;
public float backFaceTolerance;

Description

The percentage of rays shot from a ray origin that must hit front faces to be considered usable.

The precompute calculates visibility from ray origins to clusters, but attempts to reject ray origins that are inside geometry. If the percentage of rays that hit front faces is less than backFaceTolerance, the ray origin is marked invalid and will not affect the radiosity computation.

For example, if backFaceTolerance is 0.0, the ray origin is rejected only if it sees nothing but backfaces. If 1.0, the ray origin is rejected if it has even one ray that hits a backface.

This setting can help control light leaking, but should be considered in the context of the mesh authoring workflow. Preventing the rejection of ray origins by setting a value of 0.0 will ensure Enlighten does not reject ray origins due to single-sided geometry. However, if the majority of the meshes are closed, so visible backfaces are rare, a positive value can reduce light leaking or darkening that intersecting geometry would otherwise cause.