Custom shadow techniques with Ogre

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
claustre
Goblin
Posts: 278
Joined: Thu Mar 23, 2006 10:35 am
Location: Toulouse, France
Contact:

Custom shadow techniques with Ogre

Post by claustre » Wed May 24, 2006 3:44 pm

I am playing for a while with Ogre and every day I said to myself : "what a wonderfull 3D engine !". Now I have implemented different shadow techniques (all based on shadow mapping though) I want to share some screenshots, even to only show it is possible to do it with Ogre !
I have a GeForce 6800 GT.

Standard shadow mapping (117 FPS) :
Image
Variance shadow mapping (76 FPS) :
Image
Fixed kernel width (4 samples) percentage closer filtering (26 FPS) :
Image
Varying kernel width (4 samples) percentage closer filtering (7 FPS) :
Image
The last one allows to increase the filter width according to light's size as shown here where I increase it from top to bottom :
Image

I prefer to use fixed kernel width percentage closer filtering because it always work (apart for some depth offset issue). On a more complex scene (170 000 triangles), with anti-aliasing 2x, HDR rendering with glow, it runs at 4 FPS :
Image
VSM has some known "light bleeding" problem for high depth complexity scenes :
Image

I cannot share my shaders as I work for a company but I can help anyone that wants to implement custom shadows with Ogre, as I already did before in the forum.
0 x

User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England

Post by Chris Jones » Wed May 24, 2006 7:09 pm

holy cow :)

nice screenshots :P
0 x

Uber
Halfling
Posts: 83
Joined: Fri Feb 17, 2006 1:44 am
Location: Vancouver, BC, Canada
Contact:

Post by Uber » Wed May 24, 2006 7:10 pm

i love em especially thcar Shiney!lol :D nice work
0 x
Image
Image

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
Contact:

Post by Falagard » Wed May 24, 2006 7:18 pm

Nice work dude. Pity you can't share your source but looks good. Any modifications necessary to Ogre or did the existing shadow caster and receiver shader functionality fit the bill?
0 x

User avatar
raicuandi
Gargoyle
Posts: 1092
Joined: Wed Nov 09, 2005 12:56 pm
Location: Adelaide, Australia
Contact:

Post by raicuandi » Wed May 24, 2006 7:19 pm

Wow, it looks great! Good job mate! :wink:
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Post by jacmoe » Wed May 24, 2006 7:21 pm

Quite interesting to see how much better it looks with Variance shadow mapping! And, compared to the other shadow techniques: pretty cheap. :wink:
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

klauss
Hobgoblin
Posts: 559
Joined: Wed Oct 19, 2005 4:57 pm
Location: LS87, Buenos Aires, República Argentina.

Post by klauss » Wed May 24, 2006 9:13 pm

Yeah to jacmoe - any chance that we might take a peek at the code?
0 x
Oíd mortales, el grito sagrado...
Hey! What is it with that that?
Wing Commander Universe

User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
Contact:

Post by Praetor » Wed May 24, 2006 9:35 pm

No, he said he can't release it.
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Wed May 24, 2006 11:34 pm

Great, glad you got it to work. :)

For everyone elses benefit, adding this isn't too difficult now the ability to plug in custom shadow materials is working properly (and claustre helped find a few wrinkles in there). I'll admit it would be nice to see his stuff but given a few papers on PCF and VSM I'm sure most people could have a good go.

One of my students for SoC2006 is looking at extending the shadow mapping techniques, although his main targets are techniques to improve texel distribution (plane-optimal and scene-optimal shadow mapping). This can be complimentary to custom material techniques like VSM and PCF though.
0 x

klauss
Hobgoblin
Posts: 559
Joined: Wed Oct 19, 2005 4:57 pm
Location: LS87, Buenos Aires, República Argentina.

Post by klauss » Thu May 25, 2006 2:17 am

Praetor wrote:No, he said he can't release it.
Oh - I missed that. :(
0 x
Oíd mortales, el grito sagrado...
Hey! What is it with that that?
Wing Commander Universe

claustre
Goblin
Posts: 278
Joined: Thu Mar 23, 2006 10:35 am
Location: Toulouse, France
Contact:

Post by claustre » Fri May 26, 2006 8:29 am

Any modifications necessary to Ogre or did the existing shadow caster and receiver shader functionality fit the bill?
Just some minor bug corrections and add-ons, everything is fine with the last release.

Maybe I will find some time to explain how to make it work with simple exemples in the wiki. Indeed I can extract some well-known code portion from our shaders (standard shadow mapping, VSM that has been published, etc.) and detail the implementation issues.
I cannot give a release date though, but any help is welcome !
http://www.ogre3d.org/wiki/index.php/Cu ... ow_Mapping
0 x

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
Contact:

Post by Vectrex » Fri May 26, 2006 10:50 am

neat.. I'm busting to see some good examples of shadowmapping in ogre, thanks!
0 x

User avatar
Falagard
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2060
Joined: Thu Feb 26, 2004 12:11 am
Location: Toronto, Canada
Contact:

Post by Falagard » Mon May 29, 2006 6:16 am

Wow, very nice work on the wiki entry!
0 x

claustre
Goblin
Posts: 278
Joined: Thu Mar 23, 2006 10:35 am
Location: Toulouse, France
Contact:

Post by claustre » Mon May 29, 2006 1:08 pm

I am proud to announce the release of the entry in the wiki !
However, I extract this from my complex application that entirely builds shaders and materials from code. So I never tested it (shame on me) ! If someone would try to implement shadow mapping using the tutorial I will be very interested in his comments and error reports.
0 x

klauss
Hobgoblin
Posts: 559
Joined: Wed Oct 19, 2005 4:57 pm
Location: LS87, Buenos Aires, República Argentina.

Post by klauss » Mon May 29, 2006 4:25 pm

Thank you so very utterly much - I've been struggling with shadows for a while now, and always procrastinated implementing something like that because... well... I couldn't grasp how to do it in Ogre the proper way in the little free time I had.

I will try the wiki stuff whenever I get the time (not this week :( ).
0 x
Oíd mortales, el grito sagrado...
Hey! What is it with that that?
Wing Commander Universe

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Mon May 29, 2006 5:41 pm

Thanks claustre, much appreciated.

I'm just happy someone has started stressing this feature (ability to plug in custom shadow techniques) - it's actually been around for a fair while but I never got time to write a good test for it. Your work, plus one of the projects in Summer of Code this year, should really start to show what it can do.
0 x

Yonaz
Gnoblar
Posts: 9
Joined: Sun Jun 11, 2006 9:05 pm
Location: Germany
Contact:

Post by Yonaz » Wed Jul 26, 2006 10:35 am

Hey claustre,

i just looked at the nice pictures.. but i wondered why the FPS are so low. Is it debug-build? (sorry if i missed that) If those are the FPS for one light and two simple primitives (without fancy shaders), what would FPS be like in an actual game?

Greets, Yonaz
0 x

fantscher
Gnoblar
Posts: 14
Joined: Mon May 01, 2006 4:53 pm

Post by fantscher » Wed Jul 26, 2006 10:49 am

Yonaz wrote:Hey claustre,

i just looked at the nice pictures.. but i wondered why the FPS are so low. Is it debug-build? (sorry if i missed that) If those are the FPS for one light and two simple primitives (without fancy shaders), what would FPS be like in an actual game?

Greets, Yonaz
the same... soft shadows in ogre aren't for games, because it's too slow.
0 x

claustre
Goblin
Posts: 278
Joined: Thu Mar 23, 2006 10:35 am
Location: Toulouse, France
Contact:

Post by claustre » Wed Jul 26, 2006 11:03 am

Yonaz wrote:Hey claustre,

i just looked at the nice pictures.. but i wondered why the FPS are so low. Is it debug-build? (sorry if i missed that) If those are the FPS for one light and two simple primitives (without fancy shaders), what would FPS be like in an actual game?

Greets, Yonaz
Yes it is a debug build but this is not the point as in this case we are GPU- and not CPU- limited. Soft shadows are very costly at the present time and not well-suited for games (even "fake" techniques that aren't physically realistic). There are many reasons for that depending on the method chosen (too much texture look-ups required, complex geometrical computations, ...). Have a look at http://www.irit.fr/~Gael.Guennebaud/doc ... egsr06.pdf for an interesting new alternative and a state of the art on recent progress.

In our car example soft shadows are coupled with other complex and multi-pass techniques such as per-pixel HDR lighting (8 lights + tone mapping + glow), this also explain the very low performances.
0 x

Post Reply