Exemple #1
0
 public void Draw(BaseShader effect)
 {
     foreach (EffectPass pass in effect.Technique.CurrentTechnique.Passes)
     {
         pass.Apply();
         ContentLoader.SetBuffers(ibo, vbo);
     }
 }
Exemple #2
0
        public void Draw(BaseShader shader)
        {
            if ((instanceVertexBuffer == null) || (instanceTransformMatrices.Count != instanceVertexBuffer.VertexCount))
                CalcVertexBuffer();

            BaseClass.Device.BlendState = thisBlendState;
            BaseClass.Device.DepthStencilState = DepthStencilState.None;

            shader.Technique.CurrentTechnique.Passes[0].Apply();

            BaseClass.Device.SetVertexBuffers(
                       new VertexBufferBinding(modelVertexBuffer, 0, 0),
                       new VertexBufferBinding(instanceVertexBuffer, 0, 1)
                   );

            BaseClass.Device.Indices = indexBuffer;
            BaseClass.Device.DrawInstancedPrimitives(PrimitiveType.TriangleList, 0, 0,
                                                   modelVertexBuffer.VertexCount, 0,
                                                   2,
                                                   instanceTransformMatrices.Count);
        }
Exemple #3
0
 public void Draw(BaseShader shader)
 {
     Instancer.Draw(shader);
 }
Exemple #4
0
 public ObjectMesh(string assetname, BaseShader effect)
     : base()
 {
     fbx = LoadModel(assetname, effect.Technique);
 }