[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15598] trunk/blender/source/blender/ render/intern/source/rendercore.c: Bug Fix #17337, now atmosphere works correctly with FSA enabled
Hamed Zaghaghi
hamed.zaghaghi at gmail.com
Wed Jul 16 10:10:24 CEST 2008
Revision: 15598
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15598
Author: zaghaghi
Date: 2008-07-16 10:10:23 +0200 (Wed, 16 Jul 2008)
Log Message:
-----------
Bug Fix #17337, now atmosphere works correctly with FSA enabled
Modified Paths:
--------------
trunk/blender/source/blender/render/intern/source/rendercore.c
Modified: trunk/blender/source/blender/render/intern/source/rendercore.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/rendercore.c 2008-07-16 07:10:33 UTC (rev 15597)
+++ trunk/blender/source/blender/render/intern/source/rendercore.c 2008-07-16 08:10:23 UTC (rev 15598)
@@ -671,8 +671,10 @@
RenderPass *zpass;
GroupObject *go;
LampRen *lar;
-
- int x, y;
+ RenderLayer *rlpp[RE_MAX_OSA];
+
+ int totsample, fullsample, sample;
+ int x, y,od;
short first_lamp;
float *zrect;
float *rgbrect;
@@ -683,7 +685,10 @@
fac = 0.5;
facm = 1.0 - fac;
-
+
+ totsample= get_sample_layers(pa, rl, rlpp);
+ fullsample= (totsample > 1);
+
/* check that z pass is enabled */
if(pa->rectz==NULL) return;
for(zpass= rl->passes.first; zpass; zpass= zpass->next)
@@ -708,9 +713,10 @@
zrect = zpass->rect;
rgbrect = rl->rectf;
+ od=0;
/* for each x,y and sun lamp*/
for(y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
- for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, zrect++, rgbrect+=4) {
+ for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, zrect++, od++) {
first_lamp = 1;
for(go=R.lights.first; go; go= go->next) {
@@ -724,7 +730,7 @@
}
if(lar->sunsky->effect_type & LA_SUN_EFFECT_AP){
- VECCOPY(tmp_rgb, rgbrect);
+ VECCOPY(tmp_rgb, (float*)(rgbrect+4*od));
shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect);
@@ -743,7 +749,16 @@
/* if at least for one sun lamp aerial perspective was applied*/
if(first_lamp==0)
- VECCOPY(rgbrect, rgb);
+ {
+ if(fullsample) {
+ for(sample=0; sample<totsample; sample++) {
+ VECCOPY((float*)(rlpp[sample]->rectf + od*4), rgb);
+ }
+ }
+ else {
+ VECCOPY((float*)(rgbrect+4*od), rgb);
+ }
+ }
}
}
}
More information about the Bf-blender-cvs
mailing list