예제 #1
0
 public void Draw(Program program, IChannelAttributeSource channelAttributes, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix, IModelMaterialBinder materialBinder)
 {
     if (channelAttributes != null)
     {
         BindAttributes(channelAttributes);
     }
     Draw(program, ref world, setWorldMatrix, materialBinder);
 }
예제 #2
0
 public void Draw(Program program, IChannelAttributeSource channelAttributes, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix, IModelMaterialBinder materialBinder)
 {
     if (channelAttributes != null)
         BindAttributes(channelAttributes);
     Draw(program, ref world, setWorldMatrix, materialBinder);
 }
예제 #3
0
        public void Draw(Program program, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix, IModelMaterialBinder materialBinder)
        {
            ModelMaterial material = null;

            foreach (ModelMesh mesh in meshes)
            {
                if (setWorldMatrix != null)
                {
                    Matrix4d meshWorld;

                    if (mesh.bone != null)
                    {
                        mesh.bone.GetWorldTransform(out meshWorld);
                        world.Multiply(ref meshWorld, out meshWorld);
                        setWorldMatrix.Invoke(ref meshWorld);
                    }
                }

                foreach (ModelPart part in mesh.parts)
                {
                    if (part.Material != null && part.Material != material && materialBinder != null)
                    {
                        material = part.Material;
                        materialBinder.BindMaterial(part.Material);
                    }

                    program.Draw(part.Primitive, part.Count, elementBuffer, elementType, part.Offset);
                }
            }
        }
예제 #4
0
        public void Draw(Program program, ref Matrix4d world, SetWorldMatrixCallback setWorldMatrix, IModelMaterialBinder materialBinder)
        {
            ModelMaterial material = null;

            foreach (ModelMesh mesh in meshes) {
                if (setWorldMatrix != null) {
                    Matrix4d meshWorld;

                    if (mesh.bone != null) {
                        mesh.bone.GetWorldTransform(out meshWorld);
                        world.Multiply(ref meshWorld, out meshWorld);
                        setWorldMatrix.Invoke(ref meshWorld);
                    }
                }

                foreach (ModelPart part in mesh.parts) {
                    if (part.Material != null && part.Material != material && materialBinder != null) {
                        material = part.Material;
                        materialBinder.BindMaterial(part.Material);
                    }

                    program.Draw(part.Primitive, part.Count, elementBuffer, elementType, part.Offset);
                }
            }
        }