diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 8 | ||||
-rw-r--r-- | source/blender/render/intern/include/render_types.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/initrender.c | 10 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 8 | ||||
-rw-r--r-- | source/blender/render/intern/source/zbuf.c | 6 |
7 files changed, 30 insertions, 10 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 084f29e7d55..f4261cbb738 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10082,6 +10082,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if(sce->r.frame_step==0) sce->r.frame_step= 1; + if (sce->r.mblur_samples==0) + sce->r.mblur_samples = sce->r.osa; if(sce->ed && sce->ed->seqbasep) { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index d646d9b7c67..63d3e764263 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -302,7 +302,10 @@ typedef struct RenderData { /* information on different layers to be rendered */ ListBase layers; - short actlay, pad; + short actlay; + + /* number of mblur samples */ + short mblur_samples; /** * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45 diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index a5d6e92707f..ba203929e2d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2164,7 +2164,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna) prop= RNA_def_property(srna, "motion_blur", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_MBLUR); - RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur (uses number of anti-aliasing samples)."); + RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + prop= RNA_def_property(srna, "motion_blur_samples", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "mblur_samples"); + RNA_def_property_range(prop, 1, 32); + RNA_def_property_ui_text(prop, "Motion Samples", "Number of scene samples to take with motion blur"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index ba995621a98..de7d176759e 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -161,6 +161,7 @@ struct Render /* samples */ SampleTables *samples; float jit[32][2]; + float mblur_jit[32][2]; ListBase *qmcsamplers; /* shadow counter, detect shadow-reuse for shaders */ diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index abff8bf2655..faa5f17649a 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -85,15 +85,23 @@ static void init_render_jit(Render *re) { static float jit[32][2]; /* simple caching */ + static float mblur_jit[32][2]; /* simple caching */ static int lastjit= 0; + static int last_mblur_jit= 0; - if(lastjit!=re->r.osa) { + if(lastjit!=re->r.osa || last_mblur_jit != re->r.mblur_samples) { memset(jit, 0, sizeof(jit)); BLI_initjit(jit[0], re->r.osa); + + memset(mblur_jit, 0, sizeof(mblur_jit)); + BLI_initjit(mblur_jit[0], re->r.mblur_samples); } lastjit= re->r.osa; memcpy(re->jit, jit, sizeof(jit)); + + last_mblur_jit= re->r.mblur_samples; + memcpy(re->mblur_jit, mblur_jit, sizeof(mblur_jit)); } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 4ae00c94c6a..95e98c1861c 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1929,20 +1929,20 @@ static void do_render_blur_3d(Render *re) { RenderResult *rres; float blurfac; - int blur= re->r.osa; + int blur= re->r.mblur_samples; /* create accumulation render result */ rres= new_render_result(re, &re->disprect, 0, RR_USEMEM); /* do the blur steps */ while(blur--) { - set_mblur_offs( re->r.blurfac*((float)(re->r.osa-blur))/(float)re->r.osa ); + set_mblur_offs( re->r.blurfac*((float)(re->r.mblur_samples-blur))/(float)re->r.mblur_samples ); - re->i.curblur= re->r.osa-blur; /* stats */ + re->i.curblur= re->r.mblur_samples-blur; /* stats */ do_render_3d(re); - blurfac= 1.0f/(float)(re->r.osa-blur); + blurfac= 1.0f/(float)(re->r.mblur_samples-blur); merge_renderresult_blur(rres, re->result, blurfac, re->r.alphamode & R_ALPHAKEY); if(re->test_break(re->tbh)) break; diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 6d67c068bdd..612c5660f68 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -2070,8 +2070,8 @@ void zbuffer_solid(RenderPart *pa, RenderLayer *rl, void(*fillfunc)(RenderPart*, zspan->zofsy= -pa->disprect.ymin - R.jit[pa->sample+zsample][1]; } else if(R.i.curblur) { - zspan->zofsx= -pa->disprect.xmin - R.jit[R.i.curblur-1][0]; - zspan->zofsy= -pa->disprect.ymin - R.jit[R.i.curblur-1][1]; + zspan->zofsx= -pa->disprect.xmin - R.mblur_jit[R.i.curblur-1][0]; + zspan->zofsy= -pa->disprect.ymin - R.mblur_jit[R.i.curblur-1][1]; } else { zspan->zofsx= -pa->disprect.xmin; @@ -3414,7 +3414,7 @@ static int zbuffer_abuf_render(RenderPart *pa, APixstr *APixbuf, APixstrand *APi if(R.osa) jit= R.jit; else if(R.i.curblur) - jit= &R.jit[R.i.curblur-1]; + jit= &R.mblur_jit[R.i.curblur-1]; else jit= NULL; |