/// <summary> /// Setup the material and kick the vertex buffer /// Should come after <see cref="BuildVertexBuffer"/> /// </summary> /// <param name="device">The graphics device, used to rebuild vertex layouts and shaders if needed</param> /// <param name="context">The rendering context</param> /// <param name="viewMatrix">The current camera's view matrix</param> /// <param name="projMatrix">The current camera's projection matrix</param> /// <param name="color">Color scale (color shade) for all particles</param> public void KickVertexBuffer(GraphicsDevice device, RenderContext context, ref Matrix viewMatrix, ref Matrix projMatrix, Color4 color) { // Calling the method here causes mismatching vertex declarations in the EffectInputSignature (correct) and VertexAttributeLayout (wrong) if (Material.Effect != null) { vertexBuilder.CreateVAO(device, Material.Effect); } Material.Setup(device, context, viewMatrix, projMatrix, color); Material.ApplyEffect(device); vertexBuilder.Draw(device); }