A mesh can consist out of multiple material. Take a character with clothing's. the skin can be a different material as the different clothing's. During compositing it is a common use-case to only do a part of the composit on only a specific material. Currently this can not be done.
In blender movies this feature is known to be implemented, but until now it never got integrated into trunk.
Proposal
With material index the Blender internal renderer will be capable of creating a buffer containing the material indexes of the first pixel-hit. This will be implemented in the same manner as the object index.
In the compositor the ID Mask node can be used to extract the information out of the Render pass.
Impact
User interface
On the properties-space the next changes will be done
Scene⇒Render layer⇒Passes⇒Material index will be added
Material⇒Options⇒Pass index will be added
DNA
Material struct will get an new field called “index”. this will be a short-type.
Material struct the field pad will be removed.
A new Render-layer pass will be added (bit 1«18)
RNA
Material RNA is updated (based on “pass index” from object)
Render layer RNA is updated (based on IndexOB)
Blender internal renderer
The Blender internal renderer will process the render pass as a copy of the Object index.
Blender compositor
The render layer input will get a new output socket called “IndexMA”
Usage
An example on how to use material index can be found at:
https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests/compositing/composite_materialindex.blend
This is also example of a commit message longer than the commit itself :)
=======================
Added option to baked named "Bake From Multires" which is avaliable for
normals baking and displacement baking.
If this option is enabled, then no additional hi-res meshes and render
structures would be created . This saves plenty of memory and meshes
with millions of faces could be successfully baked in few minutes.
Baking happens from highest level against viewport subdivision level,
so workflow is following:
- Set viewport level to level at which texture would be applied
during final rendering.
- Choose Displacement/Normals baking.
- Enable "Bake From Multires" option.
- You're ready to bake.
Displacement baker had aditional option named "Low Resolution Mesh".
This option is used to set if you want texture for realtime (games)
usage.
Internally it does the following:
- If it's disabled, displacement is calculated from subdivided
viewport level, so texture looks "smooth" (it's how default
baked works).
- If it's enabled, dispalcement is calculated against unsubdivided
viewport levels. This leads to "scales". This isn;t useful for
offline renders much, but very useful for creating game textures.
Special thanks to Morten Mikkelsen (aka sparky) for all mathematics
and other work he've done fr this patch!
ui/ --> startup/bl_ui
op/ --> startup/bl_operators
scripts/startup/ is now the only auto-loading script dir which gives some speedup for blender loading too.
~/.blender/2.56/scripts/startup works for auto-loading scripts too.