Commit Graph

5887 Commits

Author SHA1 Message Date
James Turner
67806a59b0 Fix a dumb crash I introduced. 2021-08-04 09:08:16 +01:00
Stuart Buchanan
578a8acff4 WS30: Improve tile loading times by ~50%
Previously on my system, generating vegetation for a given tile
took 0.15-0.2s (for ~ 56k positions), of ~0.4s.  While this is done in a
separate loading thread, the sheer number of tiles being loaded
caused noticeable delays and popping of higher LoD tiles.

As a tile at the highest LoD is typically 6x6km, and vegetation
is generated on a scanline of individual triangles, there is a _lot_
of temporal locality on the landclass of a series of points.

By caching the material information required from the landclass lookup
we can avoid a whole much of material lookups for each successive
vegetation point.

On my system this reduced the time to generate vegetation down to
0.02s per tile, and total tile generation time down to ~0.2s.
2021-08-03 20:56:56 +01:00
Julian Smith
e93839a9c5 simgear/environment/visual_enviro.cxx: fixed include of simgear/math/sg_random.hxx. 2021-08-03 09:20:35 +01:00
Julian Smith
ded91614ab simgear/debug/logstream.cxx: enable file:line on startup if SG_LOG_FILE_LINE is 1.
E.g. allows file:line in diagnostics when running test-suite.
2021-08-02 21:04:29 +01:00
Stuart Buchanan
d1e9134a89 WS30: Improved vegetation constraints
Unlike the elevation constraints, the vegetation constraints
don't need to be global.  So no need for mutexes.  Big speed up.
2021-08-02 17:47:48 +01:00
Stuart Buchanan
8cc3c15712 WS30: Stop trees from growing on roads, rivers. 2021-08-02 17:10:49 +01:00
Stuart Buchanan
dc1d6284fd WS30: Fix crash on reset caused by VPBTechnique 2021-08-01 20:48:27 +01:00
Stuart Buchanan
4f01f758ae WS30: Fix deadlock introduced by fb436be8f1 2021-08-01 20:47:38 +01:00
Fernando García Liñán
2039f49691 Add missing call to glReadBuffer() when doing depth-only FBOs 2021-08-01 08:35:25 +02:00
James Turner
d8874c26b6 Control over reporting from SimGear
To avoid exposign Sentry to Simgear, add some abstract reporting controls
which can be toggled easily without any extra dependencies.
2021-07-31 18:31:10 +01:00
legoboyvdlp R
b44f187328 Canvas: instead of setting anisotropy directly, set it by the same mechanism as mipmapping 2021-07-31 15:27:36 +01:00
Julian Smith
3ba8c383b4 simgear/io/HTTPRepository.cxx: fixed some compiler warnings. 2021-07-31 10:29:25 +01:00
Julian Smith
f9b485a915 simgear/package/Package.cxx: removed assert that cannot fire due to unsigned.
This avoids a compiler warning.
2021-07-31 10:29:25 +01:00
Julian Smith
109da4eb49 simgear/environment/metar.cxx: fix use of std::string::rfind().
Need to compare result with std::string::npos, not for -ve.
2021-07-31 10:29:25 +01:00
Julian Smith
0da173cfd8 simgear/nasal/lex.c: show line and column if illegal character is found.
Makes it easier to track down e.g. missing quotes in Nasal source within .xml
files.
2021-07-31 10:29:25 +01:00
Julian Smith
95239fea87 simgear/io/iostreams/zlibstream.*: improved support for reading compressed data.
Added support for seeking (forwards only) - in ZlibAbstractIStreambuf, added
seekoff().

Also disabled assert that checked that we reach EOF compressed data at same
time as EOF uncompressed data; was breaking things when using embedded
compressed streams within fgtape recording.

Added ZLibCompressionFormat::ZLIB_RAW, uses windowBits=-15, for zlib compressed
streams without header or trailer.

Fixed clang build error with std::min().
2021-07-31 10:29:25 +01:00
James Turner
d01e9ca2e6 Use owning refs in some places
Avoid explicit deletes of ref-counted SGMaterialCache
2021-07-29 17:51:35 +01:00
James Turner
fb436be8f1 MaterialLib: make it thread-safe 2021-07-29 17:51:03 +01:00
James Turner
9e3e4a1ab5 TileDetails: set group names for debugging 2021-07-29 17:50:33 +01:00
James Turner
d6e452ea08 Fix a ref-count loop in Paticles manager 2021-07-29 17:50:33 +01:00
Fernando García Liñán
67bb39083c Fix shadows on Mac OS 2021-07-29 15:48:55 +02:00
Fernando García Liñán
df66decdda Compositor: Replace OSG camera resize function by own implementation 2021-07-29 08:38:18 +02:00
Fernando García Liñán
7f4fb15636 Compositor: Change uniform enum names to avoid name clashing on Windows 2021-07-28 15:18:21 +02:00
Fernando García Liñán
db8b66203d WS 3.0: Apply the TERRAIN_BIT nodemask to all geodes 2021-07-28 10:50:14 +02:00
James Turner
1d59135652 Report errors on TileDetails callback failures
This callback can do out of memory and other failures, so catch
those and report them.
2021-07-27 16:05:03 +01:00
James Turner
2478bee97f Don't report PropsIO exceptions 2021-07-27 14:23:09 +01:00
Fernando García Liñán
a256110c02 Compositor: Do not clear buffers by default 2021-07-26 16:14:58 +02:00
Fernando García Liñán
908dc467a8 Compositor: add new uniforms
Provide the sunlight direction in view and world space and the near/far distance given by the CameraGroup.
2021-07-26 12:04:56 +02:00
Fernando García Liñán
420555c69c Fix issue with Effect techniques that have the highest index and a scheme
We previously used the last technique, but now we use the last technique that has no scheme.
2021-07-24 19:47:09 +02:00
Fernando García Liñán
d85205212a Compositor: Attach color and depth render buffers by default 2021-07-24 19:19:44 +02:00
Fernando García Liñán
a83048bc37 Remove another problematic buffer format 2021-07-24 13:41:29 +02:00
Fernando García Liñán
4ee1d820ba Remove the GL_R11F_G11F_B10F image format 2021-07-24 07:02:20 +02:00
Fernando García Liñán
b3b863a3c4 Preliminary changes for the HDR pipeline
- Add an Effect to stars and planets so they don't disappear when not using the fixed-pipeline.
- Allow usage of the shadow mapping related uniforms in 'quad' passes as well.
- Add extra buffer formats (some of them only work under the core profile).
- Better handling of mipmapping in the Compositor.
2021-07-23 06:43:08 +02:00
James Turner
877c3a68e6 Optimise sidereal_course performance
Avoid calling into sgTimeGMT (which calls into the C library)
every single update.
2021-07-21 22:54:11 +01:00
James Turner
5f334d3839 ModelRegistry: Special case empty file names
Related to ticket:
https://sourceforge.net/p/flightgear/codetickets/2609/
2021-07-21 22:53:12 +01:00
James Turner
999e499ce5 Nasal Hash: add isNil wrapper 2021-07-12 09:29:52 +01:00
James Turner
7db6651970 Fix Cyclone-DDS test linkage 2021-07-12 09:29:10 +01:00
James Turner
b50d8e38e6 Error reporting for animations / conditions
Don’t report errors for each condition parse failure, but do 
aggregate them at the animation level in ReaderWriterXML

Sentry-Id: FLIGHTGEAR-DD
2021-06-26 16:27:22 +01:00
James Turner
069483e6d0 Add try/catch wrappers in SGSubsystemGroup
Attempt to narrow down the source of some fatal exceptions we see
on Senty, which occur during init/startup. All these blocks re-throw
so user behaviour is unchanged, but we’ll log the name of the subsytem.
2021-06-23 13:26:40 +01:00
James Turner
820b76d894 Fix deadlock on quit for Linux 2021-06-22 16:25:41 +01:00
Stuart Buchanan
bbdc9f2318 WS30: Adjust based vegetation density
Previously, by observation comparing actual vegetation density
on Medium, WS30 had many more trees than WS20.

This adjusts the base vegetation density down to match WS20.

Note that at High and Very High densities, there is still a disparity
that needs to be addressed.
2021-06-19 18:11:49 +01:00
James Turner
a49619fa6c TerraSync: add another ‘is downloading’ helper 2021-06-18 09:34:30 +01:00
James Turner
59307e9ba2 Emesary: allo main loop recipient shutdown 2021-06-17 15:53:16 +01:00
James Turner
c279557d32 Attempt to fix realpath() recursion
Sentry-Id: FLIGHTGEAR-D6W
2021-06-14 13:52:22 +01:00
James Turner
84eda17958 Make out-of-memory in computeHash fatal 2021-06-14 12:10:47 +01:00
James Turner
9ec9d8e423 TerraSync: set scenery path suffixes explicitly 2021-06-11 10:00:54 +01:00
Stuart Buchanan
1a6bf3c284 WS30: Don't defer reading of line features
Previously, reading LINE_FEATURE_LIST/AREA_FEATURE_LIST/COASTLINE_LIST
files were not read with the .stg file, but deferred into the
DelayLoadReadFileCallback.  When the the Callback was executed, the
files were read and appropriate terrain tiles dirtied for regeneration.

However, re-generating dirtied tiles caused significant frame pauses
and was disabled in commit
deb802f74a

This meant that the Line/Area/Coastline features would only be rendered
when the next LoD tile was generated.  Which created a race condition
on startup for the tile the user starts on, between the
DelayLoadReadFileCallback and the tile itself.

This commit reads these files at the same time as the initial terrain
so that the VPB has all the data required when the tile is initially
rendered.  The downside is that line data is read for every tile,
even if it is far away.  As the line data is stored as a series of
lat/lon floats, this is assumed to be OK.

An alternative would be to re-instate the Visitor, and instead
of dirtying existing terrain, generate the roads, and flag them to
the UpdateVisitor to add to the terrain node.
2021-06-06 22:10:52 +01:00
Julian Smith
16778e5c02 simgear/props/props_test.cxx: use VALUE_CHANGED_DOWN to make tests pass.
This checks old behaviour works. Need to add tests of the new default behaviour
where property changes do not call parent nodes' listeners.
2021-06-03 23:12:58 +01:00
Julian Smith
087d04db8e simgear/canvas/Canvas.cxx: Canvas::Canvas(): mark tree with VALUE_CHANGED_DOWN.
This is required for canvas to work - relies on value-changes being visible to
higher nodes.
2021-06-02 22:19:21 +01:00
Julian Smith
f8b5e6ab81 simgear/props/props.*: Modification to calling of listeners when property values change.
We now default to not calling parent nodes' listeners when a node's value
changes.

This avoid overheads introduced by recent addition of locking - walking up the
parent nodes needs to lock/unlock at each step, and was previously happening
whenever any node in the entire tree had its value changed, causing noticable
slowdown.

Node creation/removal still calls parent nodes' listeners as before.

If a node has new attribute VALUE_CHANGED_UP set, we do call its parent node's
listeners.

New SGPropertyNode::Attribute's VALUE_CHANGED_UP and VALUE_CHANGED_DOWN:

    VALUE_CHANGED_UP: if set, when fireValueChanged() is called we also call
    our parent node's fireValueChanged().

    VALUE_CHANGED_DOWN: if set, new and existing child nodes have their
    VALUE_CHANGED_UP and VALUE_CHANGED_DOWN attributes set.

    Once set, these attributes cannot be cleared (because to correctly handle
    this would require reference counting).

SGPropertyLockControl(): added parent_listeners arg. If true, we always call
parent node's fireValueChanged() when a node value changes; this restores
previous property system behaviour. Default is false.

Extra overall timing diagnostics.
2021-06-02 22:19:21 +01:00