[Bf-codereview] Normal Node for Cycles (issue 5440091)

dfelinto at gmail.com dfelinto at gmail.com
Fri Dec 16 01:55:33 CET 2011


the patch is trunk ready imho.


http://codereview.appspot.com/5440091/diff/5001/intern/cycles/blender/blender_shader.cpp
File intern/cycles/blender/blender_shader.cpp (right):

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/blender/blender_shader.cpp#newcode208
intern/cycles/blender/blender_shader.cpp:208: node = norm;
one option here is to create a get_node_output_normal() to move the code
from here (alas what we do for Value and RGB nodes). It works fine the
way it's though

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/kernel/osl/nodes/node_normal.osl
File intern/cycles/kernel/osl/nodes/node_normal.osl (right):

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/kernel/osl/nodes/node_normal.osl#newcode24
intern/cycles/kernel/osl/nodes/node_normal.osl:24: output normal
NormalOut = normal(0.0, 0.0, 0.0),
small remark that this (as some of other nodes) need some auto renaming
in order to work.

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/kernel/osl/nodes/node_normal.osl#newcode30
intern/cycles/kernel/osl/nodes/node_normal.osl:30: Dot = -dot(Direction,
NormalIn);
following blender original code (returning - dot). results match.

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/kernel/svm/svm_normal.h
File intern/cycles/kernel/svm/svm_normal.h (right):

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/kernel/svm/svm_normal.h#newcode27
intern/cycles/kernel/svm/svm_normal.h:27: float3 direction;
I couldn't find a way to pass the whole float3, so it came in parts (see
nodes.cpp)

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/kernel/svm/svm_normal.h#newcode38
intern/cycles/kernel/svm/svm_normal.h:38: stack_store_float(stack,
out_dot_offset, -dot(direction, normalize(normal)));
(same as OSL )following blender original code (returning - dot). results
match.

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/render/nodes.cpp
File intern/cycles/render/nodes.cpp (right):

http://codereview.appspot.com/5440091/diff/5001/intern/cycles/render/nodes.cpp#newcode743
intern/cycles/render/nodes.cpp:743: }
Is there a way to pass the whole float3 as uint4?

http://codereview.appspot.com/5440091/


More information about the Bf-codereview mailing list