[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13976] trunk/blender/source/blender: Restored code from over a year ago, tests to allow anti-aliased

Ton Roosendaal ton at blender.org
Wed Mar 5 11:03:36 CET 2008


Revision: 13976
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13976
Author:   ton
Date:     2008-03-05 11:03:31 +0100 (Wed, 05 Mar 2008)

Log Message:
-----------
Restored code from over a year ago, tests to allow anti-aliased
shadowbuffers. At the time the results were not satisfying enough,
but we now suffer a shadow problem that might well be solved with
this feature.

Problem:
Temporal aliasing of shadowbuffers when small details move (like strands).

In this case it doesn't work to simply increase the shadowbuffer size,
because strands are pixel-sized. Huge shadowbuffers make strand shadows
almost disappear. So... the shadowbuffer resolution has to be not too high.

Instead of increasing the buffer size, we then create multiple buffers,
each on different subpixel positions (a bit like "FSA" :).

So! Shadowbuffer sampling then works as follows;

1) You take multiple samples in the shadowbuffer, on different locations
   inside (or around) the rendered pixel. 
   That option was aready available as "Samp" button in Lamps

2) Set amount of sample buffers. It is default 1, but can be 4 or 9.

The results of setting it to '4' or '9' buffers you can see here:
http://www.blender.org/bf/filters/index3.html

Actually, deep shadowbuffers could solve it probably too! Anyhoo...

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/convertblender.c
    trunk/blender/source/blender/src/buttons_shading.c

Modified: trunk/blender/source/blender/render/intern/source/convertblender.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/convertblender.c	2008-03-05 06:11:00 UTC (rev 13975)
+++ trunk/blender/source/blender/render/intern/source/convertblender.c	2008-03-05 10:03:31 UTC (rev 13976)
@@ -3339,8 +3339,6 @@
 	/* percentage render: keep track of min and max */
 	shb->size= (lar->bufsize*re->r.size)/100;
 	
-	if(lar->buffers>1) shb->size/= 2;
-	
 	if(shb->size<512) shb->size= 512;
 	else if(shb->size > lar->bufsize) shb->size= lar->bufsize;
 	

Modified: trunk/blender/source/blender/src/buttons_shading.c
===================================================================
--- trunk/blender/source/blender/src/buttons_shading.c	2008-03-05 06:11:00 UTC (rev 13975)
+++ trunk/blender/source/blender/src/buttons_shading.c	2008-03-05 10:03:31 UTC (rev 13976)
@@ -2585,7 +2585,7 @@
 	float grid=0.0;
 	
 	block= uiNewBlock(&curarea->uiblocks, "lamp_panel_spot", UI_EMBOSS, UI_HELV, curarea->win);
-	if(uiNewPanel(curarea, block, "Shadow and Spot", "Lamp", 640, 0, 318, 204)==0) return;
+	if(uiNewPanel(curarea, block, "Shadow and Spot", "Lamp", 640, 0, 318, 224)==0) return;
 
 	/* hemis and ray shadow dont work at all... */
 	/* yafray: ignore photonlight as well */
@@ -2635,9 +2635,10 @@
 				uiDefButS(block, ROW,B_NOP,	"Tent",				165,90,65,19, &la->filtertype, 0.0, LA_SHADBUF_TENT, 0, 0, "Apply Tent filter for shadowbuffer samples");
 				uiDefButS(block, ROW,B_NOP,	"Gauss",			230,90,70,19, &la->filtertype, 0.0, LA_SHADBUF_GAUSS, 0, 0, "Apply Gauss filter for shadowbuffer samples");
 				
-	//			uiDefButS(block, ROW,B_NOP,"SubSamples: 1",		100,90,140,19, &la->buffers, 1.0, 1.0, 0, 0, "Amount of lampbuffer subsamples, a value of larger than 1 halves the shadowbuffer size");
-	//			uiDefButS(block, ROW,B_NOP,"4",					240,90,30,19, &la->buffers, 1.0, 4.0, 0, 0, "Amount of lampbuffer subsamples, this halves the actual shadowbuffer size");
-	//			uiDefButS(block, ROW,B_NOP,"9",					270,90,30,19, &la->buffers, 1.0, 9.0, 0, 0, "Amount of lampbuffer subsamples, this halves the shadowbuffer size");
+				uiBlockBeginAlign(block);
+				uiDefButS(block, ROW,B_NOP,"SampleBuffers: 1",	100,-15,140,19, &la->buffers, 1.0, 1.0, 0, 0, "Only one lampbuffer rendered");
+				uiDefButS(block, ROW,B_NOP,"4",					240,-15,30,19, &la->buffers, 1.0, 4.0, 0, 0, "Renders 4 lampbuffers for better AA, this quadruples memory usage");
+				uiDefButS(block, ROW,B_NOP,"9",					270,-15,30,19, &la->buffers, 1.0, 9.0, 0, 0, "Renders 9 lampbuffers for better AA, this uses nine times more memory");
 			
 				uiBlockBeginAlign(block);
 				uiDefButS(block, NUM,B_LAMPREDRAW,"Samples:",	100,60,100,19,	&la->samp,1.0,16.0, 0, 0, "Sets the number of shadow map samples");





More information about the Bf-blender-cvs mailing list