Jump to content
The Dark Mod Forums

hide_distance broken again?


grayman
 Share

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


  • Recent Status Updates

    • irg

      Every day is just like the 4 Non Blondes song. What IS going on?
      · 0 replies
    • Nort

      I threw out all the women I had in my basement, to make room for my future clip brush experiments. I am surprised that not even the basic "nodraw" texture has been documented in the wiki. It's like a whole new frontier for me to explore, of exciting new advanced engine functionalities.
      At the same time there's so many other things I want to do. I want to do everything at once, and I lack patience, and I think that that's why I burn out so often. I need to learn to relax. There is no hurry - no expectations, no pressure.
      · 0 replies
    • Nort

      I did it! I finally did it! After 48 hours of frustration and confusion, I managed to finally sort out how to attach equipment to NPC:s properly, and write down coherent instructions on how to do it, both in my manual, and in this forum.
      I can finally rest. I can finally eat breakfast.
      · 0 replies
    • Nort

      Spent most of the day learning and writing about AI navigation. It's stuff I already know, but the magic about writing something down as clearly formulated as possible, is that you then see things that much more clearly. You also find what's unclear to you, and then you figure out exactly how things work. I was hoping to get through it all within just a day, but it looks like this will take tomorrow as well, at this rate. There's also plenty of other nonsense I have to get through as well. Everything's a chore.
      · 0 replies
    • Nort

      I want to be a fish, but I'm not a fish. My mom wants to be a fish too, and so she's killing herself eating plankton and sh***ng blood, and tells me to stop nagging her about taking her medication. I spent several hours today, just lying in bed, having anxiety over just existing, and not being a fish. You fish, you don't know how lucky you are. You can eat all the plankton you want. I tried eating plankton again yesterday, and I just got sick. I hate being a shark.
      · 0 replies
×
×
  • Create New...