Exemplo n.º 1
0
        public void DrawShadow(IndexBuffer faceGroup, int instanceCount, bool isPrelit = false)
        {
            UpdateShadowState(isPrelit);
            _context.InputAssembler.SetIndexBuffer(faceGroup.Buffer, Format.R16_UInt, 0);
            _isShadowInstanced.Set(true);

            for (int pass = 0; pass < _currentTechnique.Description.PassCount; ++pass)
            {
                _currentTechnique.GetPassByIndex(pass).Apply(_context);
                _context.DrawIndexedInstanced(faceGroup.Count, instanceCount, 0, 0, 0);
            }
        }
Exemplo n.º 2
0
        public void Draw(IndexBuffer faceGroup, int instanceCount, bool isPrelit = false, bool isFlat = false, bool isWireframe = false)
        {
            UpdateState(GetDrawingState(isPrelit, isFlat, isWireframe), GetPrimitiveTopologyState(isWireframe));
            _context.InputAssembler.SetIndexBuffer(faceGroup.Buffer, Format.R16_UInt, 0);
            _isInstanced.Set(true);

            for (int pass = 0; pass < _currentTechnique.Description.PassCount; ++pass)
            {
                _currentTechnique.GetPassByIndex(pass).Apply(_context);
                _context.DrawIndexedInstanced(faceGroup.Count, instanceCount, 0, 0, 0);
            }
        }