Jump to content
The Dark Mod Forums

Water effects not rendered through warp glass


Recommended Posts

8 minutes ago, stgatilov said:

If they have same material and "sort" value, then they are eventually sorted by surface index. This order is constant in one playthrough, but can change even if you restart the game.

And if you have two postprocessing surfaces on the same place, then both of them will be visible if they render in correct order. If the closest surface renders first, then the farthest surface won't be visible.

I see. so if we are "lucky" the glass renders first then the torch haze second but we seem to be consistently unlucky in some scenarios so the reverse order is happening...

I am hesitant to suggest it, but what about forcing all alpha blends and transparencies to use the painter algorithm (with a depth buffer check for opaque objects)?

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

1 hour ago, nbohr1more said:

I am hesitant to suggest it, but what about forcing all alpha blends and transparencies to use the painter algorithm (with a depth buffer check for opaque objects)?

If you suggest something like depth buffer, then you'll eventually get at the technique called "depth peeling".

It works by rendering all translucent surfaces over and over again, rendering exactly one layer of translucent surfaces one every phase, until all layers are rendered and nothing changes.
This is quite expensive, although the true cost depends on maximum degree of overlapping.


If you suggest something like sorting surfaces from back to front on CPU, then you get a well-known unsolvable problem. The worst thing here is that when surfaces' boxes intersect, their order toggles back and forth as you run around them.

In order to perfectly solve depth sorting in general case, you have to split surfaces. For static geometry, BSP tree is the best way to do it: that's how e.g. Doom worked without depth buffer. But adding dynamic surfaces into BSP tree is still an issue.

Link to comment
Share on other sites

6 minutes ago, AluminumHaste said:

Yes, that's exactly what I'm talking about regarding BSP tree.
World brush geometry can be put into its own BSP tree by dmap, which can be rendered in perfect back-to-front order.

UPDATE: But, even static geometry will cause problem with postprocessing surfaces. Because you have to copy renderbuffer befor every postprocessing surface rendered in order to get proper picture, and that's very expensive.

With depth peeling, you need to copy renderbuffer after every layer, if there is a chance that next layer will include postprocessing shader.

  • Like 1
Link to comment
Share on other sites

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

5 minutes ago, nbohr1more said:

Interesting, the original demo runs at 14,000fps on my computer. I can't imagine how much faster his optimized version runs at.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

By the way, revisions 9966 + 9967 broke test/glass map pretty bad.

It has a glass wall near starting location, which consists of 8 glass windows of different material.
Previously, it looked nice from all directions.
But now when you look them from behind, they toggle on and off as you walk around.

Link to comment
Share on other sites

On 7/9/2022 at 1:05 PM, AluminumHaste said:

As far as I know you should only use twosided shaders on patches, as the back side of the patch is not rendered. Brushes should use onesided shaders.

Yes thanks for that.  I didn't realize the glass materials were 2-sided.  I've changed the windows in my WIP FM to patches instead now.

In the test map, 3 of the windows are brushes, but the last one (on the far right) is a patch.

Edited by Frost_Salamander
Link to comment
Share on other sites

  • 2 weeks later...

I disabled the feature in svn rev 10033, although it can be enabled back with r_testPostprocessMultiple.

The problem is that any window with two-sided warping material previously worked fine, but now will flicker (like test/glass). Also, it seems that the original problem is not going to be solved anyway due to depth sorting problem... better have a feature with clear limitation (one layer copy) than have a randomly broken feature...

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

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...