Jump to content
The Dark Mod Forums

[2.10] Volumetric Lights


duzenko
 Share

Recommended Posts

6 hours ago, duzenko said:

Ideally volumetric projected lights could have separate shadow implementation (just one projection instead of 6) and its shadow map would be used even when 'normal' lights are on stencil

This is orthogonal to volumetric lights.
Yes, projected lights should use single texture instead of cubemap, and parallel lights should probably use some other approach.

Quote

Can you tell me what the problem with lightgem seems to be? I think we should just skip volumetric during the lightgem pass

Yes, I have already disabled them in lightgem view.

Quote

Could there be a separate color spawnarg for the godray part of the light?

There already is "volumetric_dust" spawnarg with default value 0.002, which defines how strongly the air reacts to the light.

The issue that bright parts look too bright are a typical issue of gamma-incorrect rendering, and they'll happen with anything based on additive blending.

  • Like 2
Link to comment
Share on other sites

49 minutes ago, duzenko said:

So what is the need for the new shadow flags? Not trying to argue, just curious

The main motivation is to allow rendering volumetric lights with stencil shadows:

  • mappers don't like that lights which don't pass through walls with shadow maps do pass with stencil shadows, they prefer volumetric light being disabled instead of passing through
  • for a well-placed projected light you probably don't care whether volumetric light takes shadows into account or not

Another possible reason to control volumetric light shadows independently:

  • mapper might want to disable shadows in volumetric light if volumetric light looks weird with shadows due to sampling errors (or for performance reasons, although I think volumetric light with shadows is not much slower than without)

I agree that the latter issue is only hypothetical now, but the former one is already real.
So I'm thinking about one spawnarg which can potentially cope with all cases in logical way.

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I like this effect.  I suppose it's known that the volumetric effect is switched off when a save is reloaded?

I use stencil shadows.  Generally with maps I get lights flickering on/off at distances 1600/1800 units from player as well as occasional nearby artefacts.  In most missions this isn't a problem but in a few it is and in my WIP it breaks the game in too many places.  

The volumetric effect is easy to use and with the entity spawnarg it'll be a breeze.

Link to comment
Share on other sites

  • 2 weeks later...

In version #9648 I tried to follow the wiki and insert my first volumetric light. However I can't see any difference in game. I set it up with the volumetric_light = 1. After seeing no difference, I added the additional spawnargs and even created a new light as a spot instead of omnidirectional.

In my game settings I have got shadow maps enabled (not stencil). The console command r_volumetricSamples is unknown to the game however.

I just see a normal light. Even after a whole new dmap.

  • Like 1

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

1 hour ago, SeriousToni said:

In version #9648 I tried to follow the wiki and insert my first volumetric light. However I can't see any difference in game. I set it up with the volumetric_light = 1. After seeing no difference, I added the additional spawnargs and even created a new light as a spot instead of omnidirectional.

In my game settings I have got shadow maps enabled (not stencil). The console command r_volumetricSamples is unknown to the game however.

I just see a normal light. Even after a whole new dmap.

Your best map would be to attach a test map

  • Like 1
Link to comment
Share on other sites

5 hours ago, SeriousToni said:

In version #9648 I tried to follow the wiki and insert my first volumetric light.

Volumetric lights were added very close to beta, and they were changed during beta.

The wiki page was written for beta210-03 (which shows #9771 in game console), you need this version (which is the latest beta yet) for them to work.

  • Like 1
Link to comment
Share on other sites

This indeed was the problem. I was looking up in the list at the "dev" section. However I should've scrolled down to "beta". Thank you, it finally works :)

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

  • 4 weeks later...

Been using 2.10 beta 5 along with Hazard Pay for a bit, and I think I would be awesome if volumetric lights were decoupled from shadow maps for all other lights as a requirement. They still seem unoptimized and eat up GPU resources really fast, while stencil + soft shadows seem to have much less severe impact on a CPU.

  • Like 2
Link to comment
Share on other sites

8 hours ago, peter_spy said:

Been using 2.10 beta 5 along with Hazard Pay for a bit, and I think I would be awesome if volumetric lights were decoupled from shadow maps for all other lights as a requirement. They still seem unoptimized and eat up GPU resources really fast, while stencil + soft shadows seem to have much less severe impact on a CPU.

I second that

Link to comment
Share on other sites

The last I heard, using a stencil pipeline for transparent textures is even worse performance-wise since you are generating triangles for every occluder pixel.

That said, semantically you could pre-transform all transparent textures into a single light texture and use that as a projection image. Still leaves the question of how you soften the stencil shadows inside the light volume. Softening currently occurs in screen-space at on the resultant 2D output of the projection. How would you estimate the God-Ray penumbras? Some sort of worldspace check to the light-center compared to the shadow faces orthogonal to the viewer?

Does anyone know of a Volume Light \ God-Ray solution used in an engine that offers Stencil Shadows?

I guess that request might really be: Please allow volume lights to use shadow maps while the rest of the scene uses stencil shadows?

That would probably be possible since we already mix the shadow types because we define a maximum light size for shadow maps so that larger lights are forced to use stencil.

I'm not whether any proposal to extend the stencil implementation is going to happen though. The current ambition is to improve Shadow Maps to the point that all stencil code can be removed AFAIK. On the other hand, there is currently a roadmap entry for giving Shadow Maps it's own shadow geometry which would sorta make it a hybrid mode anyway...

Rambling over.

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Just now, nbohr1more said:

I guess that request might really be: Please allow volume lights to use shadow maps while the rest of the scene uses stencil shadows?

Yup, exactly. In order to avoid confusion, just let volumetric lights use shadow mapping, maybe give players On/Off option for these lights in the UI to improve performance, and when the time will come to phase out stencil shadows, you'll remove the stencil/maps switch.

Link to comment
Share on other sites

There are differences.

Stencil Shadows do not have "contact hardening" so the just get blurrier the further they are from the emitter.

soft_stencil.jpg

Shadow maps realistically model what happens when an occluder is close to the receiving surface ( harder shadows ) verses further shadows being blurrier.

contact_harden.jpg

( Notice the AI shadow closer to the surface is harder than the cage shadow which is blurrier. Eg. realistic )

That said, shadow maps have a few artifacts due to resolution issues and depth issues.

Some folks may find stencil shadows to be more attractive because they are almost always blurry. To make that happen in shadow maps, you can increase the "shadow softness" slider. You can also choose a lower r_shadowMapSize resolution and disable image sharpening.

 

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

29 minutes ago, peter_spy said:

But the shadow map size is already 1024, shouldn't that be enough?

It's not comparable to other engines that have more advanced shadow re-projection and LOD.

Maybe we'll get there in a future release.

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

  • 1 month later...
4 hours ago, duzenko said:

What techniques are there to choose from? The original effort was naive multisampling.

I don't know, not a graphics programmer, just curious but I'm sure there are more than one, like for all graphics techniques. 

A online search gets me this links:

https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-13-volumetric-light-scattering-post-process

https://www.slideshare.net/BenjaminGlatzel/volumetric-lighting-for-many-lights-in-lords-of-the-fallen

https://dl.acm.org/doi/10.1145/1730804.1730823

https://www.jianshu.com/p/f5e87d23f18d   // intel invented technique

https://github.com/robertcupisz/LightShafts   // using the Intel technique of the link above

Also have you guys looked at the sikkmod god rays post process effect? IMO Is not as good looking and realistic, compared to the current one you guys implemented, is mostly for outdoor, sun rays and also uses ARB shaders but one thing it has for it, is smooth looking and is fast.

"The original effort was naive multisampling" The only thing I know about MS is that is used for anti-alising :D

 

 

Edited by HMart
Link to comment
Share on other sites

On 3/20/2022 at 3:32 PM, HMart said:

I don't know, not a graphics programmer, just curious but I'm sure there are more than one, like for all graphics techniques. 

A online search gets me this links:

https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-13-volumetric-light-scattering-post-process

https://www.slideshare.net/BenjaminGlatzel/volumetric-lighting-for-many-lights-in-lords-of-the-fallen

https://dl.acm.org/doi/10.1145/1730804.1730823

https://www.jianshu.com/p/f5e87d23f18d   // intel invented technique

https://github.com/robertcupisz/LightShafts   // using the Intel technique of the link above

Also have you guys looked at the sikkmod god rays post process effect? IMO Is not as good looking and realistic, compared to the current one you guys implemented, is mostly for outdoor, sun rays and also uses ARB shaders but one thing it has for it, is smooth looking and is fast.

"The original effort was naive multisampling" The only thing I know about MS is that is used for anti-alising :D

 

 

Don't they all talk about the same thing? I can't see any shader code, only general description

Link to comment
Share on other sites

Like i said not a rendering programmer but I don't think so, the first one is a Nvidia link and the last two about a Intel invented method (like I said), unless they invented the same thing, I assume they are different somehow (one maybe GPU bound, while the other is more CPU bound).

About shader code availability, again I don't really know but did you saw the last link? There's some kind of example code in there. If useful for TDM or not is another story.  Someone with shader code experience needs to look at it and decided.

But afaik most papers are just general guides not a plug&play affair (most don't want to make life easy, for potencial competitors in the industry...).

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recent Status Updates

    • STiFU

      Anyone here clocking in some times in Neon Light?
      · 0 replies
    • JackFarmer

      Boris Johnson's resignation does not change the fact that Australia is home to 29 million kangaroos and Wales has a population of just over three million.

      If the Australian kangaroos were to invade Wales, one resident would have to fight almost ten kangaroos at a time.
      · 8 replies
    • peter_spy

      Deathloop – what a mess of a game. I'd love to see a post-mortem on it some day. I hope Arkane is doing okay though.
      · 27 replies
    • OrbWeaver

      I like house-cleaning and taking out the trash.
      · 3 replies
    • STiFU

      Be honest: Who of you have actually finished Cuphead? This game is freaking tough! It might even be harder than Sekiro. Dark Souls is a joke in comparison to Cuphead! :-D 
      · 8 replies
×
×
  • Create New...