chaosfire / vdrift-ogre

Automatically exported from code.google.com/p/vdrift-ogre
0 stars 0 forks source link

Soft shadows #119

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Soften the edges of shadows to get a more realistic look. Since making them 
soft can cause a performance hit, also make gui option to disable it (or a 
quality slider)

I can imagine 3 techniques to achieve this:

1. perform a blur compositor on the shadow textures. this probably won't go 
well with PSSM and will be very slow.

2. PCF filter. currently we have a fixed-size 2x2 filter, we could extend this 
with a kernel width option and a more precise filter.

3. VSM shadowing. this one is more or less an entire new shadowing technique 
that saves a distribution of depths at each pixel in the shadow map. it should 
also have less self-shadowing artifacts than PSSM. i don't know about 
performance if it will be faster or slower (but i doubt that faster)

Original issue reported on code.google.com by scrawl...@gmail.com on 29 Nov 2011 at 1:22

GoogleCodeExporter commented 8 years ago

Original comment by scrawl...@gmail.com on 29 Nov 2011 at 1:50

GoogleCodeExporter commented 8 years ago
shadows are always a nightmare,this patch have some uncooked changes to show 
softshadows in SR to see if it'll look good

attached the patch and the output i got,basically a PSVSM with 3x3 pcf filter
you can look for line float2 off = offset*3 and change 3 to get a soft edge 
shadows(1) vs penumbra shadows(>1)

this only does it to the terrain shader and should not be checked in without 
supporting all the other materials and lots of testing and fixing if it deemed 
useful 
.doing shaders in cpp files is quite hard and time consuming,i'm glad i got 
this far.scrawl, if you like the picture go ahead and take the lead :)    

Source:
http://ogre3d.org/forums/viewtopic.php?t=39809&sid=7938d624f6f1d2c3363f0734152f5
1d8
http://www.ogre3d.org/forums/viewtopic.php?f=1&t=46819

Original comment by a.isma...@gmail.com on 18 Jan 2012 at 1:49

Attachments:

GoogleCodeExporter commented 8 years ago
screenshot looks cool!

Could you make a patch against master? I could only apply it on Graphics 
branch, but there the shadows were bugged, probably because of the MRT in 
opengl. I've tried to manually apply it to master, but there are too many 
undefined variables (wMat, worldPosition, lightPosObjSpace etc)

Original comment by scrawl...@gmail.com on 18 Jan 2012 at 10:26

GoogleCodeExporter commented 8 years ago

Original comment by scrawl...@gmail.com on 31 Jan 2012 at 1:27

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 12 Feb 2012 at 7:25

GoogleCodeExporter commented 8 years ago
I think it's good enough with this filter value on Gui. I don't see reasons for 
better smoothing, or implementing VSM if it's not so easy to get it working.

Original comment by Cry...@gmail.com on 4 Mar 2012 at 7:31

GoogleCodeExporter commented 8 years ago

Original comment by Cry...@gmail.com on 18 Mar 2012 at 7:03

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Deadly low priority, closing. Now even shadow filter got broken.

Original comment by Cry...@gmail.com on 20 Nov 2012 at 6:01