コード例 #1
0
        /// <summary>
        /// BlockMesh をロードします。
        /// </summary>
        void LoadBlockMesh()
        {
            var blockLoader = new StringBlockLoader(blockData);

            var meshFactory = new BlockMeshFactory(GraphicsDevice);

            meshManager = new BlockMeshManager(blockLoader, meshFactory);

            // 通常の IBlockEffect をロードします。
            blockEffect = new BasicBlockEffect(GraphicsDevice);
            blockEffect.EnableDefaultLighting();

            // インスタンシング用の IBlockEffect をロードします。
            var instancingEffect = Content.Load <Effect>("Effects/Instancing");

            instancingBlockEffect = new InstancingBlockEffect(instancingEffect);
            instancingBlockEffect.EnableDefaultLighting();

            // 実際のアプリケーションではファイルの Block から BlockMesh をロードします。
            // BlockMesh をロードします。
            mesh = meshManager.Load("Dummy", lodCount);
        }
コード例 #2
0
        /// <summary>
        /// BlockMesh をロードします。
        /// </summary>
        void LoadBlockMesh()
        {
            var blockLoader = new StringBlockLoader(blockData);

            var meshFactory = new BlockMeshFactory(GraphicsDevice);
            meshManager = new BlockMeshManager(blockLoader, meshFactory);

            // 通常の IBlockEffect をロードします。
            blockEffect = new BasicBlockEffect(GraphicsDevice);
            blockEffect.EnableDefaultLighting();

            // インスタンシング用の IBlockEffect をロードします。
            var instancingEffect = Content.Load<Effect>("Effects/Instancing");
            instancingBlockEffect = new InstancingBlockEffect(instancingEffect);
            instancingBlockEffect.EnableDefaultLighting();

            // 実際のアプリケーションではファイルの Block から BlockMesh をロードします。
            // BlockMesh をロードします。
            mesh = meshManager.Load("Dummy", lodCount);
        }