|
|
|
|
|
|
|
|
|
|
DrawRendererSettings settings = new DrawRendererSettings(cull, camera, new ShaderPassName(passName)); |
|
|
|
settings.sorting.sortOptions = SortOptions.SortByMaterialThenMesh; |
|
|
|
settings.inputCullingOptions.SetQueuesOpaque(); |
|
|
|
settings.inputFilter.SetQueuesOpaque(); |
|
|
|
renderLoop.DrawRenderers(ref settings); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
rendererConfiguration = RendererConfiguration.PerObjectLightProbe | RendererConfiguration.PerObjectReflectionProbes, |
|
|
|
sorting = { sortOptions = SortOptions.SortByMaterialThenMesh } |
|
|
|
}; |
|
|
|
settings.inputCullingOptions.SetQueuesTransparent(); |
|
|
|
settings.inputFilter.SetQueuesTransparent(); |
|
|
|
renderLoop.DrawRenderers(ref settings); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RenderOpaqueRenderList(cullResults, camera, renderLoop, "ForwardUnlit"); |
|
|
|
RenderTransparentRenderList(cullResults, camera, renderLoop, "ForwardUnlit"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void FinalPass(RenderLoop renderLoop) |
|
|
|
{ |
|
|
|
|
|
|
if (light.lightType == LightType.Spot) |
|
|
|
{ |
|
|
|
var spotAngle = light.light.spotAngle; |
|
|
|
|
|
|
|
|
|
|
|
var innerConePercent = AdditionalLightData.GetInnerSpotPercent01(additionalLightData); |
|
|
|
var cosSpotOuterHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * Mathf.Deg2Rad), 0.0f, 1.0f); |
|
|
|
var cosSpotInnerHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * innerConePercent * Mathf.Deg2Rad), 0.0f, 1.0f); // inner cone
|
|
|
|
|
|
|
|
|
|
|
s.bias = light.light.shadowBias; |
|
|
|
|
|
|
|
shadows.Add(s); |
|
|
|
shadows.Add(s); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Shader.SetGlobalBuffer("_PunctualLightList", s_punctualLightList); |
|
|
|
Shader.SetGlobalInt("_PunctualLightCount", lights.Count); |
|
|
|
Shader.SetGlobalBuffer("_PunctualShadowList", s_punctualShadowList); |
|
|
|
Shader.SetGlobalBuffer("_PunctualShadowList", s_punctualShadowList); |
|
|
|
} |
|
|
|
|
|
|
|
void UpdateReflectionProbes(VisibleReflectionProbe[] activeReflectionProbes) |
|
|
|