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:
authorThomas Dinges <blender@dingto.org>2012-08-31 23:59:50 +0400
committerThomas Dinges <blender@dingto.org>2012-08-31 23:59:50 +0400
commit01815d83fbe7fe6d496c42215d513ca79a5e6a53 (patch)
tree50d904ff30c8c5e265aae3596a74dcaa18311fea /intern/cycles/kernel/osl/osl_shader.cpp
parent99abcb8e45868bab7a9c4f840ec4029cc000f79e (diff)
Cycles / OSL:
* Fixes for changes in r40163. Removed unused code and fixed emissive_eval function.
Diffstat (limited to 'intern/cycles/kernel/osl/osl_shader.cpp')
-rw-r--r--intern/cycles/kernel/osl/osl_shader.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp
index d8d510a7c9b..07d21067edd 100644
--- a/intern/cycles/kernel/osl/osl_shader.cpp
+++ b/intern/cycles/kernel/osl/osl_shader.cpp
@@ -137,11 +137,9 @@ static void flatten_surface_closure_tree(ShaderData *sd, bool no_glossy,
/* sample weight */
float albedo = bsdf->albedo(TO_VEC3(sd->I));
float sample_weight = fabsf(average(weight)) * albedo;
- float sample_sum = sd->osl_closure.bsdf_sample_sum + sample_weight;
sc.sample_weight = sample_weight;
sc.type = CLOSURE_BSDF_ID;
- sd->osl_closure.bsdf_sample_sum = sample_sum;
/* scattering flags */
if (scattering == OSL::Labels::DIFFUSE)
@@ -161,11 +159,9 @@ static void flatten_surface_closure_tree(ShaderData *sd, bool no_glossy,
/* sample weight */
float sample_weight = fabsf(average(weight));
- float sample_sum = sd->osl_closure.emissive_sample_sum + sample_weight;
sc.sample_weight = sample_weight;
sc.type = CLOSURE_EMISSION_ID;
- sd->osl_closure.emissive_sample_sum = sample_sum;
/* flag */
sd->flag |= SD_EMISSION;
@@ -307,11 +303,9 @@ static void flatten_volume_closure_tree(ShaderData *sd,
/* sample weight */
float sample_weight = fabsf(average(weight));
- float sample_sum = sd->osl_closure.volume_sample_sum + sample_weight;
sc.sample_weight = sample_weight;
sc.type = CLOSURE_VOLUME_ID;
- sd->osl_closure.volume_sample_sum = sample_sum;
/* add */
sd->closure[sd->num_closure++] = sc;
@@ -357,11 +351,6 @@ void OSLShader::eval_volume(KernelGlobals *kg, ShaderData *sd, float randb, int
if (kg->osl.volume_state[shader])
ctx->execute(OSL::pvt::ShadUseSurface, *(kg->osl.volume_state[shader]), *globals);
- /* retrieve resulting closures */
- sd->osl_closure.volume_sample_sum = 0.0f;
- sd->osl_closure.num_volume = 0;
- sd->osl_closure.randb = randb;
-
if (globals->Ci)
flatten_volume_closure_tree(sd, globals->Ci);
}
@@ -458,9 +447,8 @@ float3 OSLShader::emissive_eval(const ShaderData *sd, const ShaderClosure *sc)
{
OSL::EmissiveClosure *emissive = (OSL::EmissiveClosure *)sc->prim;
OSL::Color3 emissive_eval = emissive->eval(TO_VEC3(sd->Ng), TO_VEC3(sd->I));
- eval += TO_FLOAT3(emissive_eval);
- return eval;
+ return TO_FLOAT3(emissive_eval);
}
/* Volume Closure */