Soft shadows

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
tasora
Posts: 3
Joined: Wed Dec 13, 2006 9:29 am

Soft shadows

Post by tasora »

Hallo,

I think that Irrlicht is a great engine, but I miss an important
feature: soft shadows.

In fact the actual stencil shadows are too slow for practical
usage with complex scenarios. Using shadow maps and
pixel shaders, the performance could be much faster (see
the demos from the Nvidia developer site). Also, the
smoothing on shadow's edges can add some realism in indoor
scenes.

It is not only a matter of loading a specific PS3.0 pixel shader
(this is already possible with Irrlicht), it requires also some
rewriting of the rendering pipeline.

I was thinking of implementing shadow maps by myself, but
maybe that this feature is already under development for future
releases of Irrlicht, does someone know if this is planned?

regards
Alessandro Tasora
www.deltaknowledge.com
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

I was thinking of implementing shadow maps by myself
I think Irrlicht team lacks human power and
if you could do that i would not know right words
how to express my gratitude to you. :D [/quote]
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

The bottleneck at the moment is getting your patches integrated into the engine. Be prepared to maintain your own fork if necesasry.
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

Soft shadows would be great to implement into Irrlicht imo, if it ran faster than stencil that is.

So if ya get a patch or some code going please share it with us, might be good.
tasora
Posts: 3
Joined: Wed Dec 13, 2006 9:29 am

Post by tasora »

Yes, I'd like to make some patching in order to have Irrlicht
supporting soft shadows, but the problem is that I want to
concentrate my efforts on physics (I'm going to release a
multibody physics engine, with easy integration with Irrlicht).
If I write such a feature, I should do it quickly, just to
make few tests - maybe, making changes which aren't
cross-platform compatible, etc.

For example: in the past I made a 'patch' to Irrlicht just to
play a bit with compositing&shaders, but I made it in spare
times, as a 'quick and dirty' modification... After few weeks,
a new official release of Irrlicht introduced the same
features, but with a serious & professional implementation :)
So, I'd not wast my time if I know that someone else is
already working on the same feature... ;)

In the meantime, we could wait, and maybe we can make
a survey: how many Irrlicht users are interested in a more
advanced shadowing system? (I bet many of us, so maybe
that it's worth while introducing soft shadowd as an 'official'
feature for future relases..)

regards
Alessandro
Alessandro Tasora
www.deltaknowledge.com
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I don't think that anyone is working on this seriously right now. At least I don't kow of any plans.
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

Any good shadow technique will probabbly break in the software renderers and non shader enabled machines, so we wont be seeing them as defaults in irr.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The software drivers did not have mipmap support before 1.1, but hardware accelerated had. So there's no reason why we would not support it.
seppuku arts
Posts: 17
Joined: Mon Oct 30, 2006 12:39 pm

Post by seppuku arts »

I'm sure soft shadows will have a performance issue, I've tried them in another engine, and its much slower than stencil shadows, however they will be much faster once direct x 10 is out.

There is a soft shadow shader laying around, that's been implemented into the engine Dark Basic Pro, of course this being a direct X shader, but I'm sure someone will be able to convert it into Open GL.

Much credit to this guy, he has made many awesome shaders, all for Dark Basic, but a bit of tweaking here and there and there should be availibility in Irrlicht.
http://www.vector3r.com/
Running into walls is not a good idea...Trust me
Eternl Knight
Posts: 313
Joined: Tue Nov 01, 2005 5:01 am

Post by Eternl Knight »

DX 10: Soft shadows will be as fast in DX 10 as they will be in OpenGL. Remember that DX 10 is simply an interface to the underlying hardware. I give you 10 to 1 odds that anything the DX 10 interface has not possible in OpenGL 2 will be made available thru OpenGL extensions.

Speed: Soft-shadowing will ALWAYS be slower than simple stencil shadowing as there is simply more work to be done. There are, of course, faster and slower methods (with differing hardware requirements) but their quality and speed is dependent on the situation in which they are used. For example, there soft-shadowing methods that work incredibly well for "indoor scenes" that are simply not feasible in a "landscape" environment.

Personally, I am working on LiSpSM soft-shadows. They work well for the situations I intend to use them in

--EK
tasora
Posts: 3
Joined: Wed Dec 13, 2006 9:29 am

Post by tasora »

Hi Eternl Knight,
Personally, I am working on LiSpSM soft-shadows. They work well for the situations I intend to use them in
Ok, LiSpSM are shadow mapping techniques as well..
That is, apart from the 'soft-' issue, the same idea I was
suggesting: i.e. implementing some kind of shadow mapping
method in Irrlicht.
In fact, I see that current shadow stencil approach in Irrlicht have
an high impact on performance.
Do you have some examples of your LiSpSM tests?

regards
Alessandro Tasora
www.deltaknowledge.com
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

tasora, I don't believe EK does his implementation with irrlicht. ;)
Eternl Knight
Posts: 313
Joined: Tue Nov 01, 2005 5:01 am

Post by Eternl Knight »

Saturn is correct. Irrlicht lacks the features I need for my projects, and so while I keep up to date with it and will contribute every now & then - my projects will tend to be mostly Irrlicht incompatible.

For LiSpSM, I actually think Irrlicht could be hacked to do it. The major change would be that you would need to add code to extract silhouette edges from a light's point of view (or if using an omni/point light - the six views for a depth-map cube... not recommended). Once you have these silhouette edges, you need to create some geometry to represent the "penumbra edges". Render two depth maps and an alpha map (using a couple of shaders), then apply another shader to the scene over all. All of which is possible in Irrlicht - though the speed might be sub-optimal.

If you have read the paper on LiSpSM, it outlines the method in enough detail to implement, along with the issues it has with certian scenes.

--EK
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

or do what i did in irr cinema, draw simple stencil shadows
using this function

http://irrlicht.sourceforge.net/docu/cl ... de.html#a1

then

capture the stencil shadows in a RT, blur that and you are good to go by adding the blurred RT onto the scene (via a postprocessor)

1 render target, infinte objects, 1 texture to blur, shadows dont take texture units on the shadow recieving objects.

read this uncomplete doc(shadow section) to see the most popular algorithms for shdows and their stregths and weaknesses.(may have mistakes, ignore the magenta stuff =p)

http://omaremad.gdlib.net/doc.pdf

sorry i cant help anymore, school just takes so much time.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

Any progress??? :shock:
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
Post Reply