Пример #1
0
        public override void OnSceneManagementGetObjectsForCamera( Camera camera,
			List<SceneNode> outSceneNodes, List<StaticMeshObject> outStaticMeshObjects, List<RenderLight> outLights )
        {
            RenderLight shadowGenerationLight = null;
            if( camera.IsForShadowMapGeneration() )
                shadowGenerationLight = camera.GetShadowMapGenerationLight();

            if( shadowGenerationLight != null )
            {
                //shadow generation

                int directionalLightPSSMTextureIndex = 0;
                Vec3 pointLightFaceDirection = Vec3.Zero;
                if( shadowGenerationLight.Type == RenderLightType.Directional && SceneManager.Instance.IsShadowTechniquePSSM() )
                    directionalLightPSSMTextureIndex = camera.GetDirectionalLightPSSMTextureIndex();
                if( shadowGenerationLight.Type == RenderLightType.Point && SceneManager.Instance.IsShadowTechniqueShadowmapBased() )
                    pointLightFaceDirection = camera.Direction;

                GetShadowCastersForLight( SceneManager.Instance.CurrentUpdatingCamera, shadowGenerationLight,
                    directionalLightPSSMTextureIndex, pointLightFaceDirection, outSceneNodes, outStaticMeshObjects );
            }
            else
            {
                //usual camera

                GetObjectsForUsualCamera( camera, outSceneNodes, outStaticMeshObjects, outLights );
            }

            //add objects never culled by the frustum
            if( SceneManager.Instance.OverrideVisibleObjects == null && Map.Instance != null )
            {
                Map.Instance.Walk_AddObjectsWithDisabled_AllowSceneManagementCulling_Property( shadowGenerationLight != null,
                    outSceneNodes, outStaticMeshObjects, outLights );
            }
        }