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
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-08-25 17:11:04 +0400
committerTon Roosendaal <ton@blender.org>2005-08-25 17:11:04 +0400
commit8d940dfafe577ea92c279cc41e791b0012c78d2b (patch)
tree88d286b2bc9ad136e7f96661fcd802d2811a52f2 /source/blender/renderconverter
parentc9f01eefcd3c21da95c7245a6b1f54ceae4024b1 (diff)
Random() issues with rendering...
- AO and soft shadow AreaLight tables were generated without fixed seed, causing animations to give unwanted amounts of noise. - Made sure these tables now are calculated before render, with fixed seed - Then found out the BLI_rand() has very bad seeding... it showed up as patterns. After some experimenting, found a nice method using noise.c hash tables. For compatibility with old code, named it BLI_srandom() to use this next to the BLI_srand(). This follows libc rand() and random() naming convention. - Then of course threading should work... so made a BLI_thread_rand version of the calls. Now supports up to 16 threads, comments added in .h and .c Result is stable animation render with AO and soft shadow. But, please test and feedback!
Diffstat (limited to 'source/blender/renderconverter')
-rw-r--r--source/blender/renderconverter/intern/convertBlenderScene.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/renderconverter/intern/convertBlenderScene.c b/source/blender/renderconverter/intern/convertBlenderScene.c
index bc9aceb9ad5..b6fb272036e 100644
--- a/source/blender/renderconverter/intern/convertBlenderScene.c
+++ b/source/blender/renderconverter/intern/convertBlenderScene.c
@@ -1540,7 +1540,7 @@ static void area_lamp_vectors(LampRen *lar)
}
/* If lar takes more lamp data, the decoupling will be better. */
-void RE_add_render_lamp(Object *ob, int doshadbuf)
+void RE_add_render_lamp(Object *ob, int actual_render)
{
Lamp *la;
LampRen *lar, **temp;
@@ -1715,13 +1715,17 @@ void RE_add_render_lamp(Object *ob, int doshadbuf)
}
}
- /* yafray: shadowbuffers only needed for internal render */
- if (R.r.renderer==R_INTERN)
- {
- if( (R.r.mode & R_SHADOW) && (lar->mode & LA_SHAD) && (la->type==LA_SPOT) && doshadbuf ) {
- /* Per lamp, one shadow buffer is made. */
- Mat4CpyMat4(mat, ob->obmat);
- RE_initshadowbuf(lar, mat); // mat is altered
+ /* yafray: shadowbuffers and jitter only needed for internal render */
+ if (actual_render && R.r.renderer==R_INTERN) {
+ if(R.r.mode & R_SHADOW) {
+ if (la->type==LA_SPOT && (lar->mode & LA_SHAD) ) {
+ /* Per lamp, one shadow buffer is made. */
+ Mat4CpyMat4(mat, ob->obmat);
+ RE_initshadowbuf(lar, mat); // mat is altered
+ }
+ else if(la->type==LA_AREA && (lar->mode & LA_SHAD_RAY) ) {
+ init_jitter_plane(lar);
+ }
}
}
@@ -2300,6 +2304,10 @@ void RE_freeRotateBlenderScene(void)
end_render_textures();
end_render_materials();
end_radio_render();
+ if(R.wrld.aosphere) {
+ MEM_freeN(R.wrld.aosphere);
+ R.wrld.aosphere= NULL;
+ }
R.totvlak=R.totvert=R.totlamp=R.tothalo= 0;
}
@@ -2484,6 +2492,10 @@ void RE_rotateBlenderScene(void)
}
init_render_world(); /* do first, because of ambient. also requires R.osa set correct */
+ if( (R.wrld.mode & WO_AMB_OCC) && (R.r.mode & R_RAYTRACE) ) {
+ R.wrld.aosphere= MEM_mallocN(2*3*R.wrld.aosamp*R.wrld.aosamp*sizeof(float), "AO sphere");
+ init_ao_sphere(R.wrld.aosphere, R.wrld.aosamp*R.wrld.aosamp, 16);
+ }
init_render_textures();
init_render_materials();