public void Submit(IShader shader, IVertexArray vertexArray) { shader.Bind(); shader.SetMat4("viewProjection", _viewProjection); vertexArray.Bind(); _renderContext.Draw(vertexArray); }
/// <summary> /// Submit something to be drawn /// </summary> /// <param name="shader"></param> /// <param name="vertexArray"></param> /// <param name="transform"></param> public static void Submit(IShader shader, IVertexArray vertexArray, Matrix4x4 transform) { shader.Bind(); shader.SetMat4("u_ViewProjection", sceneData.ViewProjectionMatrix); shader.SetMat4("u_Transform", transform); vertexArray.Bind(); RenderingAPI.DrawIndexed(vertexArray); }
private void Flush(int submissionCount = MaxSubmissions) { _vertexArray.VertexBuffer.AddData(_submissions.ToArray()); _submissions.Clear(); _objectShader.Bind(); _objectShader.SetMat4("viewProjection", _viewProjection); foreach (var(texture, slot) in _textures) { texture.Bind(slot); } _textures.Clear(); _vertexArray.Bind(true); _renderContext.Draw(_vertexArray, submissionCount * IndicesInSubmission); }