diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-28 04:54:44 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-28 19:57:02 +0400 |
commit | a35db17cee5a9b47dc9624f7dfcb41f5fc185b33 (patch) | |
tree | ef23032da73b9b202490307f865e2afd4e2e7e76 /source/blender/nodes/shader | |
parent | a06c9c277a8577f7ef473fffaf2258d2a3a6ab80 (diff) |
Cycles Volume Render: work on nodes and closures.
* Henyey-Greenstein scattering closure implementation.
* Rename transparent to absorption node and isotropic to scatter node.
* Volume density is folded into the closure weights.
* OSL support for volume closures and nodes.
* This commit has no user visible changes, there is no volume render code yet.
This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_volume_absorption.c (renamed from source/blender/nodes/shader/nodes/node_shader_volume_transparent.c) | 14 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_volume_scatter.c (renamed from source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c) | 16 |
2 files changed, 16 insertions, 14 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c b/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c index 31009a3585a..a271162bd19 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_transparent.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_absorption.c @@ -29,33 +29,33 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_volume_transparent_in[] = { +static bNodeSocketTemplate sh_node_volume_absorption_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Density"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_volume_transparent_out[] = { +static bNodeSocketTemplate sh_node_volume_absorption_out[] = { { SOCK_SHADER, 0, N_("Volume")}, { -1, 0, "" } }; -static int node_shader_gpu_volume_transparent(GPUMaterial *UNUSED(mat), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *UNUSED(in), GPUNodeStack *UNUSED(out)) +static int node_shader_gpu_volume_absorption(GPUMaterial *UNUSED(mat), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *UNUSED(in), GPUNodeStack *UNUSED(out)) { return 0; } /* node type definition */ -void register_node_type_sh_volume_transparent(void) +void register_node_type_sh_volume_absorption(void) { static bNodeType ntype; - sh_node_type_base(&ntype, SH_NODE_VOLUME_TRANSPARENT, "Transparent Volume", NODE_CLASS_SHADER, 0); + sh_node_type_base(&ntype, SH_NODE_VOLUME_ABSORPTION, "Volume Absorption", NODE_CLASS_SHADER, 0); node_type_compatibility(&ntype, NODE_NEW_SHADING); - node_type_socket_templates(&ntype, sh_node_volume_transparent_in, sh_node_volume_transparent_out); + node_type_socket_templates(&ntype, sh_node_volume_absorption_in, sh_node_volume_absorption_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); - node_type_gpu(&ntype, node_shader_gpu_volume_transparent); + node_type_gpu(&ntype, node_shader_gpu_volume_absorption); nodeRegisterType(&ntype); } diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c b/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c index ef9fe014aa3..cb1377348e5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_volume_isotropic.c +++ b/source/blender/nodes/shader/nodes/node_shader_volume_scatter.c @@ -29,33 +29,35 @@ /* **************** OUTPUT ******************** */ -static bNodeSocketTemplate sh_node_volume_isotropic_in[] = { +static bNodeSocketTemplate sh_node_volume_scatter_in[] = { { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, { SOCK_FLOAT, 1, N_("Density"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, + { SOCK_FLOAT, 1, N_("Anisotropy"),0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f}, { -1, 0, "" } }; -static bNodeSocketTemplate sh_node_volume_isotropic_out[] = { +static bNodeSocketTemplate sh_node_volume_scatter_out[] = { { SOCK_SHADER, 0, N_("Volume")}, { -1, 0, "" } }; -static int node_shader_gpu_volume_isotropic(GPUMaterial *UNUSED(mat), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *UNUSED(in), GPUNodeStack *UNUSED(out)) +static int node_shader_gpu_volume_scatter(GPUMaterial *UNUSED(mat), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *UNUSED(in), GPUNodeStack *UNUSED(out)) { return 0; } /* node type definition */ -void register_node_type_sh_volume_isotropic(void) +void register_node_type_sh_volume_scatter(void) { static bNodeType ntype; - sh_node_type_base(&ntype, SH_NODE_VOLUME_ISOTROPIC, "Isotropic Volume", NODE_CLASS_SHADER, 0); + sh_node_type_base(&ntype, SH_NODE_VOLUME_SCATTER, "Volume Scatter", NODE_CLASS_SHADER, 0); node_type_compatibility(&ntype, NODE_NEW_SHADING); - node_type_socket_templates(&ntype, sh_node_volume_isotropic_in, sh_node_volume_isotropic_out); + node_type_socket_templates(&ntype, sh_node_volume_scatter_in, sh_node_volume_scatter_out); node_type_init(&ntype, NULL); node_type_storage(&ntype, "", NULL, NULL); - node_type_gpu(&ntype, node_shader_gpu_volume_isotropic); + node_type_gpu(&ntype, node_shader_gpu_volume_scatter); nodeRegisterType(&ntype); } + |