From f975d297041bc1f60ba415e811564f7b2297c4a8 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 5 Mar 2008 10:03:31 +0000 Subject: 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... --- source/blender/src/buttons_shading.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/blender/src/buttons_shading.c') diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index e0196017727..bcd6ffb1aef 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -2585,7 +2585,7 @@ static void lamp_panel_spot(Object *ob, Lamp *la) 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 @@ static void lamp_panel_spot(Object *ob, Lamp *la) 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"); -- cgit v1.2.3