Board index FlightGear Development Scenery

Unload parts of a model via distance?

Questions and discussion about enhancing and populating the FlightGear world.

Unload parts of a model via distance?

Postby fmg » Wed May 08, 2019 5:03 pm

Hello,

it's a question about models in general. Since it is for a scenery model I post it here. It's also an edge-light, but I didn't wan't to hijack the other thread about one.

Is it possible to deselect parts of a model according to the viewers distance via the .xml-file?

For the hole model you could use the range tag, but what to do, if you like to unload only some parts of the model. First idea was to use the <condition> tag, but for this you need a property to compare. On the other hand it's possible f. e. to scale an object with the distance without use of a property. Where did these function get the distance value from? Is it possible to use this as condition for <select> also?

Background: since it is not possible/necessary to see the model of the edge light from far away I unloaded it via <range> if it is more then 450 m away. Guess it could be even less.
At nighttime I load the model taxilampblue.xml from Shared models/Effects a bit over the lamp via the edge-light.xml because the illuminated blue glass of the edge-light becomes to small to be seen from afar. This taxilampblue you can still see from a few thousand meters distance, but if I set the range definition to the edge-light then also the taxilampblue gets unloaded after 450 m.
Easy way would be to set the range-value up, but I want to keep the impact on the frame-rate as low as possible. You have hundreds of edge-lights on an airport. With a shorter range only a dozen needs to be loaded.


Regards

Frank
User avatar
fmg
 
Posts: 530
Joined: Tue Jun 29, 2010 5:13 pm
Location: EDDI
Callsign: fotomas
Version: 2
OS: Mac OS X 10.6.8

Re: Unload parts of a model via distance?

Postby Thorsten » Wed May 08, 2019 5:26 pm

Basically you don't at all.

I believe at one point we tried to remove all range animation xmls on the grounds that the distance checks turned out to be more expensive than 'just' render the object 'as is'.

I guess IcecodeGL has already said it, but the edge light should not be a normal scenery model and most definitely not include complicated xml, range checks or effects but should be a fairly simple model that gets instanced for good performance.
Thorsten
 
Posts: 10587
Joined: Mon Nov 02, 2009 8:33 am

Re: Unload parts of a model via distance?

Postby fmg » Wed May 08, 2019 5:49 pm

Thanks,

in the past I made some test with objects that appear in great numbers (e.g. trees) and a shorter range definition. Frame rates become better then on my system. But I can try without range definition.
The edge light was my first model I made for FG and therefore it is rather detailed. To reduce the possible impact on frame-rate I later on made a simplified model with way less vertics and did a test.
The airport has 232 edge-lights. Unfortunately (or luckily?) the fps stay exactly the same with my old model (s 1124 v1309)
as with the new one (s 576 v 682).
User avatar
fmg
 
Posts: 530
Joined: Tue Jun 29, 2010 5:13 pm
Location: EDDI
Callsign: fotomas
Version: 2
OS: Mac OS X 10.6.8


Return to Scenery

Who is online

Users browsing this forum: No registered users and 2 guests