diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-13 16:20:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-13 16:20:47 +0300 |
commit | 37f65e9dc4bcfa5225a114feabac753e342bb201 (patch) | |
tree | 0d5f08e60de8c40c940dcb806e20a97bafdff667 /intern/cycles/kernel | |
parent | d640ce40aa9e472613cac22ecbc7655db9c27201 (diff) |
Cycles: Implement index output for hair node
This is like the only way to add variety to hair which is created
using simple children. Used here for the hair.
Maybe not ideal, but the time will show.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r-- | intern/cycles/kernel/kernel_types.h | 1 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/node_hair_info.osl | 4 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_geometry.h | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_types.h | 3 |
4 files changed, 8 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h index cd3b450932f..0bb5873e75c 100644 --- a/intern/cycles/kernel/kernel_types.h +++ b/intern/cycles/kernel/kernel_types.h @@ -772,6 +772,7 @@ typedef enum AttributeStandard { ATTR_STD_MOTION_VERTEX_NORMAL, ATTR_STD_PARTICLE, ATTR_STD_CURVE_INTERCEPT, + ATTR_STD_CURVE_INDEX, ATTR_STD_PTEX_FACE_ID, ATTR_STD_PTEX_UV, ATTR_STD_VOLUME_DENSITY, diff --git a/intern/cycles/kernel/shaders/node_hair_info.osl b/intern/cycles/kernel/shaders/node_hair_info.osl index 965d2a3c7f7..79995bdbfc3 100644 --- a/intern/cycles/kernel/shaders/node_hair_info.osl +++ b/intern/cycles/kernel/shaders/node_hair_info.osl @@ -20,11 +20,13 @@ shader node_hair_info( output float IsStrand = 0.0, output float Intercept = 0.0, output float Thickness = 0.0, - output normal TangentNormal = N) + output normal TangentNormal = N, + output float Index = 0) { getattribute("geom:is_curve", IsStrand); getattribute("geom:curve_intercept", Intercept); getattribute("geom:curve_thickness", Thickness); getattribute("geom:curve_tangent_normal", TangentNormal); + getattribute("geom:curve_index", Index); } diff --git a/intern/cycles/kernel/svm/svm_geometry.h b/intern/cycles/kernel/svm/svm_geometry.h index 9af4a0182d9..6c88d150b60 100644 --- a/intern/cycles/kernel/svm/svm_geometry.h +++ b/intern/cycles/kernel/svm/svm_geometry.h @@ -180,6 +180,8 @@ ccl_device void svm_node_hair_info(KernelGlobals *kg, } case NODE_INFO_CURVE_INTERCEPT: break; /* handled as attribute */ + case NODE_INFO_CURVE_INDEX: + break; /* handled as attribute */ case NODE_INFO_CURVE_THICKNESS: { data = curve_thickness(kg, sd); stack_store_float(stack, out_offset, data); diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h index c0ce0f52cd0..b3a2cf6e9ae 100644 --- a/intern/cycles/kernel/svm/svm_types.h +++ b/intern/cycles/kernel/svm/svm_types.h @@ -176,7 +176,8 @@ typedef enum NodeHairInfo { NODE_INFO_CURVE_THICKNESS, /*fade for minimum hair width transpency*/ /*NODE_INFO_CURVE_FADE,*/ - NODE_INFO_CURVE_TANGENT_NORMAL + NODE_INFO_CURVE_TANGENT_NORMAL, + NODE_INFO_CURVE_INDEX, } NodeHairInfo; typedef enum NodeLightPath { |