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:
authorMatt Ebb <matt@mke3.net>2009-08-19 09:54:53 +0400
committerMatt Ebb <matt@mke3.net>2009-08-19 09:54:53 +0400
commit8480ea2b0abacae00c90d37e7d99fa5e0c89eebe (patch)
tree5b46fc4110424e277cb1051cc18e9b4fb2a3f827 /source/blender/render/intern/source/volumetric.c
parent6412fe4b92f136fd7b9bdb7592476df26c8e46ce (diff)
*small volume render code cleanups
Diffstat (limited to 'source/blender/render/intern/source/volumetric.c')
-rw-r--r--source/blender/render/intern/source/volumetric.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index f112c237319..3c3827d8baf 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -63,17 +63,9 @@
extern struct Render R;
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
-static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face)
-{
- VlakRen *vlr = (VlakRen *)face;
-
- /* only consider faces away, so overlapping layers
- * of foward facing geometry don't cause the ray to stop */
- return (INPR(is->vec, vlr->n) < 0.0f);
-}
/* TODO: Box or sphere intersection types could speed things up */
-static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type, int checkfunc)
+static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type)
{
float maxsize = RE_ray_tree_max_size(R.raytree);
int intersected=0;
@@ -132,11 +124,6 @@ float vol_get_stepsize(struct ShadeInput *shi, int context)
return shi->mat->vol.stepsize;
}
-static float vol_get_depth_cutoff(struct ShadeInput *shi)
-{
- return shi->mat->vol.depth_cutoff;
-}
-
/* trilinear interpolation */
static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co)
{
@@ -335,7 +322,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *
Isect is;
/* find minimum of volume bounds, or lamp coord */
- if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS, 0)) {
+ if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS)) {
float dist = VecLenf(co, hitco);
VlakRen *vlr = (VlakRen *)is.face;
@@ -421,7 +408,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float
float tau[3], emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0};
float stepvec[3], step_sta[3], step_end[3], step_mid[3];
float density = vol_get_density(shi, co);
- const float depth_cutoff = vol_get_depth_cutoff(shi);
+ const float depth_cutoff = shi->mat->vol.depth_cutoff;
/* multiply col_behind with beam transmittance over entire distance */
vol_get_attenuation(shi, tau, co, endco, density, stepsize);
@@ -593,7 +580,7 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
}
/* trace to find a backface, the other side bounds of the volume */
/* (ray intersect ignores front faces here) */
- else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH, 0)) {
+ else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) {
VlakRen *vlr = (VlakRen *)is.face;
/* if it's another face in the same material */
@@ -657,7 +644,7 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct
}
/* trace to find a backface, the other side bounds of the volume */
/* (ray intersect ignores front faces here) */
- else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH, 0)) {
+ else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) {
vol_get_attenuation(shi, tau, shi->co, hitco, -1.0f, shade_stepsize);
tr[0] = exp(-tau[0]);