Jump to content

  • Log In with Google      Sign In   
  • Create Account

Looking for soft shadows algorithm


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
19 replies to this topic

#1 user88   Members   -  Reputation: 268

Like
0Likes
Like

Posted 04 February 2011 - 08:53 AM

Hi,

I'm looking for fast perfect quality Soft Shadows algorithm for room interior visualization. The 3D scene has a lot of polygons and about 1-5 light sources.

I have already implemented PCSS but result is not good enough. If i use so much texture lookups that satisfies the quality then i get only 1-2 FPS.

Maybe for such specific 3d scenes there is more acceptable approach than PCSS?

I have found some interesting video where is backing shadows algorithm. I'm not familiar with this algorithm. Is this algorithms good for my goals? Is it very complicated to implement?

Note, i'm using DirectX 9 API.

Thanks for advice.

Sponsor:

#2 Doug Rogers   Members   -  Reputation: 173

Like
0Likes
Like

Posted 04 February 2011 - 10:11 AM

Hi,

I'm looking for fast perfect quality Soft Shadows algorithm for room interior visualization. The 3D scene has a lot of polygons and about 1-5 light sources.

I have already implemented PCSS but result is not good enough. If i use so much texture lookups that satisfies the quality then i get only 1-2 FPS.

Maybe for such specific 3d scenes there is more acceptable approach than PCSS?

I have found some interesting video where is backing shadows algorithm. I'm not familiar with this algorithm. Is this algorithms good for my goals? Is it very complicated to implement?

Note, i'm using DirectX 9 API.

Thanks for advice.


"Baking", from the video, is burning the shadows into the texture maps. If the lights don't move, it's a cheap and fast solution.

#3 smasherprog   Members   -  Reputation: 432

Like
1Likes
Like

Posted 04 February 2011 - 01:10 PM

Exponential Shadow maps are probably the best out there right now and are not that difficult to implement.
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.

#4 maxest   Members   -  Reputation: 294

Like
0Likes
Like

Posted 04 February 2011 - 04:58 PM

Yeah. I would opt for exponential shadow maps too. They are very fast and give very pleasant results.

#5 dpadam450   Members   -  Reputation: 928

Like
0Likes
Like

Posted 04 February 2011 - 10:29 PM

Here is a pretty cool technique.

http://p-o-p-games.com/Research/ISSS.html

#6 Shanee   Members   -  Reputation: 175

Like
0Likes
Like

Posted 05 February 2011 - 04:21 AM

I think I'd suggest Cascaded Shadow Mapping over Exponential Shadow Maps but it was a long time since I looked into it.

#7 maxest   Members   -  Reputation: 294

Like
0Likes
Like

Posted 05 February 2011 - 11:19 AM

To be honest, I dont get why you consider Cascaded Shadow Mapping. As far I as I see user88 wants to render an interior with a few lights. CSM is very expensive and it is used to cover a large terrain with shadows, usually used for the sun lighting. The idea of CSM in itself is not to smooth shadows but to help alleviate the perspective aliasing problem.

#8 samoth   Crossbones+   -  Reputation: 4783

Like
0Likes
Like

Posted 05 February 2011 - 12:20 PM

I think I'd suggest Cascaded Shadow Mapping over Exponential Shadow Maps but it was a long time since I looked into it.

Exponential shadow maps are orthogonal to cascaded shadow mapping (i.e. it's not one or the other, you can use both at the same time). For interior rendering, however, cascaded shadow maps do not make so terribly much sense, since they give the biggest benefits when the possible ranges are large, such as a low standing sun casting shadows outside.

The idea about cascaded shadow maps is to partition depth, so different ranges get different resolutions, and the total available shadow map resolution is best used where it is most visible. That is, more texels closer to the eye, and fewer of them where you can't see it anyway.
Exponential shadow maps turn "closest distance from light" into "probability that point is in shadow depending on distance to light", which is a totally different thing.

#9 PolyVox   Members   -  Reputation: 708

Like
1Likes
Like

Posted 05 February 2011 - 01:44 PM

Be aware that ESMs do have problem though - in particular when a caster is very near to a receiver. If you have a character standing on the ground then his feet can have a much fainter shadow than his body. On the plus side this immediatly solves the shadow acne problem for self shadowing objects.

All shadow mapping approaches have problems - if there was one perfect solution everyone would be using it. The best you can do is understand the limitations of the different approaches and pick the one which has the least drawbacks for your particular scenario.

Also, you still haven't said whether your lights/geometry are dynamic. If they are static then baked lighting is your best option.

#10 wolf   Members   -  Reputation: 848

Like
0Likes
Like

Posted 05 February 2011 - 04:25 PM

You are looking for something like this:

http://www.facebook.com/album.php?aid=159265&id=159613387880

You can find a description of this here:

www.wolfgang-engel.info

Give me a sign how this goes.

#11 Vilem Otte   Crossbones+   -  Reputation: 1424

Like
0Likes
Like

Posted 05 February 2011 - 05:15 PM

I did have some good results with standard shadow mapping and some clever bilinear filtering, with shadow maps rendered from multiple points on the light (or even single, based upon how does it look in the scene) ... results:
Posted Image Posted Image

On the left side - direct lighting + shadows, on the right side whole image. This solution will most likely suit if you don't need high quality penumbra shadows, for penumbra shadows, there is no really good rasterizer solution - I did have some luck with heavily modified percentage closer soft-shadows, this is example:
Posted Image Posted Image

On the left side penumbra shadows, no radiosity ... on the right side, whole solution (smaller light on the right, larger on the left). This solution is quite time-consuming. And the last of my rasterized shadow solutions is radiosity based one (don't run away, it isn't that slow), based upon lots (and I mean lots) of small shadow maps, giving very nice fuzzy shadow ... I tested just cornell box, and here is example:
Posted Image Posted Image


On the left there is really huge light in the cornell box, and on the right result with pretty small light (and also instant radiosity).

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com


#12 wolf   Members   -  Reputation: 848

Like
0Likes
Like

Posted 06 February 2011 - 10:51 AM

Vilem, did you publish the description of your perceptually correct soft shadow algorithm? I would be interested in reading how you did it.

#13 Vilem Otte   Crossbones+   -  Reputation: 1424

Like
0Likes
Like

Posted 06 February 2011 - 05:45 PM

Actually I haven't published (nor created) paper for last two mentioned soft shadow technique (first is just slight modification of PCSS - it would probably be just 1 page, or 2 pages with code, second is math/physics-derived solution, that has close relation to statistics, probability, and such), I just presented some applications on local game developers meeting (called Game Access) last fall - just mentioning this shadowing technique on one or two slides.

I thought of writing some kind of paper + some specific demo application on the algorithm, but never convinced myself that it could actually be interesting.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com


#14 user88   Members   -  Reputation: 268

Like
0Likes
Like

Posted 07 February 2011 - 02:55 AM

Thanks for all for your answers.

Also, you still haven't said whether your lights/geometry are dynamic. If they are static then baked lighting is your best option.


Yes, the scene is static. So, is baked lighning better for my case than ESM? Where i can find any information how to implement this technique (i mean baked lightning technique)? After short googling i found nothing about it.

#15 user88   Members   -  Reputation: 268

Like
0Likes
Like

Posted 07 February 2011 - 03:54 AM

Notation to my last post:
our project has build-in Mental ray render system. So, maybe this can be useful for lightmaps generation. Also note, that application should able to generate lightmaps itself.

#16 PolyVox   Members   -  Reputation: 708

Like
1Likes
Like

Posted 07 February 2011 - 01:58 PM

If your scene and lights are static then you won't find a better solution than baked lighting. If you need moving characters or something then it's more complicated (but you can still bake some of the lighting). Try searching for 'lightmapping' for more information. The lightmap is simply a precomputed texture which contains the lighting information and which you apply to your scene.

Beast is a professional tool which has been used for doing the lighting in a lot of games. You can read about it here: http://usa.autodesk.com/adsk/servlet/pc/index?siteID=123112&id=15779574. You can also use 3D modelling packages such as Blender for generating the lightmaps.

#17 user88   Members   -  Reputation: 268

Like
0Likes
Like

Posted 08 February 2011 - 07:15 AM

Beast is a professional tool which has been used for doing the lighting in a lot of games. You can read about it here: http://usa.autodesk....112&id=15779574. You can also use 3D modelling packages such as Blender for generating the lightmaps.


Thanks for answer PolyVox.

I have made some research in web and now I understand that backed lightmaps is the best technique for us.

Is there anybody know any free third-party API for backing lightmaps? :rolleyes:

#18 PolyVox   Members   -  Reputation: 708

Like
0Likes
Like

Posted 08 February 2011 - 02:58 PM

The word is baked not backed, I don't mean to be picky but you'll get more search results that way ;-)

More generally, baked lighting refers to any kind of lighting which is static and precalculated. Lightmaps are a popular way of storing lighting information for world geometry, but you also have the option of storing it in the vertices. For charachters you would typically store your baked lighting in irradience volumes, but you won't need to worry about that for now.

There are essentially two things you need to do. First you need a way of caculating the lighting and generating the lightmaps. A tool like Beast or Blender (as mentioned previously) will be useful here. Secondly you need a way to render the data. The lightmap is just a texture which you will want to combine with your base texture so you'll need to read about 'multitexturing'.

Here's a few links I came across:

http://www.flipcode.com/archives/Light_Mapping_Theory_and_Implementation.shtml
http://www.flipcode.com/archives/Advanced_Lightmapping.shtml
http://www.alsprogrammingresource.com/lightmapping.html
http://www.alsprogrammingresource.com/lightmapping_tutorial.html

#19 Shanee   Members   -  Reputation: 175

Like
0Likes
Like

Posted 09 February 2011 - 01:53 AM

Oh, sorry, I didn't read it all and missed the mention of interior.

#20 user88   Members   -  Reputation: 268

Like
0Likes
Like

Posted 10 February 2011 - 04:09 AM

Here's a few links I came across:

http://www.flipcode....mentation.shtml
http://www.flipcode....htmapping.shtml
http://www.alsprogra...ghtmapping.html
http://www.alsprogra...g_tutorial.html


Thank you PolyVox, links which you have shared are all what i need at the moment. Currently i'm digging deeper this information.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS