diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-12 00:37:17 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-12 00:37:17 +0300 |
commit | 977fdc5a5600febf27b917b15a0db30ba1253be8 (patch) | |
tree | 3006f2fc153d20d1bd266106e11f5b0b4035b9bf /source/blender/render | |
parent | 44692c70ae9cc8f5f1dbb2bf3de347cbd611d144 (diff) |
Fix #25654: strand render with instanced objects was not working right,
some coordinates didn't have the instance matrix applied, while others had
it applied twice.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/strand.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c index 4dfd5b1b069..1591c7957c6 100644 --- a/source/blender/render/intern/source/strand.c +++ b/source/blender/render/intern/source/strand.c @@ -666,8 +666,9 @@ static void strand_render(Render *re, StrandSegment *sseg, float winmat[][4], St obi= sseg->obi - re->objectinstance; index= sseg->strand->index; - projectvert(p1->co, winmat, hoco1); - projectvert(p2->co, winmat, hoco2); + projectvert(p1->co, winmat, hoco1); + projectvert(p2->co, winmat, hoco2); + for(a=0; a<totzspan; a++) { #if 0 @@ -855,7 +856,7 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa else if(!shadow && (ma->mode & MA_ONLYCAST)) continue; - if(clip_render_object(obi->obr->boundbox, bounds, winmat)) + if(clip_render_object(obi->obr->boundbox, bounds, obwinmat)) continue; widthx= obr->strandbuf->maxwidth*obwinmat[0][0]; @@ -864,7 +865,7 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa /* for each bounding box containing a number of strands */ sbound= obr->strandbuf->bound; for(c=0; c<obr->strandbuf->totbound; c++, sbound++) { - if(clip_render_object(sbound->boundbox, bounds, winmat)) + if(clip_render_object(sbound->boundbox, bounds, obwinmat)) continue; /* for each strand in this bounding box */ @@ -931,11 +932,6 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa obi= &re->objectinstance[sortseg->obi]; obr= obi->obr; - if(obi->flag & R_TRANSFORMED) - mul_m4_m4m4(obwinmat, obi->mat, winmat); - else - copy_m4_m4(obwinmat, winmat); - sseg.obi= obi; sseg.strand= RE_findOrAddStrand(obr, sortseg->strand); sseg.buffer= sseg.strand->buffer; @@ -951,7 +947,7 @@ int zbuffer_strands_abuf(Render *re, RenderPart *pa, APixstrand *apixbuf, ListBa spart.segment= &sseg; - render_strand_segment(re, obwinmat, &spart, &zspan, 1, &sseg); + render_strand_segment(re, winmat, &spart, &zspan, 1, &sseg); } } |