[Added] Shadowmaps for GZDoom (can be tested in QZDoom now)

Moderator: GZDoom Developers

Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)

Postby Rachael » Sun Mar 12, 2017 2:39 am

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.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)

Postby Tormentor667 » Sun Mar 12, 2017 2:43 am

To be honest: I love what dpJudas did, so why overacting?
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)

Postby ZZYZX » Sun Mar 12, 2017 2:45 am

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.
User avatar
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine
Discord: ZZYZX#1394
Github ID: jewalky

Re: Shadowmaps for GZDoom (can be tested in QZDoom now)

Postby Rachael » Sun Mar 12, 2017 2:51 am

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.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Postby Tormentor667 » Sun Mar 12, 2017 3:16 am

Rachael wrote:Shadowmaps for GZDoom (can be tested in QZDoom now)

Okay, and how/where? Got the latest GZDoom SVN from svn.drdteam.org (10th of march) but there is no option for it-
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Shadowmaps for GZDoom (can be tested in QZDoom now)

Postby Rachael » Sun Mar 12, 2017 3:16 am

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).
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)

Postby Graf Zahl » Sun Mar 12, 2017 3:21 am

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!


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).


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.
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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Shadowmaps for GZDoom (can be tested in QZDoom now)

Postby Graf Zahl » Sun Mar 12, 2017 3:22 am

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...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)

Postby Nash » Sun Mar 12, 2017 3:25 am

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.


Every door in Blade of Agony are Polyobjects. And yes, light is currently going through all the closed doors currently.

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.
User avatar
Nash
AKA Nash Muhandes! Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)

Postby Tormentor667 » Sun Mar 12, 2017 3:33 am

Graf Zahl wrote:What's up with you people? Of course it's not perfect.

Thanks, exactly my thoughts.

@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:
Image
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Shadowmaps for GZDoom (can be tested in QZDoom now)

Postby Rachael » Sun Mar 12, 2017 3:35 am

Graf Zahl wrote:It's also in the GZDoom 3.0 work branch. Of course the devbuilds are still being created from Master...

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).
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: Shadowmaps for GZDoom (can be tested in QZDoom now)

Postby Nash » Sun Mar 12, 2017 3:35 am

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.
User avatar
Nash
AKA Nash Muhandes! Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: QZDoom - ZDoom with True-Color (Version 1.2.2 released!)

Postby Rachael » Sun Mar 12, 2017 3:36 am

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:

Can you do "qzdoom +logfile opengl.txt" and paste me that file?
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: Shadowmaps for GZDoom (can be tested in QZDoom now)

Postby Tormentor667 » Sun Mar 12, 2017 3:39 am

Nash wrote:You have to type gl_light_shadowmap 1 into the console.

Unknown command :)

@Eruanna - sure :)
Spoiler:
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Shadowmaps for GZDoom (can be tested in QZDoom now)

Postby Rachael » Sun Mar 12, 2017 3:42 am

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 )
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

PreviousNext

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest