Where can I set the distances for Lod0-Lod4?

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Where can I set the distances for Lod0-Lod4?

Post by Max Bain »

Is it possible at all?
I have some models which switch the level of detail way too fast so that it looks awful and stutters. How can I change that?
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by UniTrader »

its in libraries/renderparam_library.xml iirc
also the distance for the additional detail overlay meshes can be set there


Dont forget there is also a setting for lods which probably acts like a multiplier to these values, so dont take them as face value but rater as the ratio to each other
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Where can I set the distances for Lod0-Lod4?

Post by Max Bain »

UniTrader wrote: Sun, 20. Oct 19, 22:28 its in libraries/renderparam_library.xml iirc
also the distance for the additional detail overlay meshes can be set there


Dont forget there is also a setting for lods which probably acts like a multiplier to these values, so dont take them as face value but rater as the ratio to each other
Thank you very much!

Can you maybe give an example what the values mean? Its not very self explaining. Especially why lodradius3 is only 10 while lodradius0 is 400. I would expect that lod3 value is higher than lod0, even if they are only multipliers...
Also what does speed mean?

Code: Select all

    
    <rule name="dbglodrule_ship_xl" range="30000.0" sizecontrib="50" speed="2.0" priority="1" lodradius0="400" lodradius1="200" lodradius2="100" lodradius3="10">
      <connections>
        <tag name="ship_xl" />
      </connections>
    </rule>    
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by UniTrader »

your quoted entry looks to me like one for debug only (because of the dbg prefix) - cannot check myself currently but is there another entry for ship XL?


ps distance units are usually meters, but for the lod rules this could vary
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Where can I set the distances for Lod0-Lod4?

Post by Max Bain »

UniTrader wrote: Mon, 21. Oct 19, 11:33 your quoted entry looks to me like one for debug only (because of the dbg prefix) - cannot check myself currently but is there another entry for ship XL?


ps distance units are usually meters, but for the lod rules this could vary
No, all ship relevant parts contain dbg prefix. Just checked it. Also there is only this partfor XL ships and another one for XL parts.

But how do the values work? I mean what effect hast the range and the lodradiusX ?I cant not think of a function that makes sense to me, especially because lod3 can be lower than lod0.
When I want to lets say make lod1 appear not so early, what do I need to change? How can lod3 be just 10? It makes no sense to me... :(
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
Angsaar
Posts: 151
Joined: Thu, 7. Mar 19, 14:03
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by Angsaar »

Range might be divided by lodradius (it would be then a radius factor, not an absolute distance) and some other stuff. Speed might be a fade in/out effect.

If I remember correctly particle effects have a lower lodradius the larger they are.
Last edited by Angsaar on Tue, 22. Oct 19, 05:46, edited 1 time in total.
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: Where can I set the distances for Lod0-Lod4?

Post by teleportationwars »

Max Bain wrote: Mon, 21. Oct 19, 11:47
UniTrader wrote: Mon, 21. Oct 19, 11:33 your quoted entry looks to me like one for debug only (because of the dbg prefix) - cannot check myself currently but is there another entry for ship XL?


ps distance units are usually meters, but for the lod rules this could vary
No, all ship relevant parts contain dbg prefix. Just checked it. Also there is only this partfor XL ships and another one for XL parts.

But how do the values work? I mean what effect hast the range and the lodradiusX ?I cant not think of a function that makes sense to me, especially because lod3 can be lower than lod0.
When I want to lets say make lod1 appear not so early, what do I need to change? How can lod3 be just 10? It makes no sense to me... :(
Let us know what you come up with. The XR to X4 port needs to handle this and the tests haven't gone well.
Berserk Knight
Posts: 398
Joined: Tue, 17. Dec 13, 01:34
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by Berserk Knight »

Double lodradius values seem to work pretty well for the Fulmekron, as does removing them entirely. (X:Rebirth's renderparams didn't have the lodradius.)
Arawn seems to keep flickering though. It could be the details, so I'm gonna test that as well.

Edit: Nope. I guess I placed the landing pads exactly where the lod attempts to switch under most circumstances.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Where can I set the distances for Lod0-Lod4?

Post by Max Bain »

Berserk Knight wrote: Tue, 22. Oct 19, 08:03 Arawn seems to keep flickering though. It could be the details, so I'm gonna test that as well.

Edit: Nope. I guess I placed the landing pads exactly where the lod attempts to switch under most circumstances.
Hey thats the problem I have too :(. Please let me know if you found a way to fix that. I will test with lods after work today or tomorrow.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
linolafett
EGOSOFT
EGOSOFT
Posts: 3567
Joined: Mon, 26. Mar 12, 14:57
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by linolafett »

"Lodradius X" is the radius "X" in pixels on screen (when using LOD setting of 50 in the options). Below the value "X" the next LOD will be shown.
Larger values mean that the assets switch to a lower lod earlier (as you dont need to move much away from something to make it appear smaller on screen)

EDIT:
Here a super high tech image i made years ago to describe the system. Maybe that helps.

[ external image ]
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff
Berserk Knight
Posts: 398
Joined: Tue, 17. Dec 13, 01:34
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by Berserk Knight »

linolafett wrote: Tue, 22. Oct 19, 16:55 "Lodradius X" is the radius "X" in pixels on screen (when using LOD setting of 50 in the options). Below the value "X" the next LOD will be shown.
Larger values mean that the assets switch to a lower lod earlier (as you dont need to move much away from something to make it appear smaller on screen)

EDIT:
Here a super high tech image i made years ago to describe the system. Maybe that helps.

[ external image ]
The Arawn still flickers despite the lodradius being dropped all the way down to 20/10/5/1.

My best guess right now is that being at or near a landing pad/bridge screws up the renderparams for things that it SHOULDN'T be messing with.
linolafett
EGOSOFT
EGOSOFT
Posts: 3567
Joined: Mon, 26. Mar 12, 14:57
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by linolafett »

Or the asset is wrongly set up. Like object origins not where they should be, transforms not applied, weird hierarchies set up, zfighting etc.
"Flickering" is usually not a result of LOD swapping.
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff
Berserk Knight
Posts: 398
Joined: Tue, 17. Dec 13, 01:34
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by Berserk Knight »

linolafett wrote: Wed, 23. Oct 19, 09:03 Or the asset is wrongly set up. Like object origins not where they should be, transforms not applied, weird hierarchies set up, zfighting etc.
"Flickering" is usually not a result of LOD swapping.
I'm afraid this one falls under the "not usual" category.

I already checked the assets before, and I checked it again just to be sure. I even went and commented out the part once just to be 100% certain that the part I'm looking at actually is the one I'm dealing with.
Offset, max size, center offset, everything appears fine. (It's also one of the 3 parts that are included in the Arawn's main model, so there's even less chance that it's wrong.)


There is a part of the hull that is affected which has a very distinct pattern for different LODs. I'm using that to keep track of the active LOD.

If I remove the landing pad, it doesn't flicker even under normal lodradius values. The best LOD is retained well over twice the distance to the furthest end on the landing pad.
When it's there though, not even a 1/1/1/1 lodradius setting (=best LOD or don't display at all) can prevent the flickering when I am either ON the landing pad, or in a small ship flying NEAR it.
Hell, the hull retains the best LOD whether I'm closer or further away from it as long as I stay far away enough from the landing pad.

I think I've tried everything I can.
I still stand by my assessment that the rendering settings when on/near a landing pad messes with the LOD in some way, as the flickering never happens if there is no landing pad, while it happens despite all settings set to actively prevent it when there is one.
On that note, I think the bridge does something similar.
Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: Where can I set the distances for Lod0-Lod4?

Post by Max Bain »

What landing pad are you talking about? The arawn has plenty of them. I think if removing just one or two it would be an acceptable fix. Even removing all and making it a battleship would be better than to have this flickering.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link
linolafett
EGOSOFT
EGOSOFT
Posts: 3567
Joined: Mon, 26. Mar 12, 14:57
x4

Re: Where can I set the distances for Lod0-Lod4?

Post by linolafett »

Also how are you adding the landing pad?
Are you simply sticking the dockingbay macros at it, or are you adding a dockarea macro onto the ship?
We do the latter- Dockareas, containing multiple dockingbays.
01001100 01101001 01101110 01100101 01110011 00100000 01101111 01100110 00100000 01110100 01101001 01101101 01100101 01110011 00101110 00101110 00101110

My art stuff
teleportationwars
Posts: 158
Joined: Fri, 12. Jul 19, 14:03

Re: Where can I set the distances for Lod0-Lod4?

Post by teleportationwars »

For several of the xr ports we have tried, the xml lod values do nothing.
BrummBear02
Posts: 310
Joined: Fri, 3. Oct 08, 20:43
x3ap

Re: Where can I set the distances for Lod0-Lod4?

Post by BrummBear02 »

as far as i know there is no flickering in ojumps or sco`s arawn port?
Gebt mir einen Spiegel dann schlage ich ihn mit seinem eigenen Gesicht

Return to “X4: Foundations - Scripts and Modding”