コード例 #1
0
 public abstract void render(
     VertexBuffer vertices,
     VertexArray skinIndices,
     VertexArray skinWeights,
     Matrix[] matrixPalette,
     IndexBuffer primitives,
     AppearanceBase appearance,
     float alphaFactor);
コード例 #2
0
        protected override void duplicateTo(ref Object3D ret)
        {
            base.duplicateTo(ref ret);
            AppearanceBase appearanceBase = (AppearanceBase)ret;

            appearanceBase.setLayer(this.getLayer());
            appearanceBase.setCompositingMode(this.getCompositingMode());
            appearanceBase.setPolygonMode(this.getPolygonMode());
            appearanceBase.setLineMode(this.getLineMode());
        }
コード例 #3
0
 public override void render(
     m3g.VertexBuffer vertices,
     m3g.IndexBuffer primitives,
     AppearanceBase appearance,
     float alphaFactor)
 {
     if (appearance != this.m_cachedAppearance)
     {
         this.processApperance((Appearance)appearance);
         this.m_cachedAppearance = appearance;
     }
     this.renderIndexBuffer(primitives, vertices, alphaFactor);
 }
コード例 #4
0
        public override void render(
            m3g.VertexBuffer vertices,
            VertexArray skinIndices,
            VertexArray skinWeights,
            Matrix[] matrixPalette,
            m3g.IndexBuffer primitives,
            AppearanceBase appearance,
            float alphaFactor)
        {
            this.m_matrixPalette = matrixPalette;
            this.processVertexBufferPositionsSoftwareSkinned(vertices);
            if (appearance != this.m_cachedAppearance)
            {
                this.processApperance((Appearance)appearance);
                this.m_cachedAppearance = appearance;
            }
            ushort[]      stripLengths    = primitives.getStripLengths();
            short[]       explicitIndices = primitives.getExplicitIndices();
            bool          flag1           = primitives.isStripped();
            bool          flag2           = primitives.isImplicit();
            int           primitiveType1  = primitives.getPrimitiveType();
            PrimitiveType primitiveType2  = PrimitiveType.TriangleStrip;

            Vertex[] vertexDataTransformed = vertices.skinVertexDataTransformed;
            Effect   effect;

            if (this.alphaTest)
            {
                effect = (Effect)this.alphaTestEffect;
                this.alphaTestEffect.View       = this.viewMat;
                this.alphaTestEffect.Projection = this.projMat;
                this.alphaTestEffect.World      = this.worldMat;
                int defaultColor = vertices.getDefaultColor();
                this.alphaTestEffect.DiffuseColor       = vertices.getXnaDiffuse();
                this.alphaTestEffect.Alpha              = (float)(defaultColor >> 24 & (int)byte.MaxValue) / (float)byte.MaxValue * alphaFactor;
                this.alphaTestEffect.VertexColorEnabled = vertices.getColors() != null;
            }
            else
            {
                effect = (Effect)this.basicEffect;
                this.basicEffect.View       = this.viewMat;
                this.basicEffect.Projection = this.projMat;
                this.basicEffect.World      = this.worldMat;
                int defaultColor = vertices.getDefaultColor();
                this.basicEffect.DiffuseColor       = vertices.getXnaDiffuse();
                this.basicEffect.Alpha              = (float)(defaultColor >> 24 & (int)byte.MaxValue) / (float)byte.MaxValue * alphaFactor;
                this.basicEffect.VertexColorEnabled = vertices.getColors() != null && !this.basicEffect.TextureEnabled;
            }
            for (int index1 = 0; index1 < effect.CurrentTechnique.Passes.Count; ++index1)
            {
                effect.CurrentTechnique.Passes[index1].Apply();
                switch (primitiveType1)
                {
                case 8:
                    primitiveType2 = !flag1 ? PrimitiveType.TriangleList : PrimitiveType.TriangleStrip;
                    break;

                case 9:
                    primitiveType2 = !flag1 ? PrimitiveType.LineList : PrimitiveType.LineStrip;
                    break;

                case 10:
                    primitiveType2 = PrimitiveType.TriangleStrip;
                    if (!flag1)
                    {
                        break;
                    }
                    break;
                }
                if (flag1)
                {
                    int      length   = stripLengths.Length;
                    ushort[] numArray = stripLengths;
                    if (!flag2)
                    {
                        short[] indexData   = explicitIndices;
                        int     indexOffset = 0;
                        for (int index2 = 0; index2 < length; ++index2)
                        {
                            int num            = (int)numArray[index2];
                            int primitiveCount = 1 + (num - 3);
                            this.device.DrawUserIndexedPrimitives <Vertex>(primitiveType2, vertexDataTransformed, 0, vertices.getVertexCount(), indexData, indexOffset, primitiveCount);
                            indexOffset += num;
                        }
                    }
                    else
                    {
                        int firstIndex = primitives.getFirstIndex();
                        for (int index2 = 0; index2 < length; ++index2)
                        {
                            int num            = (int)numArray[index2];
                            int primitiveCount = 1 + (num - 3);
                            this.device.DrawUserPrimitives <Vertex>(primitiveType2, vertexDataTransformed, firstIndex, primitiveCount);
                            firstIndex += num;
                        }
                    }
                }
                else
                {
                    int primitiveCount = primitives.getPrimitiveCount();
                    if (!flag2)
                    {
                        short[] indexData = explicitIndices;
                        this.device.DrawUserIndexedPrimitives <Vertex>(primitiveType2, vertexDataTransformed, 0, vertices.getVertexCount(), indexData, 0, primitiveCount);
                    }
                    else
                    {
                        int firstIndex = primitives.getFirstIndex();
                        this.device.DrawUserPrimitives <Vertex>(primitiveType2, vertexDataTransformed, firstIndex, primitiveCount);
                    }
                }
            }
        }
コード例 #5
0
 public override void bind(int w, int h)
 {
     this.m_cachedAppearance = (AppearanceBase)null;
     this.m_cachedFog        = (Fog)null;
     this.clearEffects();
 }
コード例 #6
0
 public abstract void render(
     VertexBuffer vertices,
     IndexBuffer primitives,
     AppearanceBase appearance,
     float alphaFactor);