コード例 #1
0
        public override void Render(MasterRenderer renderer)
        {
            RenderableChunks = 0;
            CulledChunks     = 0;
            int unfinished = 0;

            foreach (Chunk chunk in Chunks.Values)
            {
                if (chunk.State != ChunkState.Renderable)
                {
                    unfinished++;
                }

                if ((chunk.State == ChunkState.Renderable || chunk.State > ChunkState.Unshaped) && !chunk.IsEmpty &&
                    CullingFrustum.Intersects(chunk.BoundingBox))
                {
                    RenderableChunks++;
                    chunk.Culled = false;
                }
                else
                {
                    CulledChunks++;
                    chunk.Culled = true;
                }

                chunkRenderer.Batch(chunk);
            }

            UnfinishedChunks = unfinished;
        }
コード例 #2
0
ファイル: CullVisitor.cs プロジェクト: mellinoe/nexscenegraph
        private bool IsCulled(IBoundingBox bb, Matrix4x4 modelMatrix)
        {
            var culled = !CullingFrustum.Contains(bb, modelMatrix);

            return(culled);
        }
コード例 #3
0
ファイル: CullVisitor.cs プロジェクト: mellinoe/nexscenegraph
        public void Prepare()
        {
            var vp = ViewMatrix.PostMultiply(ProjectionMatrix);

            CullingFrustum.SetViewProjectionMatrix(vp);
        }