Jump to content
  • Advertisement
Sign in to follow this  
riuthamus

Unity Point Light Shadow Mapping

This topic is 2069 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So, with the help of this community we have been able to get point lights working. The issue is they are dull and boring and lack shadows....

 

[media]

">
[/media]

 

Is an example of the brightness we desire and kinda the shadows. We dont need 100% realistic shadowing that blows the mind but we certainly dont want to see the point lights on the other side of the wall. So if i put a torch on a wall outside of the house I wont see the torch point light inside of the house and on the floor ( since it is blocked by the outside wall ).

 

How would we go about doing this? Keep in mind we are using defered rendering system as well as C# in SharpDX platform. We are using the most recent DX11.1 so we have the capabilities to use some of the cooler aspects of dx.

 

Any and all help would be appreciated! Thank you.

Share this post


Link to post
Share on other sites
Advertisement

Ok so here are my thoughts:

Point lights shining through walls is just normal and I dont think that most or even any of todays graphics engines care about this. Normally it's the light artists job to place spot lights and point lights in a appropriate way. The easiest way to get rid of it is to use shadowmaps but in complex scenes and in games where the player is capable of placing nearly an infinite amount of light entities this will kill every system. What you could try is to change the light volumes of each light individually. Instead of drawing a sphere use a box and cut out everything that is behind a wall.

If you want to implement point light shadows you could look into Dual Paraboloid Shadow Mapping:

http://gamedevelop.eu/en/tutorials/dual-paraboloid-shadow-mapping.htm

Maybe there are better and newer techniques but I cannot think about any at the moment. Of course you can go with any shadowmapping technique you like, then you just need to draw a bunch of shadowmaps per light.

I didnt read the whole soft shadow tutorial but it seems that they are just using a simple blur which should not use 400 MB but I dont know your engine setup.

I think you just need to read through some different techniques and choose the one you like the most there tons of tutorials and examples out there. My personal favorit is Variance Shadow Mapping:

http://www.punkuser.net/vsm/

It is easy to implement and easy to combine with CSM or Parallel Splits or whatever you choose and gives the possibility to use linear filtering methods, gauss and even MSAA.

Now some words about the issues you wrote about in the old thread:

I think the bright center is basically a different material for light entities boosting the light power so that the bloom can give it a halo. And The Witcher is using a strong bloom there a bit too strong for my taste. The background where the light is shining through the wood and getting a blue halo is a slight overkill. If your lights are to dull overall you could also try adjusting your tonemapper. Lowering the white value will make the colors burn out earlier and produces brighter images but you will also loose more details.

Share this post


Link to post
Share on other sites
You could try this http://kayru.org/articles/dssdo/
It does not give that high quality shadows but it gives nice soft contact shadows for every point light with minimal cost,
only one dot product. Dssdo can also be done easily with normal ssao pass so cost should not be that big. With smaller point lights this can be good enough method and you save performance for more expensive shadow mapping just for main lights.

Share this post


Link to post
Share on other sites

[quote name='quiSHADgho' timestamp='1358896324' post='5024495']
Point lights shining through walls is just normal and I dont think that most or even any of todays graphics engines care about this. Normally it's the light artists job to place spot lights and point lights in a appropriate way. T
[/quote]

 

100% agree with this, until we add in the aspect of having players being able to place point lights via torches and other things. On top of this... what if a player had a staff that had a point light and was walking outside of your house, you would know because you would see that point light shining from under your structure. Or maybe your bed is near a wall and a creature that has a point light glow is outside of your wall and now your head begins to glow some odd color because its radiating through the wall... ( actually that sounds cool .... lmao )

 

[quote name='quiSHADgho' timestamp='1358896324' post='5024495']
Now some words about the issues you wrote about in the old thread:

I think the bright center is basically a different material for light entities boosting the light power so that the bloom can give it a halo. And The Witcher is using a strong bloom there a bit too strong for my taste. The background where the light is shining through the wood and getting a blue halo is a slight overkill. If your lights are to dull overall you could also try adjusting your tonemapper. Lowering the white value will make the colors burn out earlier and produces brighter images but you will also loose more details.
[/quote]

 

Thanks, we have been testing with some of our HDR settings and realized that the dullness was very much related to our algorithm as well as the outside lighting. We have since replaced that and I think we have a very strong quality of point lighting. We have some other things to tackle before they are complete but we are certainly on the right path thanks to you and the help of the others in that thread.

Share this post


Link to post
Share on other sites

I think you just need to read through some different techniques and choose the one you like the most there tons of tutorials and examples out there. My personal favorit is Variance Shadow Mapping:
http://www.punkuser.net/vsm/
It is easy to implement and easy to combine with CSM or Parallel Splits or whatever you choose and gives the possibility to use linear filtering methods, gauss and even MSAA.

I worked on point light shadow maps a while ago and I was using VSM. It works fine for directional lights, which is what every single tutorial in the world implements, but then when I tried to make it work for point lights, I couldn't figure out how to apply the Gaussian blur to the cubemap. I tried Dual Paraboloid Shadow Mapping but never got it working for some reason, I don't remember what it was now. But dual paraboloid has very noticeable seams (skyrim seems to have used that technique and the seams stood out very clearly), so I'd rather avoid that technique.

Share this post


Link to post
Share on other sites

I think you just need to read through some different techniques and choose the one you like the most there tons of tutorials and examples out there. My personal favorit is Variance Shadow Mapping:
http://www.punkuser.net/vsm/
It is easy to implement and easy to combine with CSM or Parallel Splits or whatever you choose and gives the possibility to use linear filtering methods, gauss and even MSAA.

I worked on point light shadow maps a while ago and I was using VSM. It works fine for directional lights, which is what every single tutorial in the world implements, but then when I tried to make it work for point lights, I couldn't figure out how to apply the Gaussian blur to the cubemap. I tried Dual Paraboloid Shadow Mapping but never got it working for some reason, I don't remember what it was now. But dual paraboloid has very noticeable seams (skyrim seems to have used that technique and the seams stood out very clearly), so I'd rather avoid that technique.

 

Indeed, seams are one of the problems with the dual paraboloid maps, this applies to environment mapping as well (and it's more noticeable there). Appears as if the seams occur due to floating point errors that keep the edges of the warped textures from meeting at exactly the right point where they meet, so what you see is a black line (if the maps don't ever touch) or a lot of texture wrapping in a very small area (if there is overlap). The pixel is usually chosen with the max() function so in areas of overlap this illusion occurs.

 

I would want to test again with rendering only one part of the dual map instead of using max() to choose which one, to see how it behaves and look for a way to blend the edges well enough to reduce this problem.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!