Jump to content
The Dark Mod Forums

Feature request: emissive materials/volumetric lights


peter_spy

Recommended Posts

I did some tests with shadow maps in full missions (like New Job or Volta), and with r_softShadowsQuality 14, r_softShadowsRadius 6, and r_shadowMapSize 512 the results are decent; the GPU use is between 40 and 70%. In that test scene however, GPU use is 99%. I'm guessing it's not shadow maps that are causing trouble here, but volumetric lights.

What are your system specs..?

Link to comment
Share on other sites

i7 8700 3.2 GHz (Coffee Lake, 6 cores, HT), GTX 1060 6 GB (Asus ROG Strix), 32 gigs of 3000 MHz RAM. It's a beefy rig, IMO.

I'm i7 4790k, GTX1070, 16Gb, Win8.1 (Im assuming your on 10) so can you link me a complete mission archive and what args you used to flip between the different shadows so I can see if I get the same temp/load fluctuations.

  • Like 1
Link to comment
Share on other sites

duzenko i'm right to think you use a AMD card? I seem to remember you talking something about needing to test this on Nvidia, if i'm wrong and you need to test on a AMD GPU i would be willing to help test this, so you guys don't test only on Nvidia gpu's, just give me the needed files, I have a mid range RX 570, I also have a Rysen system if you desire to also optimise for Rysen, is a relatively new CPU and idtech 4 was optimized for Intel architecture so it can cause problems, not that i'm seeing any right now, everything seems to work fine apart from the light geam being always bright no matter if i'm on shadow or not.

Link to comment
Share on other sites

duzenko i'm right to think you use a AMD card? I seem to remember you talking something about needing to test this on Nvidia, if i'm wrong and you need to test on a AMD GPU i would be willing to help test this, so you guys don't test only on Nvidia gpu's, just give me the needed files, I have a mid range RX 570, I also have a Rysen system if you desire to also optimise for Rysen, is a relatively new CPU and idtech 4 was optimized for Intel architecture so it can cause problems, not that i'm seeing any right now,

I have Intel at home and AMD at work

 

everything seems to work fine apart from the light geam being always bright no matter if i'm on shadow or not.

That should be fixed by now

Link to comment
Share on other sites

I tested this anyway :P

 

Performance to me at 1080p was constant 60fps (locked framerate).

 

My shadow mapping settings where the following

 

r_shadows 2 (obviously)

 

r_softshadowsradious 5

r_softshadowsquality 5

 

r_shadowMapSize 512

 

Shadows looked more or less good but much worse than i add before ( and worse than soft stencil shadows i most say) but performance increased leaps and bounds, before in some instances shadow maps cut my framerate in half.

 

Volumetrics volume edges don't connect as duzenko already knows.

 

Shadow mapping works fine on the alpha enabled window but the volumetric effect is very subtle on it, makes it almost invisible, is that intended?

 

Volumetrics are indeed very "bandy" but i'm willing to forgo that for the coolness of the effect.

Link to comment
Share on other sites

I thought banding might have something to do with falloff images having low resolution (64 x 8), although I did tinker with those files and making a higher res version didn't improve things. And zol_nofalloff.tga is just a white square, so there's not much to work with. The way the engine treats gradient textures might be a problem IMO. If you ever tried to make materials with gradient, you saw that the engine doesn't use all 256 gradient steps, and all methods used to mask banding, like adding some noise, actually can make banding more visible:

obraz.png

 

So I guess improving that aspect of the engine could improve the look of volumetric lights (all lights, in fact).

 

Once we get that down, IMO the second thing will be performance improvements. Duzenko, you mentioned that right now this method uses high number of samples. If you could make a cvar to control it, we could establish some value range to adjust, or some quality presets to include in game menu in the future.

Edited by Judith
Link to comment
Share on other sites

Duzenko, you mentioned that right now this method uses high number of samples. If you could make a cvar to control it, we could establish some value range to adjust, or some quality presets to include in game menu in the future.

https://drive.google.com/file/d/0B9OoHSmkeSeNZWdyZFliQkNsVTA/view?usp=sharing

r_testVolumetric

  • Like 1
Link to comment
Share on other sites

Nice, thanks! So, initial GPU cost of the test scene without volumetric lights is around 35% on my GPU. What would be a healthy performance cost of turning that feature on? I assumed +15% is acceptable maximum. On my machine that would be r_testVolumetric 25-27.

 

With these settings volumetric lights occluded by geometry look like this:

obraz.png

 

And with projection textures:

obraz.png

 

So using projection textures would be a recommended approach. All that is left is to decrease banding for falloff images, if possible.

 

It would be great if more people tested their results, as this is just one machine, and I'm playing in 1440p, so that's twice the rendering cost of 1080p. In 1080p results should be better.

 

Edit: yup, in 1080p that would be r_testVolumetric 35-37.

Edited by Judith
Link to comment
Share on other sites

Nice, thanks! So, initial GPU cost of the test scene without volumetric lights is around 35% on my GPU. What would be a healthy performance cost of turning that feature on? I assumed +15% is acceptable maximum. On my machine that would be r_testVolumetric 25-27.

 

With these settings volumetric lights occluded by geometry look like this:

 

 

And with projection textures:

 

 

So using projection textures would be a recommended approach. All that is left is to decrease banding for falloff images, if possible.

 

It would be great if more people tested their results, as this is just one machine, and I'm playing in 1440p, so that's twice the rendering cost of 1080p. In 1080p results should be better.

 

Edit: yup, in 1080p that would be r_testVolumetric 35-37.

I expect zero visual and performance difference between projection and real shadows. What you see is different image source. If you use a projection texture with more variance (thicker black stripes) you will end up with the same result.

Link to comment
Share on other sites

Yup, that was the case from this post: http://forums.thedarkmod.com/topic/19659-feature-request-emissive-materialsvolumetric-lights/page-4?do=findComment&comment=428095

 

I wonder if you could blur falloff images to get the same effect. Right now increasing number of samples decreases banding, but rendering cost is huge.

Link to comment
Share on other sites

Ok, so the squarelight1a.tga is a 64 x 8 px bilinear gradient. It seems like banding is there because all lights use only 32 gradient steps instead of 256 (!). But, increasing the image size to 512 x 64 and using full gradient range doesn't do anything. Looks like the engine was intentionally limited to use this kind of gradient in the first place :(

Link to comment
Share on other sites

This is not really what you want but the box filter could be useful, i assume is just a matter of looking at the code and see how id did the box filter part.

 

smoothnormals(<map>) Does a box filter on the normal map, and normalizes the result.

Edited by HMart
  • Like 1
Link to comment
Share on other sites

AFAIK, box blur is the lowest quality blur you can have, so that might not be a good idea, if we want to improve the look of the light rays.

 

Yes i agree a true gaussian blur would be better but box blur/filter is faster and for a already heavy effect. And was just a suggestion, duzenko did asked for something already existing even if what i presented was perhaps partially useful.

Edited by HMart
Link to comment
Share on other sites

Gaussian might be too expensive, actually ;) Maybe this would help? https://software.intel.com/en-us/blogs/2014/07/15/an-investigation-of-fast-real-time-gpu-based-image-blur-algorithms

 

Although I'm curious whether disabling the resolution limit for light falloff images would do the same trick (and what about performance cost?). Projection textures don't seem to have such limit, you can have a 512 px or 1024 px image for projection and it looks great with volumetric lights.

Link to comment
Share on other sites

Btw. is there a way to control the blur amount or apply it in light materials? If so, please give me example use in material definition :)

lights/glowtest/light_shaft_projtex

{
	volumetric	
    {
        forceHighQuality
        map    fastBlur(textures/glowtest/lights/window_p2)
        colored
        zeroClamp
	}
}

I can add a second param to fastBlur - what does it need to be - pixels/percent/etc?

  • Like 1
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.


  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...