Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Starman01 on September 04, 2005, 02:14:59 pm

Title: Is the LOD-System really working ?
Post by: Starman01 on September 04, 2005, 02:14:59 pm
Hey guys,

I have a question that works in me for quite some time, and now that I have another proof for my theory, I have to finally ask it.
(I'll just make it a little longer and tell you the story that lead me towards it :) )

Is the LOD-System really working ?

In many other spacesim-games, you can actually "see" the switching between the single lods, but not in Freespace. This is actually a good thing, but now I have a problem.

For the usage of autopilot missions (and to keep the autopilot and travel time to a healthy amount), I switched the capships models with a small jumpbouy once I reached a big distance.
The reason is, I can keep the traveltime shorter but the models still get inivisible and therefore the illusion of big distance travelling will be perfect.

Now, Goober told me that this model-switching can cause problems (he had some crashes, I never had any in this matter) because the small bouy I switched into had different subsystem-entries than the original model.

Now, to work around the problem, I made an additional LOD to one of our big models, and I made that LOD only a very small cube (around 50 times smaller than the big model itself), so theoretically the effect should be the same like the model-switch.

Once I reach the LOD-Distance, the bigmodel shouldn't be visible anymore, only the small, which wouldn't be visible by that distance (currently 15000 klicks). But I can still see the bigship, even at 30.000 klicks.

Any ideas ?

Starman©
Title: Is the LOD-System really working ?
Post by: StratComm on September 04, 2005, 04:52:11 pm
The detial slider has a bit to do with this, or at least it did at some point in time.  At highest detail, the LOD rendering order goes more like LOD0, LOD0, LOD1, LOD2 and so will never display your last LOD.  Trouble is, it's not consistant across systems.  The LOD system works fine, it's that you're trying to use it in a way that isn't appropriate for LODs.  If you're not going back to that point, I'd suggest Ship Vanish, which will just take it off of the playing field.
Title: Is the LOD-System really working ?
Post by: Roanoke on September 04, 2005, 05:07:47 pm
I assume starman still needs the ship to be present though. I'd try replacing the smallest default LOD with a different mesh myself
Title: Re: Is the LOD-System really working ?
Post by: karajorma on September 04, 2005, 05:12:24 pm
Quote
Originally posted by Starman01
I made an additional LOD to one of our big models


I suspect that's your problem. AFAIK LOD 4 or above will be ignored.
Title: Is the LOD-System really working ?
Post by: phreak on September 04, 2005, 06:29:29 pm
setting the detail level to the highest effectively multiplies the table values by 4.  Also i don't think you can have 5 LODs either.
Title: Is the LOD-System really working ?
Post by: Trivial Psychic on September 04, 2005, 08:36:18 pm
Bob's HTL Herc does.
Title: Is the LOD-System really working ?
Post by: StratComm on September 04, 2005, 11:48:15 pm
I've yet to see LOD5 rendered though.
Title: Is the LOD-System really working ?
Post by: Starman01 on September 05, 2005, 12:43:22 pm
Well, the new LOD is indeed LOD4. Sure it isn't used at all ? I thought there were some ships in retail with 5 lods.

And yes, ship vanish isn't possible, because I need the ship with the same name staying in the mission, because at the end of the mission I will travel back to the carrier-group, where it must become visible again.

On the other hand, I don't think it's a good idea making the small cube already at lod3, since the model is quite high detailed and should have the different details.

If it isn't possible, I will be really be forced to make an additional model-entry in the table, which is invisible, but has the same subsystem like the big object so I can swap the models ingame.

@Goober : You sure this model change is a problem ? (See our Bug-Tracker Sticky, ID-0028) I had never problems here. I would hate to make the additional table-entries (though AFAIK they are also a waste of ressources).
Title: Is the LOD-System really working ?
Post by: StratComm on September 05, 2005, 02:39:19 pm
What about using the old "ShipName[]" (where [] is some ASCII character not in the BankGothic character set) trick to replace the ship when you "come back" to it?
Title: Is the LOD-System really working ?
Post by: Roanoke on September 05, 2005, 04:12:04 pm
Quote
Originally posted by StratComm
What about using the old "ShipName[]" (where [] is some ASCII character not in the BankGothic character set) trick to replace the ship when you "come back" to it?



<--- has learned something new
Title: Is the LOD-System really working ?
Post by: karajorma on September 05, 2005, 04:15:26 pm
That's an old trick that one. Check out Inferno or Boomerang (from the VW archives) where it was used to make a micro-subspace jump.
Title: Is the LOD-System really working ?
Post by: IPAndrews on September 06, 2005, 08:50:14 am
Quote
Originally posted by StratComm
LOD0, LOD0, LOD1, LOD2


You know this LOD selection system is sounding a little bit rubbish / hacky. I can't believe the coders didn't just do the sensible thing and use a detail level based multiplier to modify the default LOD distances specified in the ships.tbl . That might be a nice little project for a SCP coder once the code freeze is eventually lifted.
Title: Is the LOD-System really working ?
Post by: KARMA on September 06, 2005, 10:06:19 am
from what kazan told me, you can CONVERT up to 6 lods, but FSO will USE only the first 4
Title: Is the LOD-System really working ?
Post by: phreak on September 06, 2005, 10:11:48 am
Quote
Originally posted by IPAndrews


You know this LOD selection system is sounding a little bit rubbish / hacky. I can't believe the coders didn't just do the sensible thing and use a detail level based multiplier to modify the default LOD distances specified in the ships.tbl . That might be a nice little project for a SCP coder once the code freeze is eventually lifted.


Quote
Originally posted by PhReAk
setting the detail level to the highest effectively multiplies the table values by 4.


edit: its actually 8

where depth is the closest point on the model to the eye
Code: [Select]

switch( Detail.detail_distance ) {
case 0: // lowest
depth *= 8.0f;
break;
case 1: // lower than normal
depth *= 4.0f;
break;
case 2: // default  (leave the same)
break;
case 3: // above normal
depth /= 4.0f;
break;
case 4: // even more normal
depth /= 8.0f;
break;


Also the model code can recognize 8 LODs, but the ship parse code can only take 5.
Title: Is the LOD-System really working ?
Post by: Galemp on September 08, 2005, 11:16:02 pm
The LOD system has definitely been tampered with recently. It seems to me in the latest builds that LOD1 isn't being used at all, not even in the target view box (which is where it's most needed.) Not only does LOD1 look better in wireframe there, but it's a significant performance increase. If I target a hi-poly Fenris, we should only have to draw one hi-poly fenris and leave the lower-poly LOD to the small target view.

If you want proof this has nothing to do with the detail settings, go into the Lab and look at the models. If you select LOD1, it's still LOD0. Somehow LOD0 is being forced into the LOD1 slot and all the others are being pushed down.

Making good LODs is a significant amount of work for a modeler, and is even more important with high-detail models. Please, please reinstate the old system.
Title: Is the LOD-System really working ?
Post by: WMCoolmon on September 09, 2005, 12:07:29 am
The lab has never seemed to really work properly with LODs..I'm not sure why, though.
Title: Is the LOD-System really working ?
Post by: Unknown Target on September 09, 2005, 09:19:15 pm
I still think a "dynamic LOD" system would be great...