The zblur plugin (aka as DoF) integrated in render. Compared to patch

submitted by Alexander, changes/improvements are:

- Moved to new Panel in Scene buttons "Post Effects". Together with other
  postprocessing options, such as Edge render. It is also not called DoF,
  this because that's a bit pretending too much then. It's a zblur still!
- Made it render Alpha as well
- Made it use and deliver float buffers
- Huge cleanup of zblur.c code, was very messy. It was alling things in render
  code without need even (win matrices, transform faces, etc)
- Fixed errors in using Z values (zbuffer is signed int)
- Removed very weird gamma corrections for front/back half
- Tweaked gaussian table, allow variable 'Sigma' to be set for gauss curve
- Didn't copy 'auto focus' yet. Use of this is very limited, and gives
  false expectations, nor works for rendering anims with deamons well.

Main issue remains: it's not a very advanced feature... I still doubt
very much if this deserves to be released. Spent 2 days on trying to get
the key issues solved, with not much results.

- gauss filter code has weird side effects on large blur size
- having unsharp (blurred) in front also blurs what's around in back.
  only blurred in back with sharp in front works a little bit
- severe aliasing errors... also due the code splitting in 2 halves
- doesnt work with unified yet
- won't work for halos, spot halos or transparant faces

Anyhoo... It was promised to be committed, so now artists can play with it.
Who knows it's useful after all, or some fixes can be implemented. :)
This commit is contained in:
2005-04-23 20:49:23 +00:00
parent 0dcba86c6b
commit 7fa7826da7
16 changed files with 971 additions and 40 deletions

View File

@@ -365,15 +365,15 @@ static void renderwin_mouse_moved(RenderWin *rw)
if (rw->flags & RW_FLAGS_PIXEL_EXAMINING) {
int imgco[2];
char buf[64];
unsigned int *pxl2;
unsigned char *pxl;
int *pxlz; // zbuffer is signed
char *pxl;
if (R.rectot && renderwin_win_to_image_co(rw, rw->lmouse, imgco)) {
pxl= (char*) &R.rectot[R.rectx*imgco[1] + imgco[0]];
if (R.rectz) {
pxl2= &R.rectz[R.rectx*imgco[1] + imgco[0]];
sprintf(buf, "R: %d, G: %d, B: %d, A: %d, Z: %f", pxl[0], pxl[1], pxl[2], pxl[3], (float)(((float)*pxl2-(float)INT_MIN)/(float)UINT_MAX));
pxlz= &R.rectz[R.rectx*imgco[1] + imgco[0]];
sprintf(buf, "R: %d, G: %d, B: %d, A: %d, Z: %f", pxl[0], pxl[1], pxl[2], pxl[3], 0.5+0.5*( ((float)*pxlz)/(float)INT_MAX) );
}
else {
sprintf(buf, "R: %d, G: %d, B: %d, A: %d", pxl[0], pxl[1], pxl[2], pxl[3]);