examples/RenderStack/example.Sandbox/Store/AmbientOcclusion.cs
/// <summary>
/// Updates ambient occlusion for all models in receivers group
/// </summary>
Updates ambient occlusion for all models in receivers group
Updates ambient occlusion for all models in receivers group
public void UpdateAmbientOcclusion(Group receivers, Group occluders)
        {
            string pointNormalsName = "point_normals_for_ambient_occlusion";
            {
                foreach(var model in receivers.Models)
                {
                    GeometryMesh mesh = model.Batch.MeshSource as GeometryMesh;
                    if(mesh != null)
                    {
                        Geometry geometry = mesh.Geometry;
                        geometry.ComputePointNormals(pointNormalsName);
                    }
                }
                foreach(var model in receivers.Models)
                {
                    UpdateAmbientOcclusionModel(model, occluders);
                }
            }
        }
public void UpdateAmbientOcclusion ( Group receivers , Group occluders ) { string pointNormalsName = " " ; { foreach ( var model in receivers . Models ) { GeometryMesh mesh = model . Batch . MeshSource as GeometryMesh ; if ( mesh != null ) { Geometry geometry = mesh . Geometry ; geometry . ComputePointNormals ( pointNormalsName ) ; } } foreach ( var model in receivers . Models ) { UpdateAmbientOcclusionModel ( model , occluders ) ; } } }
Updates ambient occlusion for all models in receivers group
Updates ambient occlusion for all models in receivers group
//updateMsg = "ComputePointNormals for " + i + " / " + receivers.Models.Count; //OnRenderFrame(null); //renderer.PartialGLStateResetToDefaults(); //aoHemicubeRenderer.ProgramOverride = renderer.Programs["LightOccluder"]; //updateMsg = "UpdateAmbientOcclusion for " + i + " / " + receivers.Models.Count; //OnRenderFrame(null); //updateMsg = "";
receivers
Group
occluders
Group