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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2007-05-08 14:15:51 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2007-05-08 14:15:51 +0400
commit15e79ef4c834ea31b14ef72d522fb0a5d00dc76e (patch)
treef1718381a9b83a7cb3edbb19657d74e162344862 /source/blender/src
parentad30c0b48b2d8f1adc32bcccc3f27ef1ef76a42d (diff)
SSS fixes:
- Radius R, G, B sliders had too small number increase on clicking. - Preview render now renders with higher SSS error setting to speed it up a bit. - bug #6664: 3d preview render had artifacts. re->viewdx/dy wasn't set then, which is needed to estimate the area of each point. Have set this now, not in the nicest way, there is some bit duplicated code, but I don't want to refactor existing code with the chance of breaking it at this point. - bug #6665: grid like artifacts with parts rendering. The two extra pixels around parts used for filtering were used as well, leading to double points.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/buttons_shading.c6
-rw-r--r--source/blender/src/previewrender.c10
-rw-r--r--source/blender/src/view.c17
3 files changed, 24 insertions, 9 deletions
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index 35277030857..0d1a783ddea 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -3326,15 +3326,15 @@ static void material_panel_sss(Material *ma)
uiDefButF(block, NUM, B_MATPRV, "Scale:", 10,150,145,20,
&ma->sss_scale, 0.001, 1000, 1, 3, "Object scale");
bt=uiDefButF(block, NUM, B_MATPRV, "Radius R", 10,130,145,20,
- &ma->sss_radius[0], 0.00001, 10000, 0, 0,
+ &ma->sss_radius[0], 0.0001, 10000, 1, 3,
"Mean red scattering path length");
uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL);
bt=uiDefButF(block, NUM, B_MATPRV, "Radius G", 10,110,145,20,
- &ma->sss_radius[1], 0.00001, 10000, 0, 0,
+ &ma->sss_radius[1], 0.0001, 10000, 1, 3,
"Mean green scattering path length");
uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL);
bt=uiDefButF(block, NUM, B_MATPRV, "Radius B", 10,90,145,20,
- &ma->sss_radius[2], 0.00001, 10000, 0, 0,
+ &ma->sss_radius[2], 0.0001, 10000, 1, 3,
"Mean blue scattering path length");
uiButSetFunc(bt, material_sss_custom_set_cb, ma, NULL);
uiBlockEndAlign(block);
diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c
index 1526de1b74d..fb9ea19742f 100644
--- a/source/blender/src/previewrender.c
+++ b/source/blender/src/previewrender.c
@@ -673,7 +673,7 @@ void BIF_view3d_previewrender_free(View3D *v3d)
}
/* returns 1 if OK, do not call while in panel space! */
-static int view3d_previewrender_get_rects(ScrArea *sa, rctf *viewplane, RenderInfo *ri, float *clipsta, float *clipend, int *ortho)
+static int view3d_previewrender_get_rects(ScrArea *sa, rctf *viewplane, RenderInfo *ri, float *clipsta, float *clipend, int *ortho, float *pixsize)
{
int rectx, recty;
uiBlock *block;
@@ -690,7 +690,7 @@ static int view3d_previewrender_get_rects(ScrArea *sa, rctf *viewplane, RenderIn
/* correction for gla draw */
BLI_translate_rcti(&ri->disprect, -sa->winrct.xmin, -sa->winrct.ymin);
- *ortho= get_view3d_viewplane(sa->winx, sa->winy, viewplane, clipsta, clipend);
+ *ortho= get_view3d_viewplane(sa->winx, sa->winy, viewplane, clipsta, clipend, pixsize);
rectx= ri->disprect.xmax - ri->disprect.xmin;
recty= ri->disprect.ymax - ri->disprect.ymin;
@@ -732,7 +732,7 @@ void BIF_view3d_previewrender(ScrArea *sa)
RenderStats *rstats;
RenderData rdata;
rctf viewplane;
- float clipsta, clipend;
+ float clipsta, clipend, pixsize;
int orth;
/* first get the render info right */
@@ -742,7 +742,7 @@ void BIF_view3d_previewrender(ScrArea *sa)
}
ri= v3d->ri;
- if(0==view3d_previewrender_get_rects(sa, &viewplane, ri, &clipsta, &clipend, &orth))
+ if(0==view3d_previewrender_get_rects(sa, &viewplane, ri, &clipsta, &clipend, &orth, &pixsize))
return;
/* render is finished, so return */
@@ -779,6 +779,7 @@ void BIF_view3d_previewrender(ScrArea *sa)
RE_SetOrtho(re, &viewplane, clipsta, clipend);
else
RE_SetWindow(re, &viewplane, clipsta, clipend);
+ RE_SetPixelSize(re, pixsize);
/* until here are no escapes */
ri->status |= PR_DISPRECT;
@@ -798,6 +799,7 @@ void BIF_view3d_previewrender(ScrArea *sa)
RE_SetOrtho(ri->re, &viewplane, clipsta, clipend);
else
RE_SetWindow(ri->re, &viewplane, clipsta, clipend);
+ RE_SetPixelSize(re, pixsize);
ri->status |= PR_DISPRECT;
ri->curtile= 0;
//printf("disprect update\n");
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index d5cfef5d590..c501dbb8f73 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -825,7 +825,7 @@ void object_view_settings(Object *ob, float *lens, float *clipsta, float *clipen
}
-int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend)
+int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize)
{
Camera *cam=NULL;
float lens, fac, x1, y1, x2, y2;
@@ -922,6 +922,19 @@ int get_view3d_viewplane(int winxi, int winyi, rctf *viewplane, float *clipsta,
y2+= dy;
}
}
+
+ if(pixsize) {
+ float viewfac;
+
+ if(orth) {
+ viewfac= (winx >= winy)? winx: winy;
+ *pixsize= 1.0f/viewfac;
+ }
+ else {
+ viewfac= (((winx >= winy)? winx: winy)*lens)/32.0;
+ *pixsize= *clipsta/viewfac;
+ }
+ }
viewplane->xmin= x1;
viewplane->ymin= y1;
@@ -938,7 +951,7 @@ void setwinmatrixview3d(int winx, int winy, rctf *rect) /* rect: for picking */
float clipsta, clipend, x1, y1, x2, y2;
int orth;
- orth= get_view3d_viewplane(winx, winy, &viewplane, &clipsta, &clipend);
+ orth= get_view3d_viewplane(winx, winy, &viewplane, &clipsta, &clipend, NULL);
// printf("%d %d %f %f %f %f %f %f\n", winx, winy, viewplane.xmin, viewplane.ymin, viewplane.xmax, viewplane.ymax, clipsta, clipend);
x1= viewplane.xmin;
y1= viewplane.ymin;