Shadowmaps for GZDoom (can be tested in QZDoom now)
Moderator: GZDoom Developers
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)
It might not even be possible to have proper 3D shadow maps and still have decent performance. What we have now is essentially a 2D (technically 1D) ray fan that tracks geometry distances from a light source - anything more complicated than that will make today's lag seem like nothing.
I will say though, even my Intel GPU can handle it just fine. So it's not THAT bad.
I will say though, even my Intel GPU can handle it just fine. So it's not THAT bad.
-
- Posts: 13549
- Joined: Wed Jul 16, 2003 3:52 am
Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)
To be honest: I love what dpJudas did, so why overacting?
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)
I probably should've asked this first — was it benchmarked or are there any reasons to think that classic shadowmapping will cause excessive lag? (if the mapper manually picks what lights are shadowmapped and there are maximum of 5-7 shadowmapped lights in the scene, like it generally is in the new games)?
Because I personally have my theoretical reasons to think that shadowmaps shouldn't lag.
I don't see how rendering a shadowmap depth texture would produce much more lag than rendering a cameratexture of decent resolution (which barely produces any lag for 4-5 1024x1024 textures).
Except that unlike cameratextures, shadowmap rendering pass can as well skip rendering of everything that's not close enough to the light (and remember, lights are generally below 512 map units in radius...)
With additional optimizations (like lights too far away aren't shadowmapped/rendered, light texture size varying based on the light size...) it should allow having up to 10 shadowmapped lights in a scene provided they aren't all with radius 2048 or something.
Again — I might be wrong, will STFU if provided an explanation as to why it should lag.
Because I personally have my theoretical reasons to think that shadowmaps shouldn't lag.
I don't see how rendering a shadowmap depth texture would produce much more lag than rendering a cameratexture of decent resolution (which barely produces any lag for 4-5 1024x1024 textures).
Except that unlike cameratextures, shadowmap rendering pass can as well skip rendering of everything that's not close enough to the light (and remember, lights are generally below 512 map units in radius...)
With additional optimizations (like lights too far away aren't shadowmapped/rendered, light texture size varying based on the light size...) it should allow having up to 10 shadowmapped lights in a scene provided they aren't all with radius 2048 or something.
Again — I might be wrong, will STFU if provided an explanation as to why it should lag.
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Shadowmaps for GZDoom (can be tested in QZDoom now)
The code is also in its very early stages, too, though, and dpJudas even said himself it could do with some optimizations. One of the big things, I think, that causes it to lag a bit is having to soften the shadows so that they don't look overly sharp.
-
- Posts: 13549
- Joined: Wed Jul 16, 2003 3:52 am
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Shadowmaps for GZDoom (can be tested in QZDoom now)
It's in the QZDoom dev builds (remember to turn on OpenGL mode - or just copy your gzdoom.ini over to it, rename it qzdoom.ini, that is also enough).
-
- Lead GZDoom+Raze Developer
- Posts: 49183
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)
What's up with you people? Of course it's not perfect. Guess what: It can't be perfected, the Doom engine isn't a true 3D engine after all, there are bound to be some limitations. For what it does the shadowmaps are a really cool asset but a few suggestions about how to deal with it:
- Since this is an entirely 2D feature one thing that can be done is, while linking the light into the world, add a check to detect if it touches any one-sided lines from the backside. If that doesn't happen, the light can easily be discarded for having a shadowmap created. Polyobjects may be a bit tricky, but they are rare and could be tested at run time with minimal overhead. I don't even think it processes them right now at all.
- adding a flag to omit a light from getting shadowmapped is a good idea, no matter what. It not only opens up some new options, it also allows a mapper to fine tune the performance implications of the lights.
But what cannot be expected here is a system that casts perfect shadows. That's an entirely different can of worms, requires quite a bit of processing power (which modern engines have because they can optimize their meshes for modern hardware, but Doom can never achieve) and in general does not work as a drop-in feature but requires active mapping for its restrictions.
It's also the very first iteration, it's a nice showcase so far, and it definitely needs some work - but for simple low geometry maps it is already very usable and that's worth a lot!
So far, the biggest stress test I have done for the shadowmaps was E1M6 of P:AR, which contained approx. 60 light sources. On a relatively dated Geforce 550Ti the frame rate dropped from ~115 to ~70 fps for the shadow map.
- Since this is an entirely 2D feature one thing that can be done is, while linking the light into the world, add a check to detect if it touches any one-sided lines from the backside. If that doesn't happen, the light can easily be discarded for having a shadowmap created. Polyobjects may be a bit tricky, but they are rare and could be tested at run time with minimal overhead. I don't even think it processes them right now at all.
- adding a flag to omit a light from getting shadowmapped is a good idea, no matter what. It not only opens up some new options, it also allows a mapper to fine tune the performance implications of the lights.
But what cannot be expected here is a system that casts perfect shadows. That's an entirely different can of worms, requires quite a bit of processing power (which modern engines have because they can optimize their meshes for modern hardware, but Doom can never achieve) and in general does not work as a drop-in feature but requires active mapping for its restrictions.
It's also the very first iteration, it's a nice showcase so far, and it definitely needs some work - but for simple low geometry maps it is already very usable and that's worth a lot!
Sorry, but that's flat out wrong. Rendering a large camera texture takes just as long as rendering the main scene. So 4-5 camera textures takes 5-6 times as long as rendering a simple scene, if we assume that each viewpoint's complexity is identical.ZZYZX wrote: I don't see how rendering a shadowmap depth texture would produce much more lag than rendering a cameratexture of decent resolution (which barely produces any lag for 4-5 1024x1024 textures).
So far, the biggest stress test I have done for the shadowmaps was E1M6 of P:AR, which contained approx. 60 light sources. On a relatively dated Geforce 550Ti the frame rate dropped from ~115 to ~70 fps for the shadow map.
-
- Lead GZDoom+Raze Developer
- Posts: 49183
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Shadowmaps for GZDoom (can be tested in QZDoom now)
Rachael wrote:It's in the QZDoom dev builds (remember to turn on OpenGL mode - or just copy your gzdoom.ini over to it, rename it qzdoom.ini, that is also enough).
It's also in the GZDoom 3.0 work branch. Of course the devbuilds are still being created from Master...
-
-
- Posts: 17465
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)
Every door in Blade of Agony are Polyobjects. And yes, light is currently going through all the closed doors currently.Graf Zahl wrote:Polyobjects may be a bit tricky, but they are rare and could be tested at run time with minimal overhead. I don't even think it processes them right now at all.
Re: the "exciting" discussion - I've already sent a PM to dpJudas explaining clearly what I meant and we're already clear on what each others' stance is on the subject. I wasn't complaining, however I also do agree with ZZYZX that it's not exactly "production-ready" yet, which is why I also voiced to not include it in official builds yet, as an opinion.
(of course having it in QZDoom is fine, however, and I have nothing to say about that - that's what QZDoom is for - experimenting cool new features :D)
When you advertise this feature publically (even if it's currently hidden-ish and involves typing something in the console), and the mass player base starts using it... they will all start complaining why the shadows don't look right, why do height differences not work, why does it not look like Unreal Engine blah blah blah... and their texts might be worded less nicely, I'm afraid. :S
It's a nice feature, there's no argument about that... just needs a little more work on it. :) And dpJudas can take all the time he needs for that, I'm definitely not in a rush to use the feature yet.
-
- Posts: 13549
- Joined: Wed Jul 16, 2003 3:52 am
Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)
Thanks, exactly my thoughts.Graf Zahl wrote:What's up with you people? Of course it's not perfect.
@Eruanna - Thanks for the hint, tried it but for some reason it doesn't work (even though shadowmaps are activated). The light behaves as usual:
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Shadowmaps for GZDoom (can be tested in QZDoom now)
What would you say to renaming your "master" to "maint-2.4" and "3.0_work" to "master"? - even though 2.4 isn't out yet, even my own master right now is kind of in maintenance mode (or I'd have pulled 3.0 right back to it as well).Graf Zahl wrote:It's also in the GZDoom 3.0 work branch. Of course the devbuilds are still being created from Master...
-
-
- Posts: 17465
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Shadowmaps for GZDoom (can be tested in QZDoom now)
You have to type gl_light_shadowmap 1 into the console. Also, if that pillar is a 2-sided line, that doesn't work yet. Also doesn't work on Polyobjects, so none of your doors will block light. Telling you in advance what to expect and what to not expect. :P
Last edited by Nash on Sun Mar 12, 2017 3:38 am, edited 1 time in total.
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)
Can you do "qzdoom +logfile opengl.txt" and paste me that file?Tormentor667 wrote:@Eruanna - Thanks for the hint, tried it but for some reason it doesn't work (even though shadowmaps are activated). The light behaves as usual:
-
- Posts: 13549
- Joined: Wed Jul 16, 2003 3:52 am
Re: Shadowmaps for GZDoom (can be tested in QZDoom now)
Unknown commandNash wrote:You have to type gl_light_shadowmap 1 into the console.
@Eruanna - sure
Spoiler:
-
- Posts: 13793
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Shadowmaps for GZDoom (can be tested in QZDoom now)
Okay according to that log there's no reason it shouldn't be working. Nash is right though, if that's a 2-sided line there won't be any shadows on it.
Nash has a map (I am trying to look for it now) that you can test it on - it has fully solid objects that do work properly with it.
(Edit: Found Nash's map, here: viewtopic.php?p=980662#p980662 )
Nash has a map (I am trying to look for it now) that you can test it on - it has fully solid objects that do work properly with it.
(Edit: Found Nash's map, here: viewtopic.php?p=980662#p980662 )