1
0
Fork 0
Commit graph

262 commits

Author SHA1 Message Date
Stuart Buchanan
af8f71db40 WS30 - Autogenerate 70% of earth surface
Generate Ocean tiles where no scenery is available.

As a side-effect, this also fixes bug which caused
sim to hang if unable to find WS3.0 scenery at
starting location.
2023-01-29 21:50:04 +00:00
James Turner
029ce8f0df WS3: add tags+breadcrumbs for Sentry
Record some key values to help understand differing WS3 performance
results by some testers, and add a tag when WS3 is enabled.
2023-01-16 11:07:56 +00:00
Stuart Buchanan
56996cc01a WS30 - Clear WS30 data on tile unload
Previously WS30 data from STG files - in particular road/rail/river
data - was kept permanently.

This change unloads it with the STG-level tile.  This is the right
level to do so, as it will be reloaded from tile when the STG file
is loaded again.
2022-12-01 16:43:23 +00:00
Stuart Buchanan
4f01ddb1cc WS30 - Remove log spam for missing tiles
Previously any missing WS30 tiles created multiple OSG WARN
messages from the file not being found.  This change does a check
to ensure the file actually exists before put it on the queue for
loading.
2022-11-27 14:31:46 +00:00
Stuart Buchanan
c1fc71066b WS30 Move VPB tile loading to the tile manager
Previously VPB tiles were loaded by the STG file loader.

This was not ideal as the VPB tile granularity is 1x1 degree
while the STG file loader is 20x20km.

This change makes the tile manager load VPB tiles explicitly
on range, and allows better prioritization of the underlying
terrain.
2021-10-20 23:39:59 +01:00
James Turner
e23bf8d7d2 TerraSync: match API change
Pass the scenery path suffixes here to terraSync explicitly, to
avoid it needing to read the properties from a hard-coded path,
which is inefficient.
2021-06-11 09:59:33 +01:00
Stuart Buchanan
54acb84f6f WS30: Add better controls for LOD
Use SGSceneFeatures to set VPB properties
2021-02-02 15:17:44 +00:00
Stuart Buchanan
35c0f7d028 WS30: Property configuration VPB
Configure the VPB elevation mesh via properties:

/scenery/elevation-mesh/sample-ratio controls the elevation
mesh sampling, allowing reduction in mesh size

/scenery/elevation-mesh/vertical-scale is just for fun and
scales the mesh vertically making mountains taller.

/scenery/elevation-mesh/constraint-gap-m controls how much below
airports etc. elevation vertices are forced to be.
2021-01-27 20:03:49 +00:00
Nathaniel Warner
512f1ba3d9 Use observer_ptr in OrthophotoManager 2020-11-29 15:01:23 -08:00
Scott Giese
f03358d4f8 Merge branch 'next' of https://git.code.sf.net/p/flightgear/flightgear into next 2020-11-27 18:00:06 -06:00
Nathaniel Warner
4ddc3dc8aa Fix orthophotos not being cleaned up on scenery reload 2020-11-27 17:54:55 -06:00
Stuart Buchanan
4e46548250 Set minimum expiry time on STG nodes. 2020-11-26 22:59:39 +00:00
Julian Smith
f62e5b9ce3 CompositeViewer: Support for multiple view windows using osgViewer::CompositeViewer.
Overview:

    Previously Flightgear always used a single osgViewer::Viewer(), which
    inherits from both osgViewer::ViewerBase and osgViewer::View, giving a
    single view window.

    If CompositeViewer is enabled, we instead use a osgViewer::CompositeViewer
    which contains a list of osgViewer::View's. Each of these View's can have
    its own eye position, so we can have multiple different views of the same
    scene.

    Enable at runtime with: --composite-viewer=1

Changes to allow use of osgViewer::CompositeViewer:

    Previously FGRenderer had this method:

        osgViewer::Viewer* getViewer();

    This has been replaced by these two new methods:

        osgViewer::ViewerBase* getViewerBase();
        osgViewer::View* getView();

    If CompositeViewer is not enabled (the default), the actual runtime state
    is unchanged, and getViewerBase() and getView() both return a pointer to
    the singleton osgViewer::Viewer() object.

    If CompositeViewer is enabled, getViewerBase() returns a pointer to a
    singleton osgViewer::CompositeViewer object, and getView() returns a
    pointer to the first osgViewer::View in the osgViewer::CompositeViewer's
    list.

    The other significant change to FGRenderer() is the new method:

        osg::FrameStamp* getFrameStamp()

    If CompositeViewer is not enabled, this simply returns
    getView()->getFrameStamp(). If CompositeViewer is enabled it returns
    getViewerBase()->getFrameStamp(). It is important that code that previously
    called getView()->getFrameStamp() is changed to use the new method, because
    when CompositeViewer is enabled individual osgViewer::View's appear to
    return an osg::FrameStamp with zero frame number).

    All code that uses FGRenderer has been patched up to use the new methods so
    that things work as before regardless of whether CompositeViewer is enabled
    or not.

    We make FGRenderer::update() call SviewUpdate() which updates any extra
    views.

Extra view windows:

    If CompositeViewer is enabled, one can create top-level extra view windows
    by calling SviewCreate(). See src/Viewer/sview.hxx for details.

    Each extra view window has its own simgear::compositor::Compositor
    instance.

    Currently SviewCreate() can create extra view windows that clone the
    current view, or view from one point to another (e.g. from one multiplayer
    aircraft to the user's aircradt) or keep two aircraft in view, one at a
    fixed distance in the foreground.

    SviewCreate() can be called from nasal via new nasal commands "view-clone",
    "view-last-pair", "view-last-pair-double" and "view-push". Associated
    changes to fgdata gives access to these via the View menu. The "view-push"
    command tags the current view for later use by "view-last-pair" and
    "view-last-pair-double".

    Extra view windows created by SviewCreate() use a new view system called
    Sview, which allows views to be constructed at runtime instead of being
    hard-coded in *-set.xml files. This is work in progress and views aren't
    all fully implemented. For example Pilot view gets things slightly wrong
    with large roll values, Tower View AGL is not implemented, and we don't
    implement damping. See top of src/Viewer/sview.cxx for an overview.

OpenSceneGraph-3.4 issues:

    OSG-3.4's event handling seems to be incorrect with CompositeViewer -
    events get sent for the wrong window which causes issues with resize and
    closing. It doesn't seem to be possible to work around this, so closing
    extra view windows can end up closing the main window for example.

    OSG-3.6 seems to fix the problems.

    We warn if CompositeViewer is enabled and OpenSceneGraph is 3.4.
2020-11-21 13:27:02 +00:00
James Turner
ce65b84c20 TerraSync: wait on Models as well
Avoid starting tile load until Models is done sync-ing, since this
causes may missing file errors.
2020-11-12 09:33:15 +00:00
James Turner
fff2fa1718 Raw-pointer -> smarter pointer in TileMgr
Not fixing any leaks, just making ownership more explicit.
2020-08-11 11:44:29 +01:00
Stuart Buchanan
39cedd1256 Fix fgviewer for Compositor 2020-07-01 21:02:16 +01:00
gallaert
4854607382 Replace boost::lexical_cast by std::ostringstream and std:stof/stoi/stod 2020-04-22 14:06:13 +01:00
Richard Harrison
bf85a2d542 Fixes to static LOD ranges 2020-04-12 21:34:41 +02:00
Richard Harrison
cb08eb6d6d Fix for range animations in the scenery
Reinstate lod/rough and lod/bare and therefore fix the use of range animations that implement hardwired LOD.

Initially I was reluctant to do this - but after a lot more research I'm no longer convinced that range animations cause a huge performance hit and so we can keep this fix until either the scenery is fixed or the situation becomes clear.

Ideally this fix should be reviewed prior to the next LTS release; or maybe after the next LTS release - but in future reviewed it must be
2020-04-04 00:55:12 +02:00
James Turner
e492ddd5a0 Event more local8Bit -> UTF8 fixes 2020-03-13 09:53:49 +00:00
James Turner
27410761f3 Lots of UTF8 path correctness fixes 2020-03-12 14:23:44 +00:00
Richard Harrison
c99ea20883 LOD ranges rework.
Rework the LOD ranges.

1. The scenery ranges are now deltas (avoids overlapping values)
2. The AI/MP pixel mode now has a default radius that is 20 for Aircraft, 200 for ships, 350 for carriers. This is a simple constant in a virtual function.
3. Added the ability to set the AI/MP ranges equal which means use the low detail model.
4. Changed high detail only to be indicated by a -ve number in maxRangeDetail
5. Re-ordered the range list to go from lowest detail at [0] to highest detail at the end. This is because OSG always loads the models starting from zero on the assumption that the detail increases with the index.

This fixes the pixel mode, which previously would use the radius of the parent which would be confusingly large, and unrelated to the actual size of the model. With the simple defaults that we have the pixel values set in the ranges won't exactly match the rendered size of the model on screen, but it will be a lot closer and more importantly meaningful.
2018-10-30 21:05:55 +01:00
Peter Sadrozinski
ec4b9f8542 Alternative terrain engine based on pagedLOD
- remove TileMgr from sub systems - add to btg terrain engine
2017-02-26 10:17:15 -05:00
Stuart Buchanan
dab9a9fc73 Remove /sim/rendering/building-mesh.
Made redundant by /sim/rendering/scenery-path-suffix
2017-01-21 22:22:43 +00:00
James Turner
e64a2db5a0 Remove the scenery path mangling.
Requires a matching SG commit for correct operation.
2016-11-20 22:42:48 +00:00
Stuart Buchanan
55f64820df Fix display of OBJECT_BUILDING_MESH_DETAILED 2016-11-08 19:43:32 +00:00
Rebecca N. Palmer
3b1f01c49d stop using /sim/terrasync/scenery-dir, fix scenery path order
Having non-Nasal-readable scenery paths breaks things
(The property continues to exist, but is now from-C++-to-Nasal only)
2016-10-18 22:10:09 +01:00
Stuart Buchanan
14f20e4165 Add support for building meshes. 2016-09-22 20:40:26 +01:00
James Turner
16814800ce Use Paths instead of strings. 2016-06-22 17:36:05 +01:00
Stuart Buchanan
56374621c5 Make LOD of buildings/trees/objects/STG configurable.
Now using /sim/rendering/static-lod/rough.
2016-04-08 22:38:17 +01:00
James Turner
8877b442f8 ATC/Traffic doesn’t crash reset.
- remove some global headers from AI headers, to avoid pollution
- change how ATC owns the ‘player’ FGAIAircraft so reset works
- ensure AIAircraft controllers are cleared on unbind for reset
2015-12-11 12:11:59 -06:00
James Turner
585235ce01 One more log item for the tile-cache. 2015-03-08 09:41:27 +00:00
James Turner
89115ccb1d Adding some debugs for Thorsten Renk’s issue.
Will revert this patch in the future.
2014-11-19 22:35:44 +00:00
James Turner
c6c63e65f7 Adding log message for an edge case. 2014-11-19 22:35:44 +00:00
James Turner
71da5b7a76 Tweak scenery-loaded logic
Make first-start (not a reset / re-init) behaviour more explicit.
2014-11-15 16:29:39 +00:00
James Turner
779a97b925 Move all tile-manager init to reinit path.
- improves changing scenery paths at runtime.
2014-11-11 22:25:55 +00:00
Stuart Buchanan
b654477794 New materials.xml format 2014-08-09 20:43:34 +01:00
James Turner
fd248e9391 Respect tile expiry time when cache is disabled.
Tiles added via the visible mechanism always have an
expiry time of 0.0, so this only affects tiles added by elevation queries, from the AI or FDM.
2014-05-24 14:23:59 +01:00
James Turner
431a3eaa1b Tune osgDB::MaxPagedLODs parameter 2014-05-17 09:05:34 +01:00
James Turner
f19da413bb Initial mode to disable caching of tiles. 2014-05-16 14:52:24 +01:00
James Turner
130f581b18 Tile-manager can request VBOs.
Monitor /sim/rendering/use-vbos and pass the value into
our SGReaderWriterOptions.
2014-02-21 08:52:07 -08:00
James Turner
0473607731 Tweak tile-manager SGBucket API
* FG builds with 'NO_DEPRECATED_API' in SGBucket
2014-02-19 14:02:09 -08:00
James Turner
239a000763 Use new SGBucket API in tile-manager
- check for invalid tiles / buckets, which occurs at the poles
- use .sibling() method to offset
- no longer need to store view lat/lon in the manager.
2014-02-13 18:52:52 +00:00
Christian Schmitt
6cadc2cf40 Simplify some SGGeod-related calculations 2014-02-05 23:07:43 +01:00
James Turner
ce3a7b20fe Crash-fix: mat-lib is now reference-counted.
Adapt to corresponding SG change to make SGMaterialLib be ref-counted,
and have the 'reload-materials' command notify the tile-manager of this,
so it can update the options struct it passes to new tiles.
2014-01-19 16:49:44 +00:00
James Turner
7b8a64b614 Crash fix: thread-safe material conditions
When tiles are being loaded, re-evaluate the materials cache once
per update cycle. (This is probably too often, but no worse than the
previous approach).
2014-01-06 08:28:40 +00:00
James Turner
ad4834c651 Splash-screen feedback on scenery download. 2013-09-30 16:36:13 +01:00
James Turner
cb087dc4de Tile-manager: kill off tile-refresh.
Now the manager waits on terrasync, we never need to do the 
'experimental' refresh feature, since we only load finished tiles.
2013-09-30 12:07:35 +01:00
James Turner
e03ebef99f Tile-Manager waits on TerraSync to load.
Using a new TerraSync API, make the tile manager wait on actively
syncing tiles before sending them to the SceneryPager. This resolves numerous
issues with missing tiles, including at startup.
2013-09-30 12:03:47 +01:00
James Turner
1862688d27 Pass terrasync dir through to osgDB options.
Half of fix for TerraSync Models not being found.
2013-08-29 22:12:34 +01:00