Jump to content
The Dark Mod Forums

Now that we've got shadowmaps, can foliage be made to cast shadows?


kano

Recommended Posts

Transparency shadow maps are available since 2.07.

 

Someone will need to write up an explanation of what needs to be done to get them to work. I had no idea they were already available.

Link to comment
Share on other sites

 

Someone will need to write up an explanation of what needs to be done to get them to work. I had no idea they were already available.

 

Normally you don't need to do anything, shadow maps make transparent textures cast shadows automatically, unless the engine prevents that and this is the case currently with TDM.

Edited by HMart
Link to comment
Share on other sites

 

Someone will need to write up an explanation of what needs to be done to get them to work. I had no idea they were already available.

I'll check that when I get home, but they were enabled while we were working on volumetric lights with Duzenko. All you needed was an alpha test material, I don't think any special keywords were necessary.

Link to comment
Share on other sites

There's also the question of whether or not it'd impact gameplay. Missions were designed without this feature in mind. And if you can now sneak through/behind the shrubs in shadow, that might make getting past some parts easier than they're supposed to be. Or, I guess you'll still be spotted because of the bright patches of light on you while you pass by.

Link to comment
Share on other sites

Correction: it looks like shadowmap transparency was included in volumetric lighting package, but it seems like wasn't included in official 2.07 release? At least I couldn't get it to work. I bet Duzenko knows more.

Edited by Judith
Link to comment
Share on other sites

There's also the question of whether or not it'd impact gameplay. Missions were designed without this feature in mind. And if you can now sneak through/behind the shrubs in shadow, that might make getting past some parts easier than they're supposed to be. Or, I guess you'll still be spotted because of the bright patches of light on you while you pass by.

 

I don't think this feature will let AI see through transparent textures; it's just for shadowcasting.

Link to comment
Share on other sites

Correction: it looks like shadowmap transparency was included in volumetric lighting package, but it seems like wasn't included in official 2.07 release? At least I couldn't get it to work. I bet Duzenko knows more.

 

Was that on a new material made by you? If not then see if it has a noshadow keyword but you should know that.

 

Also try to force the shadows with "forceShadows" material keyword, that is to force nodraw materials to cast shadows but perhaps works on maps has well? If none of that works then the TDM engine is blocking the shadows and needs to be changed, I would look in the material.cpp file to see if some material parsing function is setting the material flag MF_NOSHADOWS for the shadow maps when it should not.

Link to comment
Share on other sites

Someone will need to write up an explanation of what needs to be done to get them to work. I had no idea they were already available.

The noshadows material flag needs to be replaced with nostencilshadows on foluage materials.

 

Correction: it looks like shadowmap transparency was included in volumetric lighting package, but it seems like wasn't included in official 2.07 release? At least I couldn't get it to work. I bet Duzenko knows more.

We can't just allow shadows on the "noshadows" materials, can we?

 

If there is an implicit rule that all transparent materials are also forced noshadows then that's a different matter

  • Like 1
Link to comment
Share on other sites

We can't just allow shadows on the "noshadows" materials, can we?

 

No, that would be inconsistent and confusing. If noshadows keyword is there, then the material should be noshadows, period. I'll check that test map on my desktop rig (I'm away from home right now), but I'm pretty sure we had volumetric lights going through a physical model, done via spotlight with projection texture, and with light going through the alphatest plane. It should be there in the volumetric lights thread.

Link to comment
Share on other sites

So IMO the noShadows material keyword should be marked deprecated and the wiki updated, so people making missions now start using the "nostencilshadows " keyword.

 

The old missions will just have to stay has is if they use custom materials but the stock assets should be relatively easy to fix.

 

Btw decals should not cast shadows even tho they are alpha mapped, so be careful, in fhdoom engine that is solved by ignoring textures inside the decal folder.

 

edit: Btw this will indeed change gameplay on the old missions and new, because there will be shadows where none existed before, IMO is a small price to pay to improve the look&feel of the game even further. Also this gives mission makers more options, now someone will be able to put a big tree in the middle of a courtyard and its shadow will serve has a place to the player to hide in.

 

Also just occurred to me, what if you want to disable shadow maps? Will you guys also implemented a "noMapShadows" keyword?

Edited by HMart
Link to comment
Share on other sites

So IMO the noShadows material keyword should be marked deprecated and the wiki updated, so people making missions now start using the "nostencilshadows " keyword.

Not really

There's ton of use cases for 'full' noshadows

It's only _some_ transparent materials that need this sort of tweaking

  • Like 2
Link to comment
Share on other sites

Noshadows keyword is present in so many materials and models that making it obsolete would be a ridiculous thing to do. The aim of enhancements is to add to current set of engine functionalities, not to turn the well-know convention upside-down.

 

Yes you guys are right I just didn't thought this very well, now I see, noShadows disables both stencil/maps and the noStencilShadows disables only stencil.

Link to comment
Share on other sites

I don't think it is wise to add any additional graphic upgrades on top of experimental features that would further stress the engine without getting performance ironed out first.

 

Yes that is a real concern especially with old missions, where the original maker didn't expected alpha textures to have shadows, but they wouldn't be adding anything, the capability is already there, it just needs to be turned on.

 

Btw in new missions if the mission maker knows not to turn on shadows willy nilly, performance can be controlled well and on past missions that depends on the number of alpha textures that get the "noStencilShadows" keyword but afaik there's few missions with trees and bushes all over the place.

 

 

Just for kicks I decided to modify a bunch of alpha materials on my side, to see if the shadows worked as expected and found some things, first I found the "nostencilshadow" keyword is still not implemented, second it was so cool seeing trees and stuff casting shadows, so they definitely work, didn't see much diference on performance, but only a few materials were changed. Third some materials don't cast shadows even if you disable the noShadows keyword, this is because they use the "translucent" and the "twosided" keyword, those disable shadows automatically, so some alpha objects don't cast a shadow even if you remove noShadows, those keywords made sense in the case of stencil shadows but in the case of shadow maps I think they should let shadows pass (unless the same stencil implementation problems apply to maps as well...).

Edited by HMart
Link to comment
Share on other sites

In terms of performance, ideally every mapper still needs to do the tuning step and manually disable shadows for select materials/lights/entities

With or without foliage shadowing I, as a player, expect to see 60 fps on a modern $100 GPU in 1080p with eye candies off.

We might add a cvar to control foliage shadowing in general but it probably won't qualify to end up in options GUI

  • Like 1
Link to comment
Share on other sites

In terms of performance, ideally every mapper still needs to do the tuning step and manually disable shadows for select materials/lights/entities

With or without foliage shadowing I, as a player, expect to see 60 fps on a modern $100 GPU in 1080p with eye candies off.

We might add a cvar to control foliage shadowing in general but it probably won't qualify to end up in options GUI

 

I personally think the game should run just as smooth on legacy machines, at least on less complex missions. The thing about games available gratis is that they often find an audience on people with less money and weaker computers. It's the main reason why free MMOs like Tibia are still so popular on poorer parts of the globe. I feel accessibility should always be kept in mind when developing any libre game, and to its own credit TDM already does a fairly good job at that at least when running on stencil shadows. While a big part of optimizing performance will always be left to mission designers, there is still a lot that can be done on the engine and artwork side to make things run smoother.

Edited by zergrush
Link to comment
Share on other sites

I don't know how things run under the hood, but shadow maps seem to stress GPU much much more than stencil shadows at the moment. On older hardware, it can be a difference between 20 and 50 fps. Even on modern hardware I can hear fans starting every time I switch to shadow maps. If shadows were precomputed and stored in lightmaps, that should give us significant performance boost. I know, it's tons of work to implement even a simple system, I'm not even asking for a feature like this. But with dynamic shadow maps we don't have much choice but bruteforce (i.e. throw raw hardware power at it and hope for the best). At the same time we can achieve similar look with stencil shadows + softening, without such performance impact.

Link to comment
Share on other sites

Stencil shadows on the other hand can be a bit pressing on the CPU, and in my older AMD laptop it causes it to overheat fairly quickly. Performance, however is clearly superior, like you mentioned. Maybe the team can start spending a bit more time on maximizing performance once all current experimental features are rolled out. So let's hope for the future. :)

Link to comment
Share on other sites

That's true, they scale with modern CPUs very well though (Intel Coffee Lake setup here). While shadowmaps can give a fairly midrange card (GTX 1060 6 GB) an intense workout.

 

IMO the problem is TDM doesn't look like a modern game in terms of visual fidelity, so players who aren't familiar with very specific tech we have here might feel disappointed with its very high hardware requirements.

Link to comment
Share on other sites

That's true, they scale with modern CPUs very well though (Intel Coffee Lake setup here). While shadowmaps can give a fairly midrange card (GTX 1060 6 GB) an intense workout.

 

IMO the problem is TDM doesn't look like a modern game in terms of visual fidelity, so players who aren't familiar with very specific tech we have here might feel disappointed with its very high hardware requirements.

 

I guess that is because most of the things that make TDM impressive are either more subtle (such as shadow fidelity) or tend to run under the hood (like AI behaviour). Making performance smoother would certainly improve appeal for those looking for a cool, easy to run free game, and eventually I guess improved textures will bring graphics to a new standard while optimizing performance (I've been very impressed with your new builder texture pack, for one).

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