Hey man, nice going. I do detect a problem with node materials. I
believe the MatID should be in Render Pipeline Options for node
materials and affect the entire node shader. See why in this blend
http://www.pasteall.org/blend/7439
cheers!
Daniel Salazar
3Developer.com
On Mon, Jul 4, 2011 at 12:14 PM, Jeroen Bakker j.bak...@atmind.nl wrote:
Revision: 38090
http://projects.blender.org/scm/viewvc.php?view=revroot=bf-blenderrevision=38090
Author: jbakker
Date: 2011-07-04 18:14:41 + (Mon, 04 Jul 2011)
Log Message:
---
Current situation
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?\226?\135?\146Render
layer?\226?\135?\146Passes?\226?\135?\146Material index will be added
Material?\226?\135?\146Options?\226?\135?\146Pass index will be added
DNA
Material struct will get an new field called
?\226?\128?\156index?\226?\128?\157. this will be a short-type.
Material struct the field pad will be removed.
A new Render-layer pass will be added (bit 1?\194?\17118)
RNA
Material RNA is updated (based on ?\226?\128?\156pass index?\226?\128?\157
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
?\226?\128?\156IndexMA?\226?\128?\157
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 :)
Modified Paths:
--
trunk/blender/release/scripts/startup/bl_ui/properties_material.py
trunk/blender/release/scripts/startup/bl_ui/properties_render.py
trunk/blender/source/blender/blenkernel/BKE_node.h
trunk/blender/source/blender/blenkernel/intern/node.c
trunk/blender/source/blender/editors/space_outliner/outliner.c
trunk/blender/source/blender/makesdna/DNA_material_types.h
trunk/blender/source/blender/makesdna/DNA_scene_types.h
trunk/blender/source/blender/makesrna/intern/rna_material.c
trunk/blender/source/blender/makesrna/intern/rna_render.c
trunk/blender/source/blender/makesrna/intern/rna_scene.c
trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_image.c
trunk/blender/source/blender/render/intern/source/pipeline.c
trunk/blender/source/blender/render/intern/source/rendercore.c
trunk/blender/source/blender/render/intern/source/shadeinput.c
trunk/blender/source/blender/render/intern/source/zbuf.c
Modified: trunk/blender/release/scripts/startup/bl_ui/properties_material.py
===
--- trunk/blender/release/scripts/startup/bl_ui/properties_material.py
2011-07-04 18:11:41 UTC (rev 38089)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_material.py
2011-07-04 18:14:41 UTC (rev 38090)
@@ -729,6 +729,7 @@
col.prop(mat, use_vertex_color_paint)
col.prop(mat, use_vertex_color_light)
col.prop(mat, use_object_color)
+ col.prop(mat, pass_index)
class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel):
Modified: trunk/blender/release/scripts/startup/bl_ui/properties_render.py
===
--- trunk/blender/release/scripts/startup/bl_ui/properties_render.py
2011-07-04 18:11:41 UTC (rev 38089)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_render.py
2011-07-04 18:14:41 UTC (rev 38090)
@@ -141,6 +141,7 @@
col.prop(rl, use_pass_uv)
col.prop(rl, use_pass_mist)
col.prop(rl, use_pass_object_index)
+ col.prop(rl, use_pass_material_index)
col.prop(rl, use_pass_color)
col = split.column()
Modified: trunk/blender/source/blender/blenkernel/BKE_node.h
===
--- trunk/blender/source/blender/blenkernel/BKE_node.h 2011-07-04 18:11:41
UTC (rev 38089)
+++ trunk/blender/source/blender/blenkernel/BKE_node.h 2011-07-04 18:14:41
UTC