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
path: root/source
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-11-29 04:05:20 +0300
committerMatt Ebb <matt@mke3.net>2010-11-29 04:05:20 +0300
commit4c82be95fdaa4bef2f186b12ac28f58fa9a40564 (patch)
tree565f7dbe9540ef7ff1842c1967e146b2335b92a5 /source
parentab713ee1f45f681ee27e3573dbfd373d9a105b20 (diff)
Fix:
[#24170] Camera inside volume error [#24838] Light inside Volume material drops on it's walls - it may be double Problem in a previous bugfix commit, reverted back, the original bug is still fixed too.
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/source/shadeinput.c14
-rw-r--r--source/blender/render/intern/source/volumetric.c8
2 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index 4754e0d15f1..e619eb6bf06 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -141,7 +141,12 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
if((shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_RAYTRANSP))
if((shi->layflag & SCE_LAY_SKY) && (R.r.alphamode==R_ADDSKY))
shr->alpha= 1.0f;
- }
+ }
+
+ if(R.r.mode & R_RAYTRACE) {
+ if (R.render_volumes_inside.first)
+ shade_volume_inside(shi, shr);
+ }
}
@@ -163,11 +168,8 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
shade_input_init_material(shi);
if (shi->mat->material_type == MA_TYPE_VOLUME) {
- if(R.r.mode & R_RAYTRACE) {
- if (R.render_volumes_inside.first)
- shade_volume_inside(shi, shr);
- else
- shade_volume_outside(shi, shr);
+ if(R.r.mode & R_RAYTRACE) {
+ shade_volume_outside(shi, shr);
}
} else { /* MA_TYPE_SURFACE, MA_TYPE_WIRE */
shade_material_loop(shi, shr);
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index f3f31bf6b43..f791f8728d0 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -784,6 +784,7 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr)
MatInside *m;
Material *mat_backup;
ObjectInstanceRen *obi_backup;
+ float prev_alpha = shr->alpha;
/* XXX: extend to multiple volumes perhaps later */
mat_backup = shi->mat;
@@ -794,11 +795,14 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr)
shi->obi = m->obi;
shi->obr = m->obi->obr;
- memset(shr, 0, sizeof(ShadeResult));
-
volume_trace(shi, shr, VOL_SHADE_INSIDE);
+
+ shr->alpha = shr->alpha + prev_alpha;
+ CLAMP(shr->alpha, 0.0, 1.0);
shi->mat = mat_backup;
shi->obi = obi_backup;
shi->obr = obi_backup->obr;
}
+
+