Ogre Soft Shadows Demo

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!
Romz
Gnoblar
Posts: 22
Joined: Wed Mar 26, 2008 4:53 pm
Location: Paris, France

Post by Romz »

Ok I just found that the problem goes away if I disable the directional light. But that's not a solution :lol:
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

Romz wrote:Ok I just found that the problem goes away if I disable the directional light. But that's not a solution :lol:
This shader won't directly work with directional lights because it assumes that the length of the light space vectors equals the distance from the light to the point being shaded - obviously, this is incorrect with directional lights. It'd be possible to manually send the rescaling parameters to the shaders, or maybe use a constant parameter. Also, your screen shots shadows seem _extremely_ low-res: what were you using, 256x256, by any chance :D? Combine that with the default 3x3 filter and what you see is displayed in your screenshots ;).

EDIT: Read my post on page 6 of the discussion topic
Cronk
Gnoblar
Posts: 3
Joined: Sat May 10, 2008 12:28 pm

Post by Cronk »

Hi, I've been watching Ogre and playing around with it for a while now and now I wanted to play a bit with this Softshadows because I think they look pretty nice.
My problem is, that I can not really compile it, anyone knows which settings to use in VS2008?
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

Cronk wrote:Hi, I've been watching Ogre and playing around with it for a while now and now I wanted to play a bit with this Softshadows because I think they look pretty nice.
My problem is, that I can not really compile it, anyone knows which settings to use in VS2008?
It's really just basic Ogre stuff, set up your project as you would for any of the Ogre examples to compile.
Cronk
Gnoblar
Posts: 3
Joined: Sat May 10, 2008 12:28 pm

Post by Cronk »

Thats what I did, but the compiler gives me a LNK4210 warning. When I start the App it crashes with a standart Windows error and without any logfile. The debugger tells me, that there is something wrong with the line mgr.cfgFile.loadDirect("../../data/config.ini");, to be exact it says:

Code: Select all

Unbehandelte Ausnahme bei 0x109a1359 in myapp.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x00000000.
Translated to english this is something like

Code: Select all

Unhandled exception at 0x109a1359 in myapp.exe: 0xC0000005: access violation while reading position 0x00000000.
Cronk
Gnoblar
Posts: 3
Joined: Sat May 10, 2008 12:28 pm

Post by Cronk »

-.-
Call me an idiot, i had my Subsystem set to Windows, changed it to console and it works perfect. However thanks.
chowchow
Gnoblar
Posts: 4
Joined: Wed Mar 05, 2008 9:48 am

Post by chowchow »

Is your implementation traditional shadow map in the show_cast.material?
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

chowchow wrote:Is your implementation traditional shadow map in the show_cast.material?
Nope, it stores linear depth to the eye in the red channel, and a squared version in the green channel (for VSM).
chowchow
Gnoblar
Posts: 4
Joined: Wed Mar 05, 2008 9:48 am

Post by chowchow »

nullsquared wrote:
chowchow wrote:Is your implementation traditional shadow map in the show_cast.material?
Nope, it stores linear depth to the eye in the red channel, and a squared version in the green channel (for VSM).
That is to say, you implement VSM in this demo? Why did you store a squared depth value into green channel for? And, I cannot see any code of shadow reciever. How did you deal with it?
Excuse me for my so many questions. I want to implement "Queried Virtual Shadow Mapping" in OGRE. But I really have no any idea to implement it. I want to get something valueable from your demo. Thanks a lot :)
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

chowchow wrote:
nullsquared wrote:
chowchow wrote:Is your implementation traditional shadow map in the show_cast.material?
Nope, it stores linear depth to the eye in the red channel, and a squared version in the green channel (for VSM).
That is to say, you implement VSM in this demo?
Yup. Just plain old VSM. A better demonstration would be LVSM, but I didn't (and still don't) have the time to fully implement it.
Why did you store a squared depth value into green channel for?
This way you can filter the shadow map and compute the variance between the squared depth and the "real" squared depth. Thus, variance shadow mapping.
And, I cannot see any code of shadow reciever. How did you deal with it?
I use a texture_unit with "content_type shadow" to pull in the shadow texture directly into the lighting shader - thus, no need for a receiver, the lighting shader automatically makes use of the shadow map.
chowchow
Gnoblar
Posts: 4
Joined: Wed Mar 05, 2008 9:48 am

Post by chowchow »

[/quote]
I use a texture_unit with "content_type shadow" to pull in the shadow texture directly into the lighting shader - thus, no need for a receiver, the lighting shader automatically makes use of the shadow map.[/quote]
I've got it. Thanks.
User avatar
dustbin1_uk
Halfling
Posts: 55
Joined: Sat Dec 22, 2007 6:56 pm
x 1

Post by dustbin1_uk »

Sorry to be a total noob, :roll: :oops:
but is this soft shadow functionality a part of the OgreSDK or is it something Nullsquared has written for everyone to enjoy?

Either way the demo's look amazing in those screenshots!

Mark
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
x 3

Post by Praetor »

Option #2
User avatar
dustbin1_uk
Halfling
Posts: 55
Joined: Sat Dec 22, 2007 6:56 pm
x 1

Post by dustbin1_uk »

Praetor wrote:Option #2
Meaning....? :oops:

EDIT:
OH! I GET IT!! Sorry, Well done on this awesome work then! LOL
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

dustbin1_uk wrote:
Praetor wrote:Option #2
Meaning....? :oops:

EDIT:
OH! I GET IT!! Sorry, Well done on this awesome work then! LOL
Well, actually now that I look back on it, it's not really all that awesome. I mean, I didn't really take the time to make it very polished or anything, and the code can really be expanded. The 'soft shadows w00t!' part is a bit exaggerated as well, you can get nice anti-aliased/soft edges but it's not 'real' soft shadows. Though, if I do say so myself, it's a nice little base to work off of if you're looking for an Ogre-based implementation of VSM. LVSM would be really neat, or even ESM.
User avatar
dustbin1_uk
Halfling
Posts: 55
Joined: Sat Dec 22, 2007 6:56 pm
x 1

Post by dustbin1_uk »

Hey don't knock it! It's progress!

So are you the only one working on this?
I've seen soft shadows in the Crystal Space project Apricot, has anyone managed to do something similar here? Other than your great effort.
bharling
Gremlin
Posts: 166
Joined: Fri Jun 30, 2006 1:04 pm

Post by bharling »

Apricot uses the PSSM technique ( as far as I know ), which is probably the best solution for doing soft-shadows on large scale environments with a single main light source. You can do this in the latest release of ogre, but its not that easy to set up. The results are worth it though.

For internal environments with several light sources nullsquared's solution is probably better.
Was here
User avatar
dustbin1_uk
Halfling
Posts: 55
Joined: Sat Dec 22, 2007 6:56 pm
x 1

Post by dustbin1_uk »

That's great, thanks for the info.
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

dustbin1_uk wrote: So are you the only one working on this?
Not much to work on, really. It was just a quick one-time release for a quick and nice base for VSM.
User avatar
dustbin1_uk
Halfling
Posts: 55
Joined: Sat Dec 22, 2007 6:56 pm
x 1

Post by dustbin1_uk »

So this link here:

http://www.ogre3d.org/index.php?set_alb ... _photo.php

Is this a demo or a part of the SDK that I missed? Because this is pretty impressive.
User avatar
Bluntspoon
Gnoblar
Posts: 6
Joined: Thu Jan 15, 2009 1:39 pm

Re: Ogre Soft Shadows Demo

Post by Bluntspoon »

I want.
Can somebody please put a download link that works, none of them work or you must pay.
Thanks
User avatar
Azgur
Goblin
Posts: 264
Joined: Thu Aug 21, 2008 4:48 pm

Re: Ogre Soft Shadows Demo

Post by Azgur »

Bluntspoon wrote:I want.
Can somebody please put a download link that works, none of them work or you must pay.
Thanks
The rapidshare link works just fine for me. Without paying.
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1

Re: Ogre Soft Shadows Demo

Post by Evak »

We finally got these shadows working in Flow3D. Look great, had a problem in Eihort using a DX9 card in vista. We just updated flow to shoggoth and now the shadows work perfectly in both GL and DX9.

Really made my day and thanks for showing the way :)

Here's a quick screenshot of the Flow Soft shadows example.

Image

Were going to add a helper function to make these really easy to set up in flow.

fG.enableSoftShadows(...)

You will still be able to set it up manually for those that want to of course :).
User avatar
dustbin1_uk
Halfling
Posts: 55
Joined: Sat Dec 22, 2007 6:56 pm
x 1

Re: Ogre Soft Shadows Demo

Post by dustbin1_uk »

Nice work!!! Well done!!!