public void Draw(ModelEffectInstance effect)
 {
     if (m_baseVisible)
     {
         m_model.Draw(effect, m_fullTransforms, m_visibility, m_uvOffset, m_uvScale, m_fullColour);
     }
 }
        public void DrawSingleGroupWithCustomEmissiveTexture(ModelEffectInstance effect, string groupName, ITexture texture)
        {
            var groupIndex = m_model.GetGroupIndex(groupName);

            if (m_baseVisible && groupIndex >= 0 && groupIndex < m_model.GroupCount)
            {
                m_model.DrawGroup(effect, groupIndex, m_fullTransforms[groupIndex], m_uvOffset[groupIndex], m_uvScale[groupIndex], m_fullColour[groupIndex], texture);
            }
        }
Exemple #3
0
 public void Draw(ModelEffectInstance effect, Matrix4[] transforms, bool[] visibility, Vector2[] uvOffset, Vector2[] uvScale, Vector4[] colour)
 {
     for (int i = 0; i < m_groups.Count; ++i)
     {
         if (visibility[i])
         {
             DrawGroup(effect, i, transforms[i], uvOffset[i], uvScale[i], colour[i]);
         }
     }
 }
Exemple #4
0
        public void DrawGroup(ModelEffectInstance effect, int i, Matrix4 transform, Vector2 uvOffset, Vector2 uvScale, Vector4 colour, ITexture customEmissiveTexture = null)
        {
            var group    = m_groups[i];
            var material = GetGroupMaterial(i);

            effect.ModelMatrix     = transform;
            effect.UVOffset        = uvOffset;
            effect.UVScale         = uvScale;
            effect.DiffuseColour   = material.DiffuseColour.Mul(colour);
            effect.DiffuseTexture  = GetModelTexture(material.DiffuseTexture);
            effect.SpecularColour  = material.SpecularColour;
            effect.SpecularTexture = GetModelTexture(material.SpecularTexture);
            effect.NormalTexture   = GetModelTexture(material.NormalTexture);
            effect.EmissiveColour  = material.EmissiveColour;
            if (customEmissiveTexture != null)
            {
                effect.EmissiveTexture = customEmissiveTexture;
            }
            else
            {
                effect.EmissiveTexture = GetModelTexture(material.EmissiveTexture);
            }
            effect.Bind();
            group.Geometry.Draw();

            /*
             * // Wireframe test code
             * effect.ModelMatrix = transform;
             * effect.DiffuseColour = Vector4.One;
             * effect.DiffuseTexture = Texture.White;
             * effect.SpecularColour = Vector3.One;
             * effect.SpecularTexture = Texture.White;
             * effect.NormalTexture = Texture.Flat;
             * effect.Bind();
             * using( var wireframe = group.Geometry.ToWireframe( lines:false, normals:true, tangents:true, binormals:true ) )
             * {
             *  wireframe.Draw();
             * }
             */
        }