diff options
author | Ton Roosendaal <ton@blender.org> | 2006-02-08 19:51:09 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-02-08 19:51:09 +0300 |
commit | 839b338be35dd11d30231d1dee1a3454b952ab55 (patch) | |
tree | 6bb9375175ad26f7135adef188a9ca7358b667b5 /source/blender/src/drawimage.c | |
parent | 10acbf00abc679855184da750d295d1115bb515c (diff) |
New:
- ZTransp render now also delivers Z values and Speed vectors in passes
Note that speed vectors accumulate within a pixel to store the minimum,
so rendering ztransp on top of a non-moving plane won't give speed...
Best results you get is by rendering it in a separate layer.
The Z value stored is the closest visible transparent face in the pixel.
Fixes:
- Render to 'spare page' has been enabled again. Because of the strict
separation of Render and UI, but especially because a 'render result' now
can consist of unlimited images, I've not made this a Render feature.
Instead, the render-window itself stores the 'spare' image... I also
had to change the convention for it a bit.
Now, instead of having two "render buffers" (which was a render feature),
the RenderWindow will store each previous frame on a re-render. This
storing will only start after you've pressed 'Jkey' once, but then always
will happen for as long the rendered image is same size as previously.
For clarity, I've also renamed the window title, to 'previous frame'.
- RenderWindow shows alpha again on Akey
- Display of the Zvalues in ImageWindow has been tweaked. White now denotes
closest, and the color range goes from camera clip-sta to clip-end.
- Bugfix: on splitting/merging/duplicating windows, the 3D Previewrender was
not always freed correctly, potentially causing crashes or memory leaks.
Diffstat (limited to 'source/blender/src/drawimage.c')
-rw-r--r-- | source/blender/src/drawimage.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 6fbdf9b8641..af34d6ae849 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -1171,7 +1171,7 @@ static void sima_draw_zbuf_pixels(float x1, float y1, int rectx, int recty, int static void sima_draw_zbuffloat_pixels(float x1, float y1, int rectx, int recty, float *rect_float) { - float bias, scale, *rectf; + float bias, scale, *rectf, clipend; int a; if(rect_float==NULL) @@ -1179,7 +1179,8 @@ static void sima_draw_zbuffloat_pixels(float x1, float y1, int rectx, int recty, if(G.scene->camera && G.scene->camera->type==OB_CAMERA) { bias= ((Camera *)G.scene->camera->data)->clipsta; - scale= 1.0f/((Camera *)G.scene->camera->data)->clipend; + clipend= ((Camera *)G.scene->camera->data)->clipend; + scale= 1.0f/(clipend-bias); } else { bias= 0.1f; @@ -1187,9 +1188,16 @@ static void sima_draw_zbuffloat_pixels(float x1, float y1, int rectx, int recty, } rectf= MEM_mallocN(rectx*recty*4, "temp"); - for(a= rectx*recty -1; a>=0; a--) - rectf[a]= (rect_float[a]-bias)*scale; - + for(a= rectx*recty -1; a>=0; a--) { + if(rect_float[a]>clipend) + rectf[a]= 0.0f; + else if(rect_float[a]<bias) + rectf[a]= 1.0f; + else { + rectf[a]= 1.0f - (rect_float[a]-bias)*scale; + rectf[a]*= rectf[a]; + } + } glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_FLOAT, rectf); MEM_freeN(rectf); |