diff options
author | Thomas Dinges <blender@dingto.org> | 2013-08-17 20:08:03 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-08-17 20:08:03 +0400 |
commit | 8b955e9b19dd8616f61c27d5e9d2d80d66dacd96 (patch) | |
tree | 40522b399fd3cfaba1f546daf713c9f79ade08d7 /source | |
parent | 0786eebd1194b108d71299137c715b10e100d8f5 (diff) |
Cycles / Sky Model:
* Replaced the Preetham model with the newer Hosek / Wilkie model:
"An Analytic Model for Full Spectral Sky-Dome Radiance" http://cgg.mff.cuni.cz/projects/SkylightModelling/
* We use the sample code data, which comes with the paper, but removed some unnecessary parts, we only need the xyz version.
* New "Albedo" UI paraemeter, to control the ground albedo (between 0 and 1).
* Works with SVM only atm (CPU and CUDA).
Example render:
http://www.pasteall.org/pic/show.php?id=57635
ToDo / Open Questions:
* OSL still uses the old model, will be done later. In the meantime it's useful to compare the two models this way.
* The new model needs a much weaker Strength value (0.01), otherwise it's white. Can this be fixed?
* Code cleanup.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 5 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_tex_sky.c | 1 |
4 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 5cc22b25f72..7c35ec1fb00 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -812,6 +812,7 @@ static void node_shader_buts_tex_sky(uiLayout *layout, bContext *UNUSED(C), Poin { uiItemR(layout, ptr, "sun_direction", 0, "", ICON_NONE); uiItemR(layout, ptr, "turbidity", 0, NULL, ICON_NONE); + uiItemR(layout, ptr, "albedo", 0, NULL, ICON_NONE); } static void node_shader_buts_tex_gradient(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index 109cdf5f1a1..05ae1b241ab 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -722,6 +722,7 @@ typedef struct NodeTexSky { NodeTexBase base; float sun_direction[3]; float turbidity; + float albedo; } NodeTexSky; typedef struct NodeTexImage { diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 3b594ab0961..a23a7fa998f 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3243,6 +3243,11 @@ static void def_sh_tex_sky(StructRNA *srna) RNA_def_property_range(prop, 1.0f, 30.0f); RNA_def_property_ui_text(prop, "Turbidity", "Atmospheric turbidity"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "albedo", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Albedo", "Ground albedo"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); } static void def_sh_tex_environment(StructRNA *srna) diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c index f9cd4b72912..c31255e201a 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.c @@ -48,6 +48,7 @@ static void node_shader_init_tex_sky(bNodeTree *UNUSED(ntree), bNode *node) tex->sun_direction[1] = 0.0f; tex->sun_direction[2] = 1.0f; tex->turbidity = 2.2f; + tex->albedo = 0.3f; node->storage = tex; } |