Commit Graph

5867 Commits

Author SHA1 Message Date
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
Julian Smith
c9051cedca simgear/props/props.cxx: fixed bug in SGPropertyNode::removeChild().
Don't set node->_parent to null before calling
SGPropertyNodeImpl::fireChildRemoved().

This fixes problem with Jaguar-GR1 HUD.

[Should probably set node->_parent to null before returning, but previous
(non-locked) code didn't do this, and it would require acquiring mutex.
2021-05-29 23:14:02 +01:00
James Turner
f74ba148ab Precomputed random numbers API
Use precomputed tables to give stable random numbers : replaces previous
recompuation when we exhaust the RNG pool.

By Marc Eberhard
2021-05-25 12:53:36 +01:00
Fernando García Liñán
e7fbf83155 Compositor: Allow changing the implicit buffer attachments 2021-05-24 23:49:45 +02:00
James Turner
26995ba13b Raise minimum OSG version to 3.6 2021-05-24 16:47:56 +01:00
James Turner
bd6a18bb96 CMake: set OpenGL VND policy to NEW to see if it works
OLD is causing shouty warnings from CMake, let’s see what happens if
we try for NEW.
2021-05-24 12:40:32 +01:00
James Turner
8d0d1f9047 Props changes: fix a link error with Clang 2021-05-24 12:40:32 +01:00
Stuart Buchanan
e91c06223a WS30: Reduce log spam
Previously blank lines in the various .txt LIST files
created spurious error logging.  This commit does some
simple length checking and ignore blank lines rather than
complaining (and then ignoring).
2021-05-23 21:25:16 +01:00
Julian Smith
0b6678f745 simgear/structure/SGSharedPtr.hxx: reformatted to make it readable. 2021-05-23 08:10:57 +01:00
Julian Smith
46e79aba11 simgear/math/simd4x4.hxx: avoid -Wdeprecated-copy warnings.
Added simd4x4_t::operator=().
2021-05-23 08:10:57 +01:00
Julian Smith
0f78bcaa49 simgear/props/props.*: various debugging/diagnostics additions to property locking.
Added runtime control of property locking active, and lock contention
diagnostics; new SGPropertyLockControl() allows associated property nodes to be
registered.

Added code to measure time spent locking/unlocking; disabled via preprocesor by
default because gives small decrease in fps even when disabled at runtime.

If SG_PROPS_UNTHREADSAFE is defined we defer to the old property code at build
time (requires old files to be available as props-unsafe.{hxx,cxx}). This
facility will hopefully be be removed at some point, but for now makes it
easier to compare before/after speed.
2021-05-23 08:06:02 +01:00
Julian Smith
f1dd7901cb simgear/props/props.*: added locking using read/write mutex.
Added a std::shared_mutex to SGPropertyNode and changed all props code to use
shared or exclusive locks as necessary whenever reading/writing data.

SG_PROPERTY_LOCKING=0 or 1 can be used to control whether locking is
active. Default is 1.

SG_PROPERTY_LOCKING_VERBOSE=0 or 1 can be used to cause diagnostics to be
generated if we get lock contention. Default is 0.

Removed most of the inline implementation code in props.hxx - now that we use
locking, nearly all calls eventually end up in props.cxx in order to take out
a lock so there's no point inlining. For template code this also means that we
now explicitly instantiate / specialise in props.cxx.

Reformateed props.hxx to use consistent indentation. Also condensed identical
comments for related methods such as getBoolValue(), getIntValue() etc, which
results in more readable visual grouping.

Much of the internal implementation code for SGPropertyNode is now in the form
of static methods in a new SGPropertyNodeImpl class in props.cxx. This class is
marked as a friend of SGPropertyNode in props.hxx so these methods can access
all SGPropertyNode internal data without being declared in props.hxx. So one
can change implementation code without recompiling everything.

Removed TEST_READ and TEST_WRITE macros.

Removed SGPropertyNode::MAX_STRING_LEN - was only used in compare_strings() and
it is unnecessary.
2021-05-22 23:52:36 +01:00
Fernando García Liñán
64e4adf0b9 Fix osgText issues under OSG 3.6
It looks like assigning an Effect to the geode containing the osgText is
enough and there aren't any conflicts with OSG own shaders. This might
change in the future if the switch to the core profile happens.

The text shaders also rely on fixed pipeline features like
gl_FrontColor. This is because aircraft developers are used to using
material animations to change the text color.
2021-05-14 22:47:28 +02:00
Stuart Buchanan
d0f4e9018c WS30: Fix regression of lakes
Fix regression that stopped lakes from being generated.
2021-05-12 21:36:11 +01:00
Stuart Buchanan
81b93cffbb WS30 - Minor roads and coastline improvements
- Correct normals on line features and coastlines
- Ignore coastline segments < 10m
- Clean up logging.
2021-05-08 20:46:38 +01:00
Stuart Buchanan
b6c4245b35 WS30: Don't compress landclass textures
Previously landclass textures were compressed by
out internal optimizer.  This caused bad artifacts
on landclass boundaries, e.g. where landclass 1 met
landclass 10 there would be compression/interpolation
artifact with a value of (say) 5.

This disables compression for such landclass textures.
2021-05-08 15:44:38 +01:00
James Turner
51bf76846c Thread-safe error reporting in lowlevel.cxx
Use an exception rather than polling a flag, for checking errors
during BTG reading. This should allow us to give a correctly
identified error, at exactly the point the read fails.
2021-05-03 16:22:24 +01:00
Stuart Buchanan
fc93788ab1 WS30: Initial coastlines 2021-05-03 15:43:59 +01:00
Richard Harrison
8464ef48e8 Fixes #2579 Emesary segfault on reset.
Need to call OnDeregister before the object is deleted (because not using smart pointers for receivers).
2021-05-02 17:35:24 +02:00
James Turner
5e30d83a43 Error-reporting: improve reports for STGs and effects
When an effect defines no shader sources, special case this error to
avoid confusing result from SGProgram.

Add error-context for readNode STG loading, so failures inside an
STG can be attributed
2021-04-30 13:47:34 +01:00
Fernando García Liñán
0299764619 Remove unsupported buffer format 2021-04-29 13:03:29 +02:00