Jump to content
The Dark Mod Forums

hide_distance broken again?


grayman

Recommended Posts

A few years back, hide_distance stopped working in 1.03.

 

It got fixed.

 

I haven't used it before, and am now trying to use it to manage rain particle patches.

 

But it doesn't work.

 

I also tried it with a simple func_static brush with a low hide_distance setting, and the brush never disappears.

 

Anyone else seeing this?

 

Thanks.

Link to comment
Share on other sites

I just tried it on a LOD entity and it worked fine. Is it supposed to work on regular func_statics?

Link to comment
Share on other sites

I just tried it on a func_static and it didn't work. I can't say whether that's a change in behaviour or not.

Link to comment
Share on other sites

Yes, I'm pretty sure hide_distance was present before there was even a LOD system (or was part of a rudimentary one made

before Tels joined... (saw some earlier developer discussion on that when the original Mod SDK was released, interesting stuff )).

It might have gotten a LOD dependency when Tels' code was integrated?

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

Here's the wiki reference.

 

Though this appears on a "LOD" page, it simply talks about being able to hide any func_static, with no mention of any other LOD functionality needing to be specified.

 

Looks like it was broken when LOD was added. (LOD is quite complex.)

 

That having been said, what other spawnargs do I need to give to a func_static to make it disappear at a certain distance? Perhaps I can do what I need to do with the broken system instead of having to go fix the break.

Link to comment
Share on other sites

I searched through the existing maps and here's an instance of a simple func_static in Alberic's Curse that uses hide_distance:

// entity 138
{
"classname" "func_static"
"name" "func_static_1186"
"dist_check_period" "1"
"hide_distance" "1000"
"lod_hide_probability" "1"
"model" "func_static_1186"
"origin" "-333 -815 135"
// primitive 0
...
}
(This is for a fuzzy grass texture on a patch.)
dist_check_period defaults to 0.5 if not present and lod_hide_probability defaults to "1" if not present, so the minimal hide_distance spawnarg had to have worked at one time.
Link to comment
Share on other sites

I tried adding "dist_check_period" "1" to the test func_static and it still didn't disappear. I don't see anything else in the lod_base entity that seems like it would impact this issue.

Link to comment
Share on other sites

I'm guessing that something was added with LOD that accidentally made it required for even the simple hide_distance to work, thus breaking all the "hide_distance only" func_statics in released maps at that point.

Link to comment
Share on other sites

Yep, good catch. This is a bug that'd be unlikely ever to be noticed by testers. And it's not something I (or we) thought of while discussing the mechanics of this change in the forum and on the tracker :-/

 

The simplest workaround in 2.03 is probably to place an empty "model_lod_1" "" spawnarg on the entity. The presence of any model_lod_ spawnarg will stop LOD being disabled.

  • Like 1
Link to comment
Share on other sites

  • 5 years later...

@stgatilov @kingsal @duzenko @MirceaKitsune

I pinged Duzenko about this on discord, I was gonna try to fix it myself by adding a hide_distance check to Emitter.cpp but needed

a little guidance on where to find an example of the hide_distance check ( I think it's in SEED.cpp ? )

Duzenko instead wanted to take a crack at it.

Anyone able to provide a test map with:

1. lod fade in entity

2. lod fade out entity

3. LOD model entity

4. hide distance entity

 

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

@nbohr1more @duzenkoI could probably cook up a simple test map this weekend. I imagine we want func_emitters, SEEDs,  and maybe a couple various func statics.

Side note: We do not have fade in/out capabilities currently. Fade in and out doesn't currently work on LODs. Having that would prevent a lot of that annoying popping in and out on hide. Is it possible to add this to the list of things to explore? 

 

Link to comment
Share on other sites

23 minutes ago, kingsal said:

@nbohr1more @duzenkoI could probably cook up a simple test map this weekend. I imagine we want func_emitters, SEEDs,  and maybe a couple various func statics.

Side note: We do not have fade in/out capabilities currently. Maybe because the engine can't do alpha blends? Having that would prevent a lot of that annoying popping in and out on hide. Is it possible to add this to the list of things to explore? 

 

The fade-in values modify the material alpha. To make lit materials fade would require making hybrid materials that feed the lit stages to the alpha stages.

Probably better done as a hard-coded engine thing though rather than a material hack.

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

39 minutes ago, kingsal said:

We do not have fade in/out capabilities currently

There is alpha fade in and out, it needs alpha channel in the texture and particular material setup. I wasn't able to blend between lod stages though, only fading out from nothing to fully rendered object.

Link to comment
Share on other sites

1 hour ago, kingsal said:

@nbohr1more @duzenkoI could probably cook up a simple test map this weekend. I imagine we want func_emitters, SEEDs,  and maybe a couple various func statics.

Side note: We do not have fade in/out capabilities currently. Maybe because the engine can't do alpha blends? Having that would prevent a lot of that annoying popping in and out on hide. Is it possible to add this to the list of things to explore? 

 

At least have a look at it, maybe we can kill more than one sparrow with one cannon

Link to comment
Share on other sites

@peter_spyReally? Thats great. Do you have an example of that material set up? I swore I read somewhere that doom can't do alpha blends, maybe that get patched into TDM at some point.. I dunno.

@nbohr1more @duzenko I can throw in some lights and other func statics in the test map so we can test stuff like that.

Link to comment
Share on other sites

1 minute ago, kingsal said:

@peter_spyReally? Thats great. Do you have an example of that material set up? I swore I read somewhere that doom can't do alpha blends, maybe that get patched into TDM at some point.. I dunno.

@nbohr1more @duzenko I can throw in some lights and other func statics in the test map so we can test stuff like that.

Here's a quick draft by biker if you're interested

https://cdn.discordapp.com/attachments/792307226399604746/865627549782114305/dkotest.map

It's being discussed on Discord as well

The biker's version does not load for me on svn due to @stgatilov's ongoing work in that area

Link to comment
Share on other sites

1 hour ago, stgatilov said:

Regarding the error that @duzenko got.

The way "image_preload 0" works makes no sense for CPU-resident textures.
I suppose if image is CPU-resident, then it must be loaded immediately even if someone has enabled not-officially-supported on-demand texture loading.

Of course, I will fix that tomorrow unless someone beats me to it

  • Like 1
Link to comment
Share on other sites

Is this fade in and out even possible? I know almost nothing about rendering but I tried to do it, in Dhewm3 and no matter what i tried, it just didn't worked, the only alpha fading, I could do was on lights and material colors, alpha was always totally invisible or visible, there was no in-between.

The only "fade" I could easily do, was the normal monster burn effect used on Doom 3, but is bad for LODing and like I said uses alpha testing, not alpha fading.

Perhaps you need a shader for this that Doom 3 and Dewm3 engine lacks?  

Btw this seems very strange, when you have the translucent option, but it seems to be a hack and objects with it on, do not interact with light, bad for grass, it stays full bright in shadow, but I could be totally wrong and just not knowing how to do it, very probable, like I said, I'm not a graphics/rendering guy. 

Also Quake Wars engine seems to do LODing using a technique called alpha dithering, not alpha fading, if you guys extract the quake wars assets, you will see in Textures/common the various dither textures they use for the fading affect, to my ignorant eyes, seems to be used just for a texture animation, where you change a alpha mask texture for one with more and more pixels disabled, and small and small in size, in a grid like pattern. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

  • Recent Status Updates

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

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...