Exemple #1
0
 private void CameraPreCull(Camera camera)
 {
     if ((camera.depthTextureMode & DepthTextureMode.Depth) == DepthTextureMode.None)
     {
         camera.depthTextureMode |= DepthTextureMode.Depth;
     }
     CurrentCamera         = camera;
     CurrentCameraPosition = camera.transform.position;
     SetShaderSunViewportPosition(camera);
     CurrentCameraFrustumPlanes = GeometryUtility.CalculateFrustumPlanes(camera);
     if (RainScript != null && RainScript.isActiveAndEnabled)
     {
         RainScript.PreCullCamera(camera);
     }
     if (SnowScript != null && SnowScript.isActiveAndEnabled)
     {
         SnowScript.PreCullCamera(camera);
     }
     if (HailScript != null && HailScript.isActiveAndEnabled)
     {
         HailScript.PreCullCamera(camera);
     }
     if (SleetScript != null && SleetScript.isActiveAndEnabled)
     {
         SleetScript.PreCullCamera(camera);
     }
     if (CustomPrecipitationScript != null && CustomPrecipitationScript.isActiveAndEnabled)
     {
         CustomPrecipitationScript.PreCullCamera(camera);
     }
     if (SkySphereScript != null && SkySphereScript.isActiveAndEnabled)
     {
         SkySphereScript.PreCullCamera(camera);
     }
     if (CloudScript != null)
     {
         CloudScript.PreCullCamera(camera);
     }
     if (SkyPlaneScript != null && SkyPlaneScript.isActiveAndEnabled)
     {
         SkyPlaneScript.PreCullCamera(camera);
     }
     if (FogScript != null)
     {
         FogScript.PreCullCamera(camera);
     }
     if (LightManagerScript != null && LightManagerScript.isActiveAndEnabled)
     {
         LightManagerScript.PrepareToRenderCamera(camera);
     }
     if (CommandBufferManagerScript != null && CommandBufferManagerScript.isActiveAndEnabled)
     {
         CommandBufferManagerScript.PreCullCamera(camera);
     }
 }
Exemple #2
0
        private void CameraPreCull(Camera c)
        {
            if ((c.depthTextureMode & DepthTextureMode.Depth) == DepthTextureMode.None)
            {
                c.depthTextureMode |= DepthTextureMode.Depth;
            }

            CurrentCamera = c;
            CurrentCameraFrustumPlanes = GeometryUtility.CalculateFrustumPlanes(c);
            RainScript.PreCullCamera(c);
            SnowScript.PreCullCamera(c);
            HailScript.PreCullCamera(c);
            SleetScript.PreCullCamera(c);
            if (SkySphereScript != null)
            {
                SkySphereScript.PreCullCamera(c);
            }
            if (LightManagerScript != null)
            {
                LightManagerScript.UpdateLights();
            }
        }
Exemple #3
0
        private void CameraPreCull(Camera camera)
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return;
            }
#endif

            if (camera.depthTextureMode == DepthTextureMode.None)
            {
                camera.depthTextureMode = DepthTextureMode.Depth;
            }
            if (LightManagerScript != null && LightManagerScript.isActiveAndEnabled)
            {
                LightManagerScript.PreCullCamera(camera);
            }
            if (RainScript != null && RainScript.isActiveAndEnabled)
            {
                RainScript.PreCullCamera(camera);
            }
            if (SnowScript != null && SnowScript.isActiveAndEnabled)
            {
                SnowScript.PreCullCamera(camera);
            }
            if (HailScript != null && HailScript.isActiveAndEnabled)
            {
                HailScript.PreCullCamera(camera);
            }
            if (SleetScript != null && SleetScript.isActiveAndEnabled)
            {
                SleetScript.PreCullCamera(camera);
            }
            if (CustomPrecipitationScript != null && CustomPrecipitationScript.isActiveAndEnabled)
            {
                CustomPrecipitationScript.PreCullCamera(camera);
            }
            if (SkySphereScript != null && SkySphereScript.isActiveAndEnabled)
            {
                SkySphereScript.PreCullCamera(camera);
            }
            if (SkyPlaneScript != null && SkyPlaneScript.isActiveAndEnabled)
            {
                SkyPlaneScript.PreCullCamera(camera);
            }
            if (CloudScript != null && CloudScript.isActiveAndEnabled)
            {
                CloudScript.PreCullCamera(camera);
            }
            if (SnowOverlayScript != null && SnowOverlayScript.isActiveAndEnabled)
            {
                SnowOverlayScript.PreCullCamera(camera);
            }
            if (FogScript != null && FogScript.isActiveAndEnabled)
            {
                FogScript.PreCullCamera(camera);
            }
            if (LightManagerScript != null && LightManagerScript.isActiveAndEnabled)
            {
                LightManagerScript.PreCullCamera(camera);
            }
            if (CommandBufferManagerScript != null && CommandBufferManagerScript.isActiveAndEnabled)
            {
                CommandBufferManagerScript.PreCullCamera(camera);
            }
        }