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@pandora.be>2012-10-20 16:18:00 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-10-20 16:18:00 +0400
commit9a1c1f132de971a840816614a0f4657ef1c12c89 (patch)
treeba7a0e493733275cb2df1855b69b36452322bf28 /intern/cycles/kernel/closure/volume.h
parent3abef3a2e6b77949f2e992baefd660422e3e19fe (diff)
Cycles OSL: most closure code is now shared between OSL and SVM. Also fix
transmission pass and filter glossy option. The BSDF closure class is now more similar to the SVM closures, and includes some flags and labels that are needed to properly categorize the BSDF's for render passes. Phong closure is gone for the moment, needs to be adapated to the new structure still.
Diffstat (limited to 'intern/cycles/kernel/closure/volume.h')
-rw-r--r--intern/cycles/kernel/closure/volume.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/intern/cycles/kernel/closure/volume.h b/intern/cycles/kernel/closure/volume.h
new file mode 100644
index 00000000000..734f9111ab6
--- /dev/null
+++ b/intern/cycles/kernel/closure/volume.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+CCL_NAMESPACE_BEGIN
+
+/* note: the interfaces here are just as an example, need to figure
+ * out the right functions and parameters to use */
+
+/* ISOTROPIC VOLUME CLOSURE */
+
+__device int volume_isotropic_setup(ShaderClosure *sc, float density)
+{
+ sc->type = CLOSURE_VOLUME_ISOTROPIC_ID;
+ sc->data0 = density;
+
+ return SD_VOLUME;
+}
+
+__device float3 volume_isotropic_eval_phase(const ShaderClosure *sc, const float3 omega_in, const float3 omega_out)
+{
+ return make_float3(1.0f, 1.0f, 1.0f);
+}
+
+/* TRANSPARENT VOLUME CLOSURE */
+
+__device int volume_transparent_setup(ShaderClosure *sc, float density)
+{
+ sc->type = CLOSURE_VOLUME_TRANSPARENT_ID;
+ sc->data0 = density;
+
+ return SD_VOLUME;
+}
+
+__device float3 volume_transparent_eval_phase(const ShaderClosure *sc, const float3 omega_in, const float3 omega_out)
+{
+ return make_float3(1.0f, 1.0f, 1.0f);
+}
+
+/* VOLUME CLOSURE */
+
+__device float3 volume_eval_phase(const ShaderClosure *sc, const float3 omega_in, const float3 omega_out)
+{
+ float3 eval;
+
+ switch(sc->type) {
+ case CLOSURE_VOLUME_ISOTROPIC_ID:
+ eval = volume_isotropic_eval_phase(sc, omega_in, omega_out);
+ break;
+ case CLOSURE_VOLUME_TRANSPARENT_ID:
+ eval = volume_transparent_eval_phase(sc, omega_in, omega_out);
+ break;
+ default:
+ eval = make_float3(0.0f, 0.0f, 0.0f);
+ break;
+ }
+
+ return eval;
+}
+
+CCL_NAMESPACE_END
+