Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I suggest the following:

  • In shader, return: fragColor.rgb = u_lightColor.rgb * avgColor; and fragColor.a = litDistance * u_dust;
  • In C++ code, always bind _white textures instead of projection and falloff for a fog light.
  • In C++ code, use (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) blending for fogging and (GL_SRC_ALPHA, GL_ONE) for volumetric light.

This covers the projection/falloff textures and blending behavior.

Now add uniform flag "u_exponential", which is enabled for fog light, but disabled for exponential light.
Under this flag, return "1.0 - exp(- litDistance * u_dust)" instead of "litDistance * u_dist" into fragColor.a.
This should switch from linear to exponential.

  • Like 1
Posted

I nearly understand about 1% of what you guys discuss atm, but won't this bring back the "water surface seem" then if the current fog is used with the falloff texture?

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Posted
On 1/14/2022 at 9:02 AM, stgatilov said:

I suggest the following:

  • In shader, return: fragColor.rgb = u_lightColor.rgb * avgColor; and fragColor.a = litDistance * u_dust;
  • In C++ code, always bind _white textures instead of projection and falloff for a fog light.
  • In C++ code, use (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) blending for fogging and (GL_SRC_ALPHA, GL_ONE) for volumetric light.

Now add uniform flag "u_exponential", which is enabled for fog light, but disabled for exponential light.
Under this flag, return "1.0 - exp(- litDistance * u_dust)" instead of "litDistance * u_dist" into fragColor.a.
This should switch from linear to exponential.

I applied all these changes in svn rev 9804.

The alpha equation is a bit different (5.0 coeff under exponent), also added a hack to force opaque fog.
On top of that, I applied a bit of dithering to reduce color banding.

Posted
18 hours ago, stgatilov said:

I applied all these changes in svn rev 9804.

The alpha equation is a bit different (5.0 coeff under exponent), also added a hack to force opaque fog.
On top of that, I applied a bit of dithering to reduce color banding.

Thank you very much! Does this mean I should use the normal fog light again after installing 9804 instead of my "hacked" tdm.exe?

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Posted
7 minutes ago, SeriousToni said:

Thank you very much! Does this mean I should use the normal fog light again after installing 9804 instead of my "hacked" tdm.exe?

It means that most likely you can use this "volumetric fog" in the next 2.10 beta.

Unless we decide to block this feature entirely. It is quite late in the beta phase to add any features.

Posted

Thank you Gospodin Gatilov, I'm keeping fingers crossed for this feature to make it into the next beta. I would be really happy if we can keep this thread as an information source, if this feature will be available in 2.10. It definitely would make fogging much easier for this and all future FMs. Again, thanks to you and the team for every effort in this matter. :)

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Posted
On 1/19/2022 at 5:36 AM, SeriousToni said:

Thank you Gospodin Gatilov, I'm keeping fingers crossed for this feature to make it into the next beta. I would be really happy if we can keep this thread as an information source, if this feature will be available in 2.10. It definitely would make fogging much easier for this and all future FMs. Again, thanks to you and the team for every effort in this matter. :)

I'm sorry, but we decided to not release it yet... Using it will generate a warning.

We have bumped into an issue that fog boundary becomes pretty apparent when you are close to it and look along it. Since I guess this is one of the major issues with the old fog, I think releasing something new with the same problem won't be very helpful.

Note that unlike the old fog, the new "volumetric" fog makes the boundary plane apparent because that's how it should be, i.e. this effect is an correct modelling of a box-shaped fog with constant density. That's what makes it hard to avoid (I don't even say "fix", because it is not a "bug").

Posted
On 1/24/2022 at 2:05 PM, stgatilov said:

I'm sorry, but we decided to not release it yet... Using it will generate a warning.

We have bumped into an issue that fog boundary becomes pretty apparent when you are close to it and look along it. Since I guess this is one of the major issues with the old fog, I think releasing something new with the same problem won't be very helpful.

Note that unlike the old fog, the new "volumetric" fog makes the boundary plane apparent because that's how it should be, i.e. this effect is an correct modelling of a box-shaped fog with constant density. That's what makes it hard to avoid (I don't even say "fix", because it is not a "bug").

Okay thank you for explaining this. I can understand that it doesn't make sense to implement this in that way. I'll delete my fog in that FM and try to insert at least some func_emitters that emit fog sprites. Again, thank you for looking at this.

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

  • 1 month later...
Posted

Here is what id's notes had to say about custom images in foglights. I could never get them to have any effect on the appearance, and have long suspected that that note is a relic from an earlier phase of development.

id's D3 mappers seemed to like putting fogs in areas below/above the playable area, to give a sense you were walking over deep pits, so I think the vertical falloff may have been designed around that use case.

  • Thanks 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

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

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
×
×
  • Create New...