public void Draw(BaseShader effect) { foreach (EffectPass pass in effect.Technique.CurrentTechnique.Passes) { pass.Apply(); ContentLoader.SetBuffers(ibo, vbo); } }
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); }
public void Draw(BaseShader shader) { Instancer.Draw(shader); }
public ObjectMesh(string assetname, BaseShader effect) : base() { fbx = LoadModel(assetname, effect.Technique); }