diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-28 19:56:19 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-28 19:57:10 +0400 |
commit | e369a5c48529864118d49222dde3d530d58ebeae (patch) | |
tree | 8d803e5318c57b7bfbdd321da1393e4d71878d35 /source/blender/editors/space_node | |
parent | 133f770ab3e7a6db49562cb73cb7aa5f75cf13f8 (diff) |
Cycles Volume Render: support for rendering of homogeneous volume with absorption.
This is the simplest possible volume rendering case, constant density inside
the volume and no scattering or emission. My plan is to tweak, verify and commit
more volume rendering effects one by one, doing it all at once makes it
difficult to verify correctness and track down bugs.
Documentation is here:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Materials/Volume
Currently this hooks into path tracing in 3 ways, which should get us pretty
far until we add more advanced light sampling. These 3 hooks are repeated in
the path tracing, branched path tracing and transparent shadow code:
* Determine active volume shader at start of the path
* Change active volume shader on transmission through a surface
* Light attenuation over line segments between camera, surfaces and background
This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index da599f8608d..f7628375a30 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -921,6 +921,21 @@ static void node_shader_buts_subsurface(uiLayout *layout, bContext *C, PointerRN uiItemR(layout, ptr, "falloff", 0, "", ICON_NONE); } + +static void node_shader_buts_volume(uiLayout *layout, bContext *C, PointerRNA *UNUSED(ptr)) +{ + /* SSS does not work on GPU yet */ + PointerRNA scene = CTX_data_pointer_get(C, "scene"); + if (scene.data) { + PointerRNA cscene = RNA_pointer_get(&scene, "cycles"); + + if (cscene.data && RNA_enum_get(&cscene, "device") == 1) + uiItemL(layout, IFACE_("Volumes not supported on GPU"), ICON_ERROR); + else + uiItemL(layout, IFACE_("Volumes are work in progress"), ICON_ERROR); + } +} + static void node_shader_buts_toon(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "component", 0, "", ICON_NONE); @@ -1064,6 +1079,12 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_SUBSURFACE_SCATTERING: ntype->draw_buttons = node_shader_buts_subsurface; break; + case SH_NODE_VOLUME_SCATTER: + ntype->draw_buttons = node_shader_buts_volume; + break; + case SH_NODE_VOLUME_ABSORPTION: + ntype->draw_buttons = node_shader_buts_volume; + break; case SH_NODE_BSDF_TOON: ntype->draw_buttons = node_shader_buts_toon; break; |