Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: SF-Junky on May 27, 2017, 12:58:37 pm

Title: Do we still need $Detail distance?
Post by: SF-Junky on May 27, 2017, 12:58:37 pm
Me thinks that this item stems from ancient times when computers had 256 MB of memory and the Intel Pentium II was state-of-the-art CPU crap. Today we all have supercomputers at home. So what speaks against setting detail distance to ( 0 ) for all ships - or at least for everything smaller than a destroyer?
Title: Re: Do we still need $Detail distance?
Post by: krevett62 on May 27, 2017, 01:11:18 pm
Because anyway you won't see the difference in details at 2km away for fighters in a dogfight. And if it can light the load on the cpu/gpu to do other things then why change this? If you want more details at distance you can still edit the ai profile table and increase the settings of $Detail Distance Multiplier.
Title: Re: Do we still need $Detail distance?
Post by: The E on May 27, 2017, 01:14:41 pm
For fighters? Probably not. For large, 20k-plus polygon capships? Yes, absolutely.
Title: Re: Do we still need $Detail distance?
Post by: zookeeper on May 27, 2017, 03:03:54 pm
Me thinks that this item stems from ancient times when computers had 256 MB of memory and the Intel Pentium II was state-of-the-art CPU crap.

Any sane 3D engine supports LODs, its usefulness is by no means limited to obsolete hardware.
Title: Re: Do we still need $Detail distance?
Post by: SF-Junky on May 27, 2017, 03:41:06 pm
Okay, that's three convincing arguments to stick with LODs within three replies. :)
Title: Re: Do we still need $Detail distance?
Post by: Novachen on May 27, 2017, 04:54:27 pm
Absolutely we need this.

Not only, because there are executables for older consoles of this game for example. Consoles like openPandora, X-Box Classic or even Sega Dreamcast...
Title: Re: Do we still need $Detail distance?
Post by: AdmiralRalwood on May 27, 2017, 06:05:30 pm
Absolutely we need this.

Not only, because there are executables for older consoles of this game for example. Consoles like openPandora, X-Box Classic or even Sega Dreamcast...
...What? I'm unaware of anyone running FSO on the Dreamcast or the XBox, and the only port of FSO to the OpenPandora I'm aware of is for TBP, and based on FSO 3.7.0. Even if, for some reason, all future mod releases stopped using detail distance and future versions of FSO started ignoring it, that port would be unchanged, so... :confused:
Title: Re: Do we still need $Detail distance?
Post by: Mongoose on May 27, 2017, 08:09:47 pm
For fighters? Probably not. For large, 20k-plus polygon capships? Yes, absolutely.
I think even a few of the MediaVP fighter models are into 5-digit polycounts.
Title: Re: Do we still need $Detail distance?
Post by: Mito [PL] on May 29, 2017, 06:35:34 am
However, this LOD change is really visible, especially when it comes to older HTL models, like the Orion or Fenris. I'm not a coder, but would it be possible to expand the LOD0 range - or even make the LOD change distance treshold dependant on a proper ship table parameter?
Title: Re: Do we still need $Detail distance?
Post by: Admiral Nelson on May 29, 2017, 06:48:28 am
You can always override the MVP detail distance values with a small tbm of your own that pushes the detail distance values way out.  I used to do that before the last MVPs.

I will say that Asteroid LODs seem inordinately visible, though.  Probably something to look into there.
Title: Re: Do we still need $Detail distance?
Post by: Luis Dias on May 29, 2017, 10:12:14 am
Doesn't this also affect things like collision detection?
Title: Re: Do we still need $Detail distance?
Post by: zookeeper on May 29, 2017, 11:31:04 am
Doesn't this also affect things like collision detection?

Collision detection doesn't use the lower LOD levels, it always uses LOD0. Unless you specifically use the new'ish the $Collision LOD feature (http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Collision_LOD:), that is.
Title: Re: Do we still need $Detail distance?
Post by: Luis Dias on May 29, 2017, 11:56:34 am
That's.... something I didn't know. Using LODs to collision detection seemed such a no brainer, but just reading that link I can already understand the list of exceptions and problems you will encounter with such a system.
Title: Re: Do we still need $Detail distance?
Post by: The E on May 29, 2017, 12:00:31 pm
That's.... something I didn't know. Using LODs to collision detection seemed such a no brainer, but just reading that link I can already understand the list of exceptions and problems you will encounter with such a system.

It's an important performance optimization, especially for those 6k poly fighters people make; resolving collisions against LOD0 is really expensive. Furthermore, assuming that the LOD1 (or whatever you want to use) has the same dimensions as LOD0, there's no appreciable difference between hits to LOD0 and LOD1.
Title: Re: Do we still need $Detail distance?
Post by: zookeeper on May 29, 2017, 02:11:36 pm
That's.... something I didn't know. Using LODs to collision detection seemed such a no brainer, but just reading that link I can already understand the list of exceptions and problems you will encounter with such a system.

Sure, if the ship has submodel subsystems and turrets and the like, then the LOD to be used for collision detection needs to be built with that in mind. But that can make collision detection a whole lot faster. For example in complex and fancy fighter models a lot of the polycount can simply have been spent making sure all engine cones, gun barrels and round surfaces are nice and smooth, whereas for purposes of collision detection, a gun barrel really doesn't need to be more than 4-sided. Small greebles and grooves don't need to be considered at all.

It's usually a pretty quick job (at least with the mesh editing tools of 3ds Max) to minimize those kinds of details to produce a LOD1 that doubles nicely as a collision mesh.

For really big ships it's harder to make significant savings, so it might normally not be worth the effort.