Convert MBC_ API to Mesh (instead of derived mesh) and move it to mesh_render

This includes a few fixes in the MBC_ api.

The idea here is for this to be the only interface the render engines
will deal with for the meshes.

If we need to expose special options for sculpting engine we refactor
this accordingly. But for now we are shaping this in a per-case base.

Note:
* We still need to hook up to the depsgraph to force clear/update of
batch_cache when mesh changes

(I'm waiting for Sergey Sharybin's depsgraph update for this though)

* Also ideally we could/should use BMesh directly instead of
DerivedMesh, but this will do for now.

Note 2:
In the end I renamed the `BKE_mesh_render` functions to `static
mesh_render`. We can re-expose them as BKE_* later once we need it.

Reviewers: merwin

Subscribers: fclem

Differential Revision: https://developer.blender.org/D2476
This commit is contained in:
Dalai Felinto
2017-01-25 09:16:29 +01:00
parent 5be2a62ca3
commit 99cfad6a01
9 changed files with 685 additions and 365 deletions

View File

@@ -21,7 +21,7 @@ typedef enum {
READY_TO_DRAW
} BatchPhase;
typedef struct {
typedef struct Batch{
// geometry
VertexBuffer* verts;
ElementList* elem; // NULL if element list not needed