Blender 2.8: Mesh Auto-Smooth Split Normal Support
AbandonedPublic

Authored by Germano Cavalcante (mano-wii) on Oct 31 2017, 1:04 PM.

Details

Summary

This is a partial solution to the task T51604.

Only suports auto-smooth for Meshs (not Edit-Meshs)

A special attention must be paid to rdata->poly_normals. It may be better to use a CustomData than to allocate and release every time that the smoot_angle changes.

Other more efficient solutions could be:

  • Update VBO only;
  • Use the glBufferSubData to update just a subset of the object's buffer data;

Feel free to edit and/or commit the patch ;)

Diff Detail

Repository
rB Blender

Generally LGTM, one concern.

source/blender/draw/intern/draw_cache_impl_mesh.c
460

Are you sure this isn't saved into the file?

I think you may need to set CD_FLAG_TEMPORARY

Committed rB59f238ba0911
(with some changes)

A comment on the final committed code:
If the comment: /* TODO: split normals, see below */ is no longer relevant, please get rid of it.