This PR improves batching and also has various tiny rendering improvements:
Batching system is now able to merge meshes into one automatically, it is done when using push_triangles method. It automatically creates new batch or extends existing with a provided mesh. This significantly reduces amount of draw calls in some cases, especially in 2D rendering (Rectangle node).
Rectangle node is now emits its render data using collect_render_data method. It also does frustum culling. It now uses materials instead of just diffuse texture, which means that rectangles now could have an arbitrary material which also greatly increases rendering flexibility.
2D renderer was removed and now Rectangle node is rendered using Forward Renderer
Improved OpenGL error handling by using message callback, instead of message queue
Added standard 2D shader, that is used by Rectangle nodes by default
Removed implicit hash calculation for both vertex and triangle buffers
Switch to modification count comparison to detect changes in vertex/triangle buffers and re-upload their data to GPU if so (previous it was done using hash comparison).
Added an ability to define TTL for GPU geometry buffers.
Added normalization option for vertex attributes
Correctly pass vertex attribute divisor (it was ignored before)
Five new built-in shader variables to fetch light parameters.
This PR improves batching and also has various tiny rendering improvements:
push_triangles
method. It automatically creates new batch or extends existing with a provided mesh. This significantly reduces amount of draw calls in some cases, especially in 2D rendering (Rectangle
node).Rectangle
node is now emits its render data usingcollect_render_data
method. It also does frustum culling. It now uses materials instead of just diffuse texture, which means that rectangles now could have an arbitrary material which also greatly increases rendering flexibility.Rectangle
node is rendered using Forward RendererRectangle
nodes by default