diff options
Diffstat (limited to 'source/blender/render/intern/source/volumetric.c')
-rw-r--r-- | source/blender/render/intern/source/volumetric.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index dde9dbb8485..359002d05ae 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -305,7 +305,7 @@ float vol_get_density(struct ShadeInput *shi, float *co) /* Color of light that gets scattered out by the volume */ /* Uses same physically based scattering parameter as in transmission calculations, * along with artificial reflection scale/reflection color tint */ -void vol_get_reflection_color(ShadeInput *shi, float *ref_col, float *co) +static void vol_get_reflection_color(ShadeInput *shi, float *ref_col, float *co) { float scatter = shi->mat->vol.scattering; float reflection= shi->mat->vol.reflection; @@ -325,7 +325,7 @@ void vol_get_reflection_color(ShadeInput *shi, float *ref_col, float *co) /* compute emission component, amount of radiance to add per segment * can be textured with 'emit' */ -void vol_get_emission(ShadeInput *shi, float *emission_col, float *co) +static void vol_get_emission(ShadeInput *shi, float *emission_col, float *co) { float emission = shi->mat->vol.emission; VECCOPY(emission_col, shi->mat->vol.emission_col); @@ -343,7 +343,7 @@ void vol_get_emission(ShadeInput *shi, float *emission_col, float *co) * This can possibly use a specific scattering color, * and absorption multiplier factor too, but these parameters are left out for simplicity. * It's easy enough to get a good wide range of results with just these two parameters. */ -void vol_get_sigma_t(ShadeInput *shi, float *sigma_t, float *co) +static void vol_get_sigma_t(ShadeInput *shi, float *sigma_t, float *co) { /* technically absorption, but named transmission color * since it describes the effect of the coloring *after* absorption */ @@ -361,7 +361,7 @@ void vol_get_sigma_t(ShadeInput *shi, float *sigma_t, float *co) /* phase function - determines in which directions the light * is scattered in the volume relative to incoming direction * and view direction */ -float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, float *w, float *wp) +static float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, float *w, float *wp) { const float normalize = 0.25f; // = 1.f/4.f = M_PI/(4.f*M_PI) @@ -408,7 +408,7 @@ float vol_get_phasefunc(ShadeInput *UNUSED(shi), float g, float *w, float *wp) } /* Compute transmittance = e^(-attenuation) */ -void vol_get_transmittance_seg(ShadeInput *shi, float *tr, float stepsize, float *co, float density) +static void vol_get_transmittance_seg(ShadeInput *shi, float *tr, float stepsize, float *co, float density) { /* input density = density at co */ float tau[3] = {0.f, 0.f, 0.f}; @@ -464,7 +464,7 @@ static void vol_get_transmittance(ShadeInput *shi, float *tr, float *co, float * tr[2] = expf(-tau[2]); } -void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *lacol) +static void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *lacol) { float visifac, lv[3], lampdist; float tr[3]={1.0,1.0,1.0}; @@ -534,6 +534,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * if (luminance(lacol) < 0.001f) return; + normalize_v3(lv); p = vol_get_phasefunc(shi, shi->mat->vol.asymmetry, shi->view, lv); /* physically based scattering with non-physically based RGB gain */ @@ -605,7 +606,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float for (; t0 < t1; pt0 = t0, t0 += stepsize) { const float density = vol_get_density(shi, p); - if (density > 0.01f) { + if (density > 0.00001f) { float scatter_col[3] = {0.f, 0.f, 0.f}, emit_col[3]; const float stepd = (t0 - pt0) * density; |