public void Draw(_Camera camera) { this.device.SetVertexBuffer(this.buffer); this.effect.CurrentTechnique = effect.Techniques["Technique1"]; effect.Parameters["World"].SetValue(world); effect.Parameters["View"].SetValue(camera.GetView()); effect.Parameters["Projection"].SetValue(camera.GetProjection()); effect.Parameters["colorTexture"].SetValue(texture); effect.Parameters["colorTextureSnow"].SetValue(this.snowTexture); effect.Parameters["counter"].SetValue(counter); foreach (EffectPass pass in this.effect.CurrentTechnique.Passes) { pass.Apply(); this.device.DrawUserPrimitives <VertexPositionTexture>(PrimitiveType.TriangleList, this.verts, 0, this.verts.Length / 3); } }
public void Draw(_Camera camera) { this.device.SetVertexBuffer(this.buffer); this.device.BlendState = BlendState.AlphaBlend; this.device.Indices = this.iBuffer; this.effect.CurrentTechnique = effect.Techniques["Technique1"]; this.effect.Parameters["World"].SetValue(world); this.effect.Parameters["View"].SetValue(camera.GetView()); this.effect.Parameters["Projection"].SetValue(camera.GetProjection()); this.effect.Parameters["time"].SetValue(this.time); this.effect.Parameters["colorTexture"].SetValue(seaTexture); foreach (EffectPass pass in this.effect.CurrentTechnique.Passes) { pass.Apply(); //device.DrawUserIndexedPrimitives<VertexPositionTexture>(PrimitiveType.TriangleList, this.verts, 0, this.verts.Length, this.index, 0, 2); device.DrawUserIndexedPrimitives <VertexPositionTexture>(PrimitiveType.TriangleList, this.verts, 0, verts.Length, this.indexes, 0, this.indexes.Length / 3); } }
public void Draw(_Camera camera) { this.effect.CurrentTechnique = this.effect.Techniques["Technique1"]; this.effect.Parameters["World"].SetValue(this.world); this.effect.Parameters["View"].SetValue(camera.GetView()); this.effect.Parameters["Projection"].SetValue(camera.GetProjection()); this.effect.Parameters["colorTexture"].SetValue(this.grassTexture); this.effect.Parameters["colorTextureSnow"].SetValue(this.snowGrassTexture); this.effect.Parameters["counter"].SetValue(counter); foreach (EffectPass pass in this.effect.CurrentTechnique.Passes) { pass.Apply(); this.device.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, this.verts, 0, this.verts.Length, this.indexes, 0, this.indexes.Length / 3); } }