Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-28 04:54:44 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-28 19:57:02 +0400
commita35db17cee5a9b47dc9624f7dfcb41f5fc185b33 (patch)
treeef23032da73b9b202490307f865e2afd4e2e7e76 /intern/cycles/kernel/osl/osl_closures.cpp
parenta06c9c277a8577f7ef473fffaf2258d2a3a6ab80 (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 'intern/cycles/kernel/osl/osl_closures.cpp')
-rw-r--r--intern/cycles/kernel/osl/osl_closures.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp
index 340e4492584..a96c0e2b1fb 100644
--- a/intern/cycles/kernel/osl/osl_closures.cpp
+++ b/intern/cycles/kernel/osl/osl_closures.cpp
@@ -55,6 +55,7 @@
#include "closure/bsdf_westin.h"
#include "closure/bsdf_toon.h"
#include "closure/bsdf_hair.h"
+#include "closure/volume.h"
CCL_NAMESPACE_BEGIN
@@ -169,6 +170,13 @@ BSDF_CLOSURE_CLASS_BEGIN(HairTransmission, hair_transmission, hair_transmission,
#endif
BSDF_CLOSURE_CLASS_END(HairTransmission, hair_transmission)
+VOLUME_CLOSURE_CLASS_BEGIN(VolumeHenyeyGreenstein, henyey_greenstein, LABEL_VOLUME_SCATTER)
+ CLOSURE_FLOAT_PARAM(VolumeHenyeyGreensteinClosure, sc.data0),
+VOLUME_CLOSURE_CLASS_END(VolumeHenyeyGreenstein, henyey_greenstein)
+
+VOLUME_CLOSURE_CLASS_BEGIN(VolumeAbsorption, absorption, LABEL_SINGULAR)
+VOLUME_CLOSURE_CLASS_END(VolumeAbsorption, absorption)
+
/* Registration */
static void register_closure(OSL::ShadingSystem *ss, const char *name, int id, OSL::ClosureParam *params, OSL::PrepareClosureFunc prepare)
@@ -248,6 +256,11 @@ void OSLShader::register_closures(OSLShadingSystem *ss_)
bsdf_hair_reflection_params(), bsdf_hair_reflection_prepare);
register_closure(ss, "hair_transmission", id++,
bsdf_hair_transmission_params(), bsdf_hair_transmission_prepare);
+
+ register_closure(ss, "henyey_greenstein", id++,
+ volume_henyey_greenstein_params(), volume_henyey_greenstein_prepare);
+ register_closure(ss, "absorption", id++,
+ volume_absorption_params(), volume_absorption_prepare);
}
CCL_NAMESPACE_END