Jump to content
The Dark Mod Forums

[2.10] Volumetric Lights


duzenko
 Share

Recommended Posts

  • nbohr1more pinned and featured this topic
  • 2 weeks later...
On 12/26/2021 at 3:43 AM, stgatilov said:

Most likely, we will change the way volumetric lights are set up in beta210-03.

Instead of "volumetricLight" keyword in material, the "volumetric_light" entity spawnarg will be used.
There will be no need to create or fork material, just add a "volumetric_light" "1" on the light and you are done.

It seems that volumetric lights would be easier to use this way, and we'll have less material duplication.

 

That's a much better way to implement it, great job!

 

I saw @Wellingtoncrab post on the discord channel of how the new cameras look with volumetric lights, and my god it's a huge step up in quality!

Link to comment
Share on other sites

9 hours ago, kingsal said:

These look great! @duzenkoI would definitely recommend these being a graphics feature if possible. I can see these tanking some machines. 

Originally I tied it to Level of details, but @stgatilov moved it to a new cvar, making it IMHO harder for 'normal' users to configure

Link to comment
Share on other sites

Volumetric lights should not cost too much.
And if we render them to separate buffer (5850) in 2.11, the cost will be lowered even further.

Right now if someone has serious performance problems with them, he can use cvar.
And by the way, no one complained yet.

If it has to be tied to some existing main menu settings, I'd better tie them to soft shadows quality.
Because both soft shadows quality and volumetric quality define number of samples to use per-pixel, with more or less the same performance implications.

Link to comment
Share on other sites

4 minutes ago, stgatilov said:

Volumetric lights should not cost too much.
And if we render them to separate buffer (5850) in 2.11, the cost will be lowered even further.

Right now if someone has serious performance problems with them, he can use cvar.
And by the way, no one complained yet.

No one has complained because no existing mission features it yet

OTOH a cvar is better than nothing and we can return to this later

Quote

If it has to be tied to some existing main menu settings, I'd better tie them to soft shadows quality.
Because both soft shadows quality and volumetric quality define number of samples to use per-pixel, with more or less the same performance implications.

I still like LOD better for this 😉

Link to comment
Share on other sites

 

2 hours ago, stgatilov said:

Volumetric lights should not cost too much.
And if we render them to separate buffer (5850) in 2.11, the cost will be lowered even further.

Sorry, its not just about cost. They do not work correctly in stencil mode and will go through walls. So a player can be standing behind a wall and might expect to be fully visible.

So we're going to either need a menu setting or they need to be turned off in stencil mode or we're going to have gameplay problems.

Link to comment
Share on other sites

6 minutes ago, kingsal said:

 

Sorry, its not just about cost. They do not work correctly in stencil mode and will go through walls. So a player can be standing behind a wall and might expect to be fully visible.

So we're going to either need a menu setting or they need to be turned off in stencil mode or we're going to have gameplay problems.

For now I think mapper has to manually adjust the light so that it does not intersect any walls, etc

Link to comment
Share on other sites

5 minutes ago, duzenko said:

For now I think mapper has to manually adjust the light so that it does not intersect any walls, etc

I dont think thats wise. We should just be turning them off in stencil mode. Isnt this part of the beta test? To debug this stuff?

EDIT heres a good example. A mapper wants to add them to a security camera which @Wellingtoncrabshowed an awesome example of. We can't do that if players are gonna use stencil mode and expect to get caught behind a wall...

0IICUCq.jpg

  • Like 2
Link to comment
Share on other sites

To me, volumetric light was a replacement for adding translucent frustum, which is typical in old missions.
Translucent geometry cannot compute shadows either.

Disabling all volumetric shadows with stencil shadows sounds too harsh: it is a nice graphical effect, even if it does not react to a guard passing by. And it does not affect gameplay, as far as I know.

Link to comment
Share on other sites

8 minutes ago, stgatilov said:

How?

It does not affect lightgem.

It does effect the light gem:
https://www.dropbox.com/s/0ucaxcvk9rp4zqf/The Dark Mod 2.10_64 2021-12-27 02-15-23.mp4?dl=0

And even if it didnt we cant have players thinking they are going to be in light.. when they arent.

  • Like 1
Link to comment
Share on other sites

In simple cases, mapper can set light_start and light_end in such a way that light volume is clipped by a plane. You need to ensure (end - start) vector is orthogonal to wall plane, then put end point at the wall. Start point is put so that there is a plane parallel to the wall contaning both light source and start point. Yeah, rather messy...

Aside from that, maybe add spawnarg "volumetric_shadows_required"?
If you set it to 1, then volumetric light becomes disabled if shadows cannot be taken into account.

UPDATE: Of course, noshadows lights should always have volumetric lights.
I'm just worried about cases when mapper is not against shadows in general, but is OK that volumetric lights don't respect them...

 

  • Like 1
Link to comment
Share on other sites

After chatting with @kingsal, it seems there are two questions:

  1. Do we need the case when light casts shadows but volumetric light can ignore them?
  2. Which behavior should be made default for volumetric lights in stencil shadows mode: disable or enable with ignored shadows?

Previously volumetric lights were faked by adding some geometry with translucency / light textures.
Whenever you can use such a fake, you don't care that volumetric light ignores shadows, so it fits the case from p.1.

However, I'd agree that shadow-ignoring volumetric shadows can be a great surprise to a mapper which always tests the map with shadow maps. So perhaps default behavior should be "disable" in p.2.

Need more opinions from mappers.

  • Like 1
Link to comment
Share on other sites

I have to say the idea of avoiding geometry with these lights is of some surprise to me, as if you will forgive the pun that is where in my opinion these lights shine!

I have been using particles to fake “volumetric” effects for static sources like windows and spotlights and such, as I was not a fan of using textured geometry for this, which sounds like basically how this works in stencil. With some considerable advantage in that you have greater control over the shape of the particle effects via the material texture and light volume shape without modifying a def, though less control over the appearance of the particles themselves.

Though admittedly I have found using the volumetric material on directional lights from things like windows to be quite difficult to shape the light volume correctly - as you have to get the “light start” parameter just right otherwise the origin of the effect looks quite off.

Honestly though I think this effect is most transformative on moving lights which intersect geometry where the effect could not be “faked” at all. Like the dancing glow of a fire place in a dark room or the vision cone of a security camera sweeping across pillars. Though perhaps not intended, that is at least how I have been using them.

So to answer your second question, in my opinion if you are using a mode which doesn’t support volumetric lights or also if you have disabled it for performance reasons, I would default just display the light as if the volumetric light spawnarg/material flag was off.  

Maybe let the mapper consciously enable the fact they want to force the effect on ignoring shadows through a spawnarg.

As to your first question I have not encountered a circumstance like that yet. Given the particle generated is limited now to a sort of “illuminated dust” effect it’s harder for me to imagine, or I simply lack the creativity to see that circumstance yet. 

 

  • Like 1
Link to comment
Share on other sites

11 hours ago, stgatilov said:

Volumetric lights should not cost too much.

I am not as sure about this. I am not very good at judging the whole tdm perfomance thing given all the different lighting model and MSAA preferences and I do not have a particularly powerful machine. I might agree that with my settings I still tear through scenes with the volumetrics in them with lots of headroom, but they appear to me to be quite expensive even in simple scenes, especially as you get closer and the screen fills with alpha effects.

Iris_2021-12-27_10_25_51.thumb.jpg.e5e3a9a9bd6247081879346f4d1338c1.jpgIris_2021-12-27_10_25_34.thumb.jpg.a9ba86adb6c443c646d201d7d776ae20.jpg

I mean I only have a 1650 mobile which is firmly in the "sucks" category - I would pay the cost for the effect personally. But it's enough I would probably lump into some group of settings which make it easier to disable if need be. 

  • Like 2
Link to comment
Share on other sites

What if we add "volumetric_noshadows" spawnarg, with the following values:

  • "volumetric_noshadows 0": Volumetric light must respect shadows. If it cannot, then it is disabled/hidden.
  • "volumetric_noshadows 1": Volumetric light must ignore shadows.
  • "volumetric_noshadows -1": Volumetric light should use shadows if possible. If that's not possible, then it ignores shadows.

If this spawnarg is not set explicitly, then its value is defaulted to the value of "noshadows" spawnarg.


I think it covers all the possible cases, and its default behavior is "disable if stencil shadows are used".

The only case which won't work is noshadows = 1 with volumetric_noshadows = 0: shadow map won't be computed for this light, so volumetric light won't be able to use it. But I can't imagine who wants a light without shadows but with volumetric light having shadows...

  • Like 1
Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

I don't think the volumetric light cost too much, granted i drop from 60FPS to 30, and to 20 if the samples go up to 32 or so, but I'm hoping there's more optimizations on the way. Couple of things I wanted to point out.

Number one is that there's a lot of overbrightening when the area of the volumetric light is big. Combine this with the bloom and you can get the game to look pretty ridiculous. The light in the first screenshot is only at about 40% max lightness. Turn it up to 80% and you can see that it just looks like white void. This is the same problem with the layering of the haze particles, and it's why I usually set my haze particle colors to something that's nearly black.

Could there be a separate color spawnarg for the godray part of the light? Or maybe just some "intensity 0.0 to 1.0" kind of spawnarg, for further control? To prevent this kind of thing happening. edit: Basically there's a disjoint where the color is controlling two "real life" things: the intensity of the light and the thickness of the presumptive atmosphere through which the light is traveling. These shouldn't really be coupled together.

Number two is the obvious and old thing where the skybox doesn't get affected by any of this. Wish that that could get sorted at some point since it's handicapping a lot of outdoor scenes with particles, and now with this.

 

WIP_WIP_2021-12-28_15.36.01.jpg

WIP_WIP_2021-12-28_15.41.01.jpg

Edited by Spooks
  • Like 2

My FMs: The King of Diamonds (2016) | Visit my Mapbook thread sometimes! | Read my tutorial on Image-Based Lighting Workflows for TDM!

 

 

Link to comment
Share on other sites

  • Dragofer changed the title to [2.10] Volumetric Lights
  • Dragofer unpinned this topic

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

×
×
  • Create New...