• Advertisement
Sign in to follow this  

Unity Point Light Shadow Mapping

This topic is 1824 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

Just a bit more information, we have already implimented the following:

 

http://www.rastertek.com/dx11tut41.html

 

and recently we tried to add the

 

http://www.rastertek.com/dx11tut42.html

 

but it uses up to 400mb of ram. Seems... pretty expensive. Telanor was saying we need to figure a way to use cascaded shadow maps.

Share this post


Link to post
Share on other sites

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
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By RoKabium Games
      Another one of our new UI for #screenshotsaturday. This is the inventory screen for showing what animal fossils you have collected so far. #gamedev #indiedev #sama
    • By eldwin11929
      We're looking for programmers for our project.
      Our project is being made in Unity
      Requirements:
      -Skills in Unity
      -C#
      -Javascript
      -Node.js
      We're looking for programmers who can perform a variety of functions on our project.
      Project is a top-down hack-and-slash pvp dungeon-crawler like game. Game is entirely multiplayer based, using randomized dungeons, and a unique combat system with emphasis on gameplay.
      We have a GDD to work off of, and a Lead Programmer you would work under.
      Assignments may include:
      -Creating new scripts of varying degrees specific to the project (mostly server-side, but sometimes client-side)
      -Assembling already created monsters/characters with existing or non-existing code.
      -Creating VFX
      -Assembling already created environment models
      If interested, please contact: eldwin11929@yahoo.com
      This project is unpaid, but with royalties.
       
      ---
      Additional Project Info:
      Summary:
      Bassetune Reapers is a Player-verus-Player, competitive dungeon crawler. This basically takes on aspects of dungeon crawling, but with a more aggressive setting. Players will have the option to play as the "dungeon-crawlers" (called the 'Knights', or "Knight Class", in-game) or as the "dungeon" itself (literally called the 'Bosses', or "Boss Class", in-game). What this means is that players can choose to play as the people invading the dungeon, or as the dungeon-holders themselves.
      Key Features:
      -Intense, fast-paced combat
      -Multiple skills, weapons, and ways to play the game
      -Tons of different Bosses, Minibosses, creatures and traps to utilize throughout the dungeon
      -Multiple unique environments
      -Interesting, detailed lore behind both the game and world
      -Intricate RPG system
      -Ladder and ranking system
      -Lots of customization for both classes s of customization for both classes
    • By RoKabium Games
      Custom coffee mugs have arrived... More caffeine!
      Have a great weekend everyone! 
      #gamedev #indiedev #sama #caffeine
    • By Atwo Studios
       
      Hey guys,

      Anthony here from Atwo Studios bringing you some new updates for the new year!
      In this video I go over our game ROY, the new games and some general updates to the company!

      If you have not checked out ROY feel free to give it a try! Many people have said they enjoyed the game thus far!
      ROY: https://goo.gl/o6JJ5P
       
    • By Affgoo
      https://play.google.com/store/apps/details?id=com.NE.Alien
      still a lot of work to do, but its pretty stable  please let me know what you think <3
      Atlas Sentry is a game of destroy everything. Using your turret, simply swivel and shoot your way to victory, upgrading your weapons to unleash destruction on the variety of spaceships. The bigger your combo’s the more score you get! Earn silver as you play and then purchase new weapons and abilities to better deal with your enemy. Different enemies use different tactics and weapons, work out your own priorities in their destruction order. 

      Features: 
      **2 different game modes 
      **A level select mode with 20 difficult levels including a final boss, can you defeat it? **Arcade mode of endless destruction, how long will you last? 
      **High scores to compete against others, see who can take the top spot. 
       
  • Advertisement