From 3e7cbd5388426a612b4066fbe7f2964c976fb23e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 21 Apr 2009 09:44:29 +0000 Subject: Blender Python API - Removed the gen_utils.c dependency from Mathutils (since gen_utils wont go into 2.5 but mathutils will), repalced with python functions. - removed Blender.Mathutils.Point, since it was not documented, the C api never used it, none of our scripts used it (and I never saw a script that used it). --- source/blender/render/intern/source/convertblender.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 06ba8f16a3b..cd141799f64 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1437,7 +1437,6 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem Object *ob= obr->ob; Object *tob=0; Material *ma=0; - MTFace *mtface; ParticleSystemModifierData *psmd; ParticleSystem *tpsys=0; ParticleSettings *part, *tpart=0; -- cgit v1.2.3 From c09b1a985c29e59736eef619e2dae1a1dcf2d73a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 22 Apr 2009 11:54:43 +0000 Subject: bugfix #18187 Using "Key Alpha" didn't work when using MBlur render. The accumulation code was assuming regular alpha then. Now it corrects for it. Still it's a bit of a weak spot in Blender's render system. I will look in the future to make this a real post process; converting all RGBA buffers in the system, including for all passes, to "key alpha". Combined with that our compositor should become alpha type aware too. Everything in Blender assumes premul alpha, which still just will work best in general... --- source/blender/render/intern/source/pipeline.c | 49 +++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 5c3c954aa8e..96edb4ee73c 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1639,6 +1639,42 @@ static void do_render_3d(Render *re) RE_Database_Free(re); } +/* called by blur loop, accumulate RGBA key alpha */ +static void addblur_rect_key(RenderResult *rr, float *rectf, float *rectf1, float blurfac) +{ + float mfac= 1.0f - blurfac; + int a, b, stride= 4*rr->rectx; + int len= stride*sizeof(float); + + for(a=0; arecty; a++) { + if(blurfac==1.0f) { + memcpy(rectf, rectf1, len); + } + else { + float *rf= rectf, *rf1= rectf1; + + for( b= rr->rectx; b>0; b--, rf+=4, rf1+=4) { + if(rf1[3]<0.01f) + rf[3]= mfac*rf[3]; + else if(rf[3]<0.01f) { + rf[0]= rf1[0]; + rf[1]= rf1[1]; + rf[2]= rf1[2]; + rf[3]= blurfac*rf1[3]; + } + else { + rf[0]= mfac*rf[0] + blurfac*rf1[0]; + rf[1]= mfac*rf[1] + blurfac*rf1[1]; + rf[2]= mfac*rf[2] + blurfac*rf1[2]; + rf[3]= mfac*rf[3] + blurfac*rf1[3]; + } + } + } + rectf+= stride; + rectf1+= stride; + } +} + /* called by blur loop, accumulate renderlayers */ static void addblur_rect(RenderResult *rr, float *rectf, float *rectf1, float blurfac, int channels) { @@ -1662,8 +1698,9 @@ static void addblur_rect(RenderResult *rr, float *rectf, float *rectf1, float bl } } + /* called by blur loop, accumulate renderlayers */ -static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float blurfac) +static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float blurfac, int key_alpha) { RenderLayer *rl, *rl1; RenderPass *rpass, *rpass1; @@ -1672,8 +1709,12 @@ static void merge_renderresult_blur(RenderResult *rr, RenderResult *brr, float b for(rl= rr->layers.first; rl && rl1; rl= rl->next, rl1= rl1->next) { /* combined */ - if(rl->rectf && rl1->rectf) - addblur_rect(rr, rl->rectf, rl1->rectf, blurfac, 4); + if(rl->rectf && rl1->rectf) { + if(key_alpha) + addblur_rect_key(rr, rl->rectf, rl1->rectf, blurfac); + else + addblur_rect(rr, rl->rectf, rl1->rectf, blurfac, 4); + } /* passes are allocated in sync */ rpass1= rl1->passes.first; @@ -1703,7 +1744,7 @@ static void do_render_blur_3d(Render *re) blurfac= 1.0f/(float)(re->r.osa-blur); - merge_renderresult_blur(rres, re->result, blurfac); + merge_renderresult_blur(rres, re->result, blurfac, re->r.alphamode & R_ALPHAKEY); if(re->test_break()) break; } -- cgit v1.2.3 From 971cabc2d687c86b8ff1e7a5a57474d85450b170 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 22 Apr 2009 17:06:47 +0000 Subject: Bugfix #18058 Ray-transparent didn't pass on thread number to shading code, giving "blothes" in render, when using node materials. This also rewinds Campbells commit of feb 21, which tackled the error, but not the cause. --- source/blender/render/intern/source/rayshade.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 46a7a1c556c..c6dd8d6890e 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1273,7 +1273,7 @@ static void addAlphaLight(float *shadfac, float *col, float alpha, float filter) shadfac[3]= (1.0f-alpha)*shadfac[3]; } -static void ray_trace_shadow_tra(Isect *is, int depth, int traflag) +static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) { /* ray to lamp, find first face that intersects, check alpha properties, if it has col[3]>0.0f continue. so exit when alpha is full */ @@ -1291,6 +1291,7 @@ static void ray_trace_shadow_tra(Isect *is, int depth, int traflag) shi.depth= 1; /* only used to indicate tracing */ shi.mask= 1; + shi.thread= thread; /*shi.osatex= 0; shi.thread= shi.sample= 0; @@ -1315,7 +1316,7 @@ static void ray_trace_shadow_tra(Isect *is, int depth, int traflag) is->oborig= RAY_OBJECT_SET(&R, shi.obi); is->faceorig= (RayFace*)shi.vlr; - ray_trace_shadow_tra(is, depth-1, traflag | RAY_TRA); + ray_trace_shadow_tra(is, thread, depth-1, traflag | RAY_TRA); } } } @@ -1943,7 +1944,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float * isec->col[0]= isec->col[1]= isec->col[2]= 1.0f; isec->col[3]= 1.0f; - ray_trace_shadow_tra(isec, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0); shadfac[0] += isec->col[0]; shadfac[1] += isec->col[1]; shadfac[2] += isec->col[2]; @@ -2041,7 +2042,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, float *lampco, floa isec->col[0]= isec->col[1]= isec->col[2]= 1.0f; isec->col[3]= 1.0f; - ray_trace_shadow_tra(isec, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0); shadfac[0] += isec->col[0]; shadfac[1] += isec->col[1]; shadfac[2] += isec->col[2]; @@ -2122,7 +2123,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac) isec.col[0]= isec.col[1]= isec.col[2]= 1.0f; isec.col[3]= 1.0f; - ray_trace_shadow_tra(&isec, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(&isec, shi->thread, DEPTH_SHADOW_TRA, 0); QUATCOPY(shadfac, isec.col); } else if(RE_ray_tree_intersect(R.raytree, &isec)) shadfac[3]= 0.0f; -- cgit v1.2.3 From 22df42cdecbf29d886ea6cf81810ecbc575522e4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 27 Apr 2009 11:49:40 +0000 Subject: Fix for bug #18032: AAO pixel cache + refraction artifacts, the pixel cache can only be used for the first hit. --- source/blender/render/intern/source/occlusion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 494feb96c18..f9301bc0805 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -1632,7 +1632,7 @@ void sample_occ(Render *re, ShadeInput *shi) sample_occ_surface(shi); } /* try to get result from the cache if possible */ - else if(!sample_occ_cache(tree, shi->co, shi->vno, shi->xs, shi->ys, shi->thread, shi->ao)) { + else if(shi->depth!=0 || !sample_occ_cache(tree, shi->co, shi->vno, shi->xs, shi->ys, shi->thread, shi->ao)) { /* no luck, let's sample the occlusion */ exclude.obi= shi->obi - re->objectinstance; exclude.facenr= shi->vlr->index; -- cgit v1.2.3 From b89126dbe85501c54d9041ce5e4adb5c626d9c04 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 3 May 2009 12:06:43 +0000 Subject: Bugfix #18676 Map a texture to Material Ambient factor didn't work. Probably not since 2.42 or so... :) --- source/blender/render/intern/source/texture.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 61e9d9cf412..d41f68c021a 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -2031,6 +2031,10 @@ void do_material_tex(ShadeInput *shi) shi->amb= texture_value_blend(mtex->def_var, shi->amb, texres.tin, varfac, mtex->blendtype, flip); if(shi->amb<0.0) shi->amb= 0.0; else if(shi->amb>1.0) shi->amb= 1.0; + + shi->ambr= shi->amb*R.wrld.ambr; + shi->ambg= shi->amb*R.wrld.ambg; + shi->ambb= shi->amb*R.wrld.ambb; } } } -- cgit v1.2.3 From 03a0770df57835ca3551642fc6ba879bdde9564a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 3 May 2009 17:48:32 +0000 Subject: Bugfix #17929 Old bug (2.42): when using node material, transparent shadow did not work. It was missing to set the proper 'pass flag'. Do note an important difference with non-node materials for 'transparent shadow'. If there are no nodes, it uses the color from the unshaded material. When it has nodes, it uses the color output from the entire node tree, which is typically from shaded materials. The latter is because node shaders have no support for shade passes yet (it only outputs rgb + a). --- source/blender/render/intern/source/rayshade.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index c6dd8d6890e..97ac8666181 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -262,13 +262,14 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) shade_input_set_shade_texco(shi); - if(is->mode==RE_RAY_SHADOW_TRA) + if(is->mode==RE_RAY_SHADOW_TRA) { if(shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ } else shade_color(shi, shr); + } else { if(shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); @@ -1292,15 +1293,8 @@ static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) shi.depth= 1; /* only used to indicate tracing */ shi.mask= 1; shi.thread= thread; - - /*shi.osatex= 0; - shi.thread= shi.sample= 0; - shi.lay= 0; - shi.passflag= 0; - shi.combinedflag= 0; - shi.do_preview= 0; - shi.light_override= NULL; - shi.mat_override= NULL;*/ + shi.passflag= SCE_PASS_COMBINED; + shi.combinedflag= 0xFFFFFF; /* ray trace does all options */ shade_ray(is, &shi, &shr); if (traflag & RAY_TRA) -- cgit v1.2.3 From d2cff7307d26ada0dd34949d0a9fbb3c37c72f19 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 May 2009 02:21:50 +0000 Subject: [#18685] dark pixels created when during texture "full baking" fix/workaround - offset by a 500th of a pixel to avoid baking missing pixels that are between 2 faces, its still possible pixels could be between faces but much less likely then it is currently with pixel aligned UVs. --- source/blender/render/intern/source/rendercore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 5dfb509939b..2793e238dc7 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2542,8 +2542,12 @@ static void shade_tface(BakeShade *bs) /* get pixel level vertex coordinates */ for(a=0; a<4; a++) { - vec[a][0]= tface->uv[a][0]*(float)bs->rectx - 0.5f; - vec[a][1]= tface->uv[a][1]*(float)bs->recty - 0.5f; + /* Note, workaround for pixel aligned UVs which are common and can screw up our intersection tests + * where a pixel gets inbetween 2 faces or the middle of a quad, + * camera aligned quads also have this problem but they are less common. + * Add a small offset to the UVs, fixes bug #18685 - Campbell */ + vec[a][0]= tface->uv[a][0]*(float)bs->rectx - (0.5f + 0.001); + vec[a][1]= tface->uv[a][1]*(float)bs->recty - (0.5f + 0.002); } /* UV indices have to be corrected for possible quad->tria splits */ -- cgit v1.2.3 From 34f99fa4b9e5a370ee208db247f56fcbea4e71f9 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 14 May 2009 11:36:52 +0000 Subject: Bugfix #18743 Render: raytracing materials with transp-shadow + SSS crashed --- source/blender/render/intern/source/rayshade.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 97ac8666181..f4dcbe9e186 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1274,7 +1274,7 @@ static void addAlphaLight(float *shadfac, float *col, float alpha, float filter) shadfac[3]= (1.0f-alpha)*shadfac[3]; } -static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) +static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int traflag) { /* ray to lamp, find first face that intersects, check alpha properties, if it has col[3]>0.0f continue. so exit when alpha is full */ @@ -1291,10 +1291,14 @@ static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) /* end warning! - Campbell */ shi.depth= 1; /* only used to indicate tracing */ - shi.mask= 1; - shi.thread= thread; + shi.mask= origshi->mask; + shi.thread= origshi->thread; shi.passflag= SCE_PASS_COMBINED; shi.combinedflag= 0xFFFFFF; /* ray trace does all options */ + + shi.xs= origshi->xs; + shi.ys= origshi->ys; + shi.lay= origshi->lay; shade_ray(is, &shi, &shr); if (traflag & RAY_TRA) @@ -1310,7 +1314,7 @@ static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag) is->oborig= RAY_OBJECT_SET(&R, shi.obi); is->faceorig= (RayFace*)shi.vlr; - ray_trace_shadow_tra(is, thread, depth-1, traflag | RAY_TRA); + ray_trace_shadow_tra(is, origshi, depth-1, traflag | RAY_TRA); } } } @@ -1938,7 +1942,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float * isec->col[0]= isec->col[1]= isec->col[2]= 1.0f; isec->col[3]= 1.0f; - ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(isec, shi, DEPTH_SHADOW_TRA, 0); shadfac[0] += isec->col[0]; shadfac[1] += isec->col[1]; shadfac[2] += isec->col[2]; @@ -2036,7 +2040,7 @@ static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, float *lampco, floa isec->col[0]= isec->col[1]= isec->col[2]= 1.0f; isec->col[3]= 1.0f; - ray_trace_shadow_tra(isec, shi->thread, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(isec, shi, DEPTH_SHADOW_TRA, 0); shadfac[0] += isec->col[0]; shadfac[1] += isec->col[1]; shadfac[2] += isec->col[2]; @@ -2117,7 +2121,7 @@ void ray_shadow(ShadeInput *shi, LampRen *lar, float *shadfac) isec.col[0]= isec.col[1]= isec.col[2]= 1.0f; isec.col[3]= 1.0f; - ray_trace_shadow_tra(&isec, shi->thread, DEPTH_SHADOW_TRA, 0); + ray_trace_shadow_tra(&isec, shi, DEPTH_SHADOW_TRA, 0); QUATCOPY(shadfac, isec.col); } else if(RE_ray_tree_intersect(R.raytree, &isec)) shadfac[3]= 0.0f; -- cgit v1.2.3 From d4116adf11678726a5af5f544a12b194ef2fbcb9 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 17 May 2009 10:30:13 +0000 Subject: Bugfix #18676 Texture "map to" Ambient did work now (previous fix) but not for ambient occlusion yet. --- source/blender/render/intern/source/shadeoutput.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 4c627056c1d..869cca0f7d0 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1007,9 +1007,9 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec) /* pure AO, check for raytrace and world should have been done */ void ambient_occlusion(ShadeInput *shi) { - if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->mat->amb!=0.0f) + if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->amb!=0.0f) sample_occ(&R, shi); - else if((R.r.mode & R_RAYTRACE) && shi->mat->amb!=0.0f) + else if((R.r.mode & R_RAYTRACE) && shi->amb!=0.0f) ray_ao(shi, shi->ao); else shi->ao[0]= shi->ao[1]= shi->ao[2]= 1.0f; @@ -1020,8 +1020,8 @@ void ambient_occlusion(ShadeInput *shi) void ambient_occlusion_to_diffuse(ShadeInput *shi, float *diff) { if((R.r.mode & R_RAYTRACE) || R.wrld.ao_gather_method == WO_AOGATHER_APPROX) { - if(shi->mat->amb!=0.0f) { - float f= R.wrld.aoenergy*shi->mat->amb; + if(shi->amb!=0.0f) { + float f= R.wrld.aoenergy*shi->amb; if (R.wrld.aomix==WO_AOADDSUB) { diff[0] = 2.0f*shi->ao[0]-1.0f; -- cgit v1.2.3 From ac0766c64b62ca74cb29b3d58c40d2ce92ec5b9b Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Wed, 20 May 2009 12:13:37 +0000 Subject: Fix for [#18785] Crash rendering hair particle system --- source/blender/render/intern/source/convertblender.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index cd141799f64..79ab661e578 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1766,7 +1766,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(parent->num < psmd->dm->getNumFaces(psmd->dm)) num = parent->num; - get_particle_uvco_mcol(part->from, psmd->dm, pa->fuv, num, &sd); + get_particle_uvco_mcol(part->from, psmd->dm, parent->fuv, num, &sd); } dosimplify = psys_render_simplify_params(psys, cpa, simplify); -- cgit v1.2.3 From 33304d022d7f43eb1319fe7e9db33ec6559c275d Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 26 May 2009 13:46:08 +0000 Subject: Bugfix #18801 Third transparent shadow bug... this time it's a Material Node, which has mirror + transp-shadow on, and when it traces its own material it enters an eternal loop... Raytracing + shading + materialnode combo really needs work! --- source/blender/render/extern/include/RE_shader_ext.h | 1 + source/blender/render/intern/source/rayshade.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/render') diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 2cee2673a26..0ad48fe97a9 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -171,6 +171,7 @@ typedef struct ShadeInput /* from initialize, part or renderlayer */ short do_preview; /* for nodes, in previewrender */ short thread, sample; /* sample: ShadeSample array index */ + short nodes; /* indicate node shading, temp hack to prevent recursion */ unsigned int lay; int layflag, passflag, combinedflag; diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index f4dcbe9e186..75b9557f337 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -263,7 +263,8 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) shade_input_set_shade_texco(shi); if(is->mode==RE_RAY_SHADOW_TRA) { - if(shi->mat->nodetree && shi->mat->use_nodes) { + /* temp hack to prevent recursion */ + if(shi->nodes==0 && shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ } @@ -1299,6 +1300,7 @@ static void ray_trace_shadow_tra(Isect *is, ShadeInput *origshi, int depth, int shi.xs= origshi->xs; shi.ys= origshi->ys; shi.lay= origshi->lay; + shi.nodes= origshi->nodes; shade_ray(is, &shi, &shr); if (traflag & RAY_TRA) -- cgit v1.2.3 From 011d91624ee0f0ced5462995faec16b2e6f44142 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 31 May 2009 11:22:11 +0000 Subject: AO render error, caused by bugfix after RC3 :( My bug fix to support AO with "Amb" texture channel changed code too that calls AO as a pre-shade process, when texture isn't calculated yet. This caused very first pixel in a tile to show wrong AO. Especially myself deserves a kick in butt for not testing the regression files for release binaries again! Error shows clearly... in the cornelius_passes .blend file. --- source/blender/render/intern/source/shadeoutput.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 869cca0f7d0..130cda9f107 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1005,11 +1005,12 @@ static void do_specular_ramp(ShadeInput *shi, float is, float t, float *spec) } /* pure AO, check for raytrace and world should have been done */ +/* preprocess, textures were not done, don't use shi->amb for that reason */ void ambient_occlusion(ShadeInput *shi) { - if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->amb!=0.0f) + if((R.wrld.ao_gather_method == WO_AOGATHER_APPROX) && shi->mat->amb!=0.0f) sample_occ(&R, shi); - else if((R.r.mode & R_RAYTRACE) && shi->amb!=0.0f) + else if((R.r.mode & R_RAYTRACE) && shi->mat->amb!=0.0f) ray_ao(shi, shi->ao); else shi->ao[0]= shi->ao[1]= shi->ao[2]= 1.0f; -- cgit v1.2.3 From 20eaa1466dbb530e583699e189c9f8b8597b7eb4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 9 Jun 2009 13:03:00 +0000 Subject: Fix for bug #18881 and #18866: Surface option for Fields crashed on non-mesh objects, so hide it if not applicable. Also made it support surf, curve, font objects. --- source/blender/render/intern/source/convertblender.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 79ab661e578..6f07d44d1fb 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -2562,7 +2562,7 @@ static void init_render_surf(Render *re, ObjectRen *obr) if(need_orco) orcobase= orco= get_object_orco(re, ob); displist.first= displist.last= 0; - makeDispListSurf(ob, &displist, 1); + makeDispListSurf(ob, &displist, 1, 0); dl= displist.first; /* walk along displaylist and create rendervertices/-faces */ -- cgit v1.2.3 From e917b1043ebe6201c89e3c4960280fee484161b8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 9 Jun 2009 18:25:57 +0000 Subject: Fix for bug #18860: particle hair strands missed first segment when rendering as regular geometry (not strand render). --- source/blender/render/intern/source/convertblender.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 6f07d44d1fb..3c6b872a16d 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1863,8 +1863,6 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem strand->totvert++; } else{ - sd.first = 0; - sd.time = time; sd.size = hasize; if(k==1){ @@ -1872,8 +1870,13 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem sd.time = 0.0f; VECSUB(loc0,loc1,loc); VECADD(loc0,loc1,loc0); + + render_new_particle(re, obr, psmd->dm, ma, &sd, loc1, loc0, seed); } + sd.first = 0; + sd.time = time; + if(k) render_new_particle(re, obr, psmd->dm, ma, &sd, loc, loc1, seed); -- cgit v1.2.3