Blender Git Loki

Git Commits -> Revision a8a536d

Revision a8a536d by Dalai Felinto (master)
June 11, 2014, 05:39 (GMT)
Bake-API: new approach for cage

There is a new option to select whether you want to use cage or not.
When not using cage the results will be more similar with Blender
Internal, where the inwards rays (trying to hit the highpoly objects)
don't always come from smooth normals. So if the active object has sharp
edges and an EdgeSplit modifier you get bad corners.

This is useful, however, to bake to planes without the need of adding
extra loops around the edges.

When cage is "on" the user can decide on setting a cage extrusion or to
pick a Custom Cage object. The cage extrusion option works in a
duplicated copy of the active object with EdgeSplit modifiers removed to
inforce smooth normals. The custom cage option takes an object with the
same number of faces as the active object (and the same face ordering).

The custom cage now controls the direction and the origin of the
rays casted to the highpoly objects. The direction is a ray from the
point in the cage mesh to the equivalent point to the base mesh. That
means the face normals are entirely ignored when using a cage object.

For developers:
When using an object cage the ray is calculated from the cage mesh to
the base mesh. It uses the barycentric coordinate from the base mesh UV,
so we expect both meshes to have the same primitive ids (which won't be
the case if the cage gets edited in a destructive way).

That fixes T40023 (giving the expected result when 'use_cage' is false).

Thanks for Andy Davies (metalliandy) for the consulting with normal
baking workflow and extensive testing. His 'stress-test' file will be
added later to our svn tests folder. (The file itself is not public yet
since he still has to add testing notes to it).

Many thanks for the reviewers.

More on cages:
http://wiki.polycount.com/NormalMap/#Working_with_Cages

Reviewers: campbellbarton, sergey

CC: adriano, metalliandy, brecht, malkavian

Differential Revision: https://developer.blender.org/D547

Commit Details:

Full Hash: a8a536d23da73e3f57d54fa1f7c2276f3ca83025
Parent Commit: a08275c
Lines Changed: +174, -60

6 Modified Paths:

/intern/cycles/blender/addon/ui.py (+7, -2) (Diff)
/source/blender/editors/object/object_bake_api.c (+44, -30) (Diff)
/source/blender/makesdna/DNA_scene_types.h (+3, -2) (Diff)
/source/blender/makesrna/intern/rna_scene.c (+10, -2) (Diff)
/source/blender/render/extern/include/RE_bake.h (+2, -2) (Diff)
/source/blender/render/intern/source/bake_api.c (+108, -22) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021