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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-04-13 01:44:08 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-04-13 01:44:08 +0400
commitd0d4604dad26a9e0039100b627bfa245c788cb57 (patch)
tree571960d1e9f44b9dcdbec477700a91f5fa305e62 /source
parentdfd7387641c28f2a80f7647f26c981911d4a8cfe (diff)
Fix for bug #8927: halo blending with solid has poor antialiasing,
which as far as I can see is an old issue, but with FSA it is quite simple to do better.
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/source/rendercore.c60
1 files changed, 41 insertions, 19 deletions
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 4ac7b6ed7b4..e36d8649036 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -168,8 +168,9 @@ static int calchalo_z(HaloRen *har, int zz)
static void halo_pixelstruct(HaloRen *har, RenderLayer **rlpp, int totsample, int od, float dist, float xn, float yn, PixStr *ps)
{
float col[4], accol[4];
- int amount, amountm, zz, flarec, sample;
+ int amount, amountm, zz, flarec, sample, fullsample, mask=0;
+ fullsample= (totsample > 1);
amount= 0;
accol[0]=accol[1]=accol[2]=accol[3]= 0.0f;
flarec= har->flarec;
@@ -183,35 +184,56 @@ static void halo_pixelstruct(HaloRen *har, RenderLayer **rlpp, int totsample, in
float fac;
shadeHaloFloat(har, col, zz, dist, xn, yn, flarec);
- fac= ((float)amountm)/(float)R.osa;
- accol[0]+= fac*col[0];
- accol[1]+= fac*col[1];
- accol[2]+= fac*col[2];
- accol[3]+= fac*col[3];
flarec= 0;
+
+ if(fullsample) {
+ for(sample=0; sample<totsample; sample++)
+ if(ps->mask & (1 << sample))
+ addalphaAddfacFloat(rlpp[sample]->rectf + od*4, col, har->add);
+ }
+ else {
+ fac= ((float)amountm)/(float)R.osa;
+ accol[0]+= fac*col[0];
+ accol[1]+= fac*col[1];
+ accol[2]+= fac*col[2];
+ accol[3]+= fac*col[3];
+ }
}
+ mask |= ps->mask;
ps= ps->next;
}
+
/* now do the sky sub-pixels */
amount= R.osa-amount;
if(amount) {
float fac;
shadeHaloFloat(har, col, 0x7FFFFF, dist, xn, yn, flarec);
- fac= ((float)amount)/(float)R.osa;
- accol[0]+= fac*col[0];
- accol[1]+= fac*col[1];
- accol[2]+= fac*col[2];
- accol[3]+= fac*col[3];
- }
- col[0]= accol[0];
- col[1]= accol[1];
- col[2]= accol[2];
- col[3]= accol[3];
-
- for(sample=0; sample<totsample; sample++)
- addalphaAddfacFloat(rlpp[sample]->rectf + od*4, col, har->add);
+
+ if(!fullsample) {
+ fac= ((float)amount)/(float)R.osa;
+ accol[0]+= fac*col[0];
+ accol[1]+= fac*col[1];
+ accol[2]+= fac*col[2];
+ accol[3]+= fac*col[3];
+ }
+ }
+
+ if(fullsample) {
+ for(sample=0; sample<totsample; sample++)
+ if(!(mask & (1 << sample)))
+ addalphaAddfacFloat(rlpp[sample]->rectf + od*4, col, har->add);
+ }
+ else {
+ col[0]= accol[0];
+ col[1]= accol[1];
+ col[2]= accol[2];
+ col[3]= accol[3];
+
+ for(sample=0; sample<totsample; sample++)
+ addalphaAddfacFloat(rlpp[sample]->rectf + od*4, col, har->add);
+ }
}
static void halo_tile(RenderPart *pa, RenderLayer *rl)