diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-09-16 17:14:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-09-16 17:14:02 +0400 |
commit | 66b1dfae89cc44953bd51c5da962cab437e76972 (patch) | |
tree | e7679b3e554fb4f1bb6f68775c8619bcde0da822 /intern/cycles/kernel/svm/svm_image.h | |
parent | 0a5fcf3da3e82fd114095c8c2903d927f15ffc31 (diff) |
Cycles: tweaks to properties and nodes
* Passes renamed to samples
* Camera lens radius renamed to aperature size/blades/rotation
* Glass and fresnel nodes input is now index of refraction
* Glossy and velvet fresnel socket removed
* Mix/add closure node renamed to mix/add shader node
* Blend weight node added for shader mixing weights
There is some version patching code for reading existing files, but it's not
perfect, so shaders may work a bit different.
Diffstat (limited to 'intern/cycles/kernel/svm/svm_image.h')
-rw-r--r-- | intern/cycles/kernel/svm/svm_image.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/intern/cycles/kernel/svm/svm_image.h b/intern/cycles/kernel/svm/svm_image.h index 586e35c6465..62e24166970 100644 --- a/intern/cycles/kernel/svm/svm_image.h +++ b/intern/cycles/kernel/svm/svm_image.h @@ -147,9 +147,9 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y) __device void svm_node_tex_image(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint id = node.y; - uint co_offset, out_offset, srgb; + uint co_offset, out_offset, alpha_offset, srgb; - decode_node_uchar4(node.z, &co_offset, &out_offset, &srgb, NULL); + decode_node_uchar4(node.z, &co_offset, &out_offset, &alpha_offset, &srgb); float3 co = stack_load_float3(stack, co_offset); float4 f = svm_image_texture(kg, id, co.x, co.y); @@ -161,15 +161,18 @@ __device void svm_node_tex_image(KernelGlobals *kg, ShaderData *sd, float *stack r.z = color_srgb_to_scene_linear(r.z); } - stack_store_float3(stack, out_offset, r); + if(stack_valid(out_offset)) + stack_store_float3(stack, out_offset, r); + if(stack_valid(alpha_offset)) + stack_store_float(stack, alpha_offset, f.w); } __device void svm_node_tex_environment(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node) { uint id = node.y; - uint co_offset, out_offset, srgb; + uint co_offset, out_offset, alpha_offset, srgb; - decode_node_uchar4(node.z, &co_offset, &out_offset, &srgb, NULL); + decode_node_uchar4(node.z, &co_offset, &out_offset, &alpha_offset, &srgb); float3 co = stack_load_float3(stack, co_offset); float u = (atan2f(co.y, co.x) + M_PI_F)/(2*M_PI_F); @@ -183,7 +186,10 @@ __device void svm_node_tex_environment(KernelGlobals *kg, ShaderData *sd, float r.z = color_srgb_to_scene_linear(r.z); } - stack_store_float3(stack, out_offset, r); + if(stack_valid(out_offset)) + stack_store_float3(stack, out_offset, r); + if(stack_valid(alpha_offset)) + stack_store_float(stack, alpha_offset, f.w); } CCL_NAMESPACE_END |