Commit Graph

5991 Commits

Author SHA1 Message Date
Stuart Buchanan
1a37dcf3d5 WS30: Improved algorithm for airport placement
Previously the vertices directly underneath an airport were
displaced downwards.  In general this worked OK, but for airports
surrounded by higher terrain, this could cause "ridges" from
edges from vertices just outside the airport boundary.

This commit modifies the algorithm to also reduce the elevation
of vertices immediately outside the airport boundary as well.
2022-02-24 22:29:34 +00:00
Erik Hofman
b157f9cb9f Make the option ShivaVG or ShaderVG a Cmake option: USE_SHADERVG 2022-02-20 15:37:33 +01:00
Erik Hofman
6451e505d8 Add ShaderVG, a shader based version of ShivaVG
All FlighGear specific patches applied to ShivaVG are also applied to
ShaderVG, if appropriate.

For testing only for now, it is not yet fully functional.
2022-02-17 13:34:21 +01:00
James Turner
c1179f2e3b Update to Expat 2.4.4
Required to address reported in-the-wild CVEs in older Expats.

This may need a tweak for Linux / BSDs to set appropriate values in
our custom expat_config.h : only macOS and Windows tested so far.
2022-02-13 17:26:57 +02:00
Stuart Buchanan
4485505381 Fix rotation of cloud sprites (#2359)
Previously 3D cloud re-position code did not re-orientate
the sprites, leading to the sprites being at an angle for
long flights.

Fix from Michael DANILOV to address this.
2022-02-06 15:39:16 +00:00
James Turner
8722ea0fb6 Model animation loading errors
Another fix, for a different exception type, spotted by Michael D.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2702/
2022-02-06 10:56:05 +00:00
Stuart Buchanan
f17bd77030 WS30: Better water detection 2022-02-05 15:21:39 +00:00
James Turner
93adb8508e Effects: pass the model XML path through to makeEffects
This gives knowledge of how to resolve relative paths, to makeEffects
invocation of findDataFile, and hence gives a more familiar lookup
ordering, for Aircraft-supplied effects.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2678/
2022-02-04 12:08:46 +00:00
James Turner
13595ce05d Throw exception for broken XML animations.
Throwing an exception causes normal error-collecting to trigger for
the XML model load, so this is sufficient to avoid the crash and
also report back to the aircraft developer & user.

Thanks to Michael Danilov for catching this.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2702/
2022-02-04 12:07:24 +00:00
Stuart Buchanan
30b5bbe7d5 WS30: Add property controlling splitting water mesh
Previously a separate mesh was created for parts of the
terrain identified as being water.

This adds a property (/scenery/elevation-mesh/separate-water-mesh)
which controls whether this separate mesh is generated.
2022-02-01 17:05:31 +00:00
Stuart Buchanan
28e2ccda01 MR104: Added the Milky Way onto the night sky
From Chris RINGEVAL

Squashed commit of the following:

commit ee2ec625ef10ab372a99397a82d1272670d767ec
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Mon Jan 31 00:01:39 2022 +0100

    Replace galaxy texture by our own and update galactic coordinates

commit 26f3d80df6385913668635013912f1c4fef50e60
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Tue Dec 7 22:02:10 2021 +0100

    Cleanup white lines and comments

commit 55e9f9b4bcbe21a34be7be874b120bda73c49cb8
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Sun Dec 5 15:53:15 2021 +0100

    Cleanup cxx parts to the minimal required, moving all rendering to the shaders

commit 0cff2827bb3c18f85780cce5c0178ee37c590fe5
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Wed Dec 1 22:55:41 2021 +0100

    Adding moon direction uniform vector used in the Milky Way shader

commit 24485079673c299bad95fc1f800542a6d73e8e95
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Wed Dec 1 22:54:54 2021 +0100

    Adding Milky Way texturing and dark sky brightness effects
2022-02-01 16:13:44 +00:00
Erik Hofman
a6624b8c89 Add ALS prodecural lights compatible pointing_x, pointing_y, pointing_z. You can now use the same direction vector for both ALS and the Compositor lights 2022-01-29 13:29:44 +01:00
Stuart Buchanan
76f1ffa269 WS30: Fix passing of edge-hardness to shader 2022-01-22 15:44:19 +00:00
Fahim Imaduddin Dalvi
1afbda9833 WS20: Object mask bug fix for random lights
The random lights placement algorithm was using the incorrect channel
from the object mask image, (red instead of blue as mentioned in
Docs/README.materials). This commit rectifies the mismatch.
2022-01-17 22:13:38 +03:00
Stuart Buchanan
4ed559d5a9 WS30: Pass material parameter/edge-hardness to shader 2022-01-15 14:52:33 +00:00
Stuart Buchanan
a95b531409 WS30: Road shader - add required Uniforms 2022-01-12 21:31:47 +00:00
James Turner
0459406f84 Supress missing-override warnings in GCC/Clang
Due to OSG's age, I get a lot of these with Clang & XCodee
2022-01-10 15:01:58 +00:00
Julian Smith
085a71b934 simgear/screen/video-encoder*: changed licenses to be LGPL-2.0-or-later. 2022-01-08 10:34:11 +00:00
Julian Smith
b3f9aa7f32 simgear/screen/video-encoder*: added GPL SPDX-License-Identifier license text. 2022-01-07 17:20:03 +00:00
James Turner
1f1b047981 Add range() function to Nasal 2022-01-07 16:14:44 +00:00
Julian Smith
8772ff4e2a simgear/props/props.*: added SGPropertyNode::getValue<std::string>() specialisation.
This is needed for external VR code that used to use
SGPropertyNode::getValue<const char*>() (which has been removed).
2022-01-06 22:02:45 +00:00
Fahim Imaduddin Dalvi
c4c5829d37 Added airport terrain check for random objects
Random objects like lights and trees are not placed on airport terrain
anymore. This commit also refactors some of the existing code for clarity.
Discussion can be found here [1] and detailed history here [2].

[1] https://sourceforge.net/p/flightgear/simgear/merge-requests/102/
[2] https://sourceforge.net/u/fahimdalvi/simgear/ci/bugfix/ws30_random_objects_avoid_airports/~/tree/

Squashed commit of the following:

commit 643198f8d52da8d65a674b052c508f03d7f83ac0
Author: Fahim Imaduddin Dalvi <dalvifahim@gmail.com>
Date:   Tue Jan 4 09:57:34 2022 +0300

    Implemented corrected airport intersection logic

    We now convert the point into the correct coordinate system before
    checking for intersections with the airport geometry.

commit 7e0819e4f88992658301a2c15d890fc489cfe3b6
Author: Fahim Imaduddin Dalvi <dalvifahim@gmail.com>
Date:   Wed Nov 10 19:59:04 2021 +0300

    Added airport terrain check code for random objects

    This commit does not work as expected. The light-coverage check is disabled
    to amplify the bug.

commit eb21e8fd256dcf124857ac51afc0d7c3c90ae1c6
Author: Fahim Imaduddin Dalvi <dalvifahim@gmail.com>
Date:   Wed Nov 10 19:53:44 2021 +0300

    Refactored elevation constraint checking code

    This commit provides a separate elevation constraint function that does not
    displace the given point. The current function has been renamed to indicate
    the displacement side effect.
2022-01-04 18:10:03 +03:00
Fahim Imaduddin Dalvi
d4b02d58d6 Refactored constraint checking for random objects
The Random objects check now happens in the scanline read in VPBTechnique,
rather in the VBPMaterialHandler objects. These checks are not specific
to any handler, and are thus better suited to be outside of specific
material handling logic.
2022-01-04 17:56:41 +03:00
Stuart Buchanan
65542e7521 WS30: Disable texture cache for material atlas
The texture cache interacts badly with the code creating the WS30
texture atlas, resulting in a bad atlas.  This change adds a new
SGReaderWriterOptions::LoadOriginHint::ORIGIN_MATERIAL_ATLAS
which causes the material cache not to cache the texture.
2022-01-03 17:17:17 +00:00
Scott Giese
301da53ba4 Remove FormFeeds 2021-12-27 02:29:46 -06:00
Jonathan Redpath
25f66995da osgText: improve code to search aircraft directory for font 2021-12-25 15:20:53 +00:00
James Turner
782378a1b6 Always set USE_OPENALSOFT
WIthout this, the generated SimgearConfig.cmake is a bit
unhappy.
2021-12-24 15:30:31 +00:00
Julian Smith
5fe9fd0fc6 simgear/props/props.cxx: moved common members into SGPropertyLock base class. 2021-12-24 14:49:09 +00:00
Julian Smith
23b3824170 simgear/props/props.*: added defaultValue arg to node get*Value() methods.
Add defaultValue arg to get*Value() methods that previously took no args. We
do this for getBoolValue(), getIntValue(), getLongValue(), getFloatValue() and
getDoubleValue(). The default value is returned if the node's string is not
convertible to the requested type.

This can enable some calling code to be optimised where it previously checked
for getStringValue() (which is slow now that it returns a std::string)
returning an empty string, before calling getDoubleValue().
2021-12-24 14:49:09 +00:00
Lars Toenning
dd09e5f466 Make SGPropertyNode::getStringValue() thread-safe.
This is by Lars Toenning <dev@ltoenning.de>, Roman Ludwicki <romek21@op.pl> and
SDeAstis <salvatore.deastis@gmail.com>, in 2021 Hackathon.

SGPropertyNode::getStringValue() now returns std::string by value instead of
const char* pointer into SGPropertyNode's internal data.

Patched up various call sites to use new API.

Remove SGPropertyNode::getName() and use SGPropertyNode::getNameString()
everywhere.
2021-12-24 14:49:08 +00:00
James Turner
da3507f3df CMake config option to use OpenAL-soft
THis enables overriding the Apple OpenAL.framework on
macOS, and using OpenAL-soft instead.
2021-12-24 13:23:34 +00:00
Scott Giese
854ad8c3fa apt_signs: provide content with Apt Sign messages.
Useful to help track down which sign failed to parse.
2021-12-22 23:41:58 -06:00
Scott Giese
578ffec2da SGText: minor typo correction 2021-12-22 23:39:44 -06:00
Henning Stahlke
d448ad4eb3 simgear/scene/model/SGLight.cxx: listen to entire /scenery/lights subtree.
Set VALUE_CHANGED_DOWN attribute on /scenery/lights so that listeners see
changes to all nodes in subtree.
2021-12-22 21:13:15 +00:00
Erik Hofman
9a9b1a8db4 Revert 1269a8d27c, the friction factor on ice relies on too many parameters to calculate here. 2021-12-22 08:24:51 +01:00
Erik Hofman
1269a8d27c Introduce a factor for when the lakes are frozen over and use it to alter the fricton factor, bumpiness and load resistance factor 2021-12-21 10:30:30 +01:00
Erik Hofman
612dff2ea1 Remove a stale character 2021-12-19 11:20:46 +01:00
Erik Hofman
33b0c39dbd Make it possible to use a property reference for the solid property of a material. e.g.: <solid><property>/sim/ice</property></solid> 2021-12-19 11:18:49 +01:00
Stuart Buchanan
06ecfe1927 WS30: Revert to green channel for texture atlas 2021-12-18 21:45:50 +00:00
James Turner
db5a2353bd FFmpeg: tweak components we use 2021-12-12 19:48:54 +00:00
James Turner
dd61ad8bd0 FFmpeg Cmake support for video recording 2021-12-12 18:32:01 +00:00
Julian Smith
5627b135b4 simgear/screen/: added support for video encoding.
Uses ffmpeg libraries to provide video encoding of an osg::GraphicsContext
(which could be for Flightgear's main window) to file.

The video codec is specified as a string at runtime. Success depends on what is
supported by the system's ffmpeg installation.

Handling of resize doesn't always work. We finish current stream and create a
new encoder and continue. Works ok with mpeg2, but with more modern codecs vlc
usually fails to handle the change.

We call the encoder on a separate thread to avoid latency.

If SG_FFMPEG is not defined, we don't make calls to ffmpeg libraries and
VideoEncoder class's constructor always throws an exception.
2021-12-08 10:31:27 +00:00
Stuart Buchanan
0e13e48123 WS30: Improved material Uniforms 2021-12-05 13:45:01 +00:00
b'James Turner
922ad8d2e7 Merge /u/r-a-sattarov/simgear/ branch next into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/103/
2021-11-29 10:18:36 +00:00
Stuart Buchanan
8a014df26d WS30: Improved atlas with multi-texture support.
- Prefix all WS30 Uniforms with "fg_"
- fix modelOffset (needs to be passed in as a float)
- Create a true atlas with indexes for relevant material textures
2021-11-28 19:28:54 +00:00
r-a-sattarov
21e9bf4678 nasal/naref.h: added e2k endianness (MCST Elbrus 2000) 2021-11-24 23:52:58 +03:00
r-a-sattarov
f364aedf96 math/simd.hxx: fix build by MCST lcc compiler when using ENABLE_SIMD_CODE=ON
MCST E2K (Elbrus 2000) - this is VLIW/EPIC architecture, like Intel Itanium (IA-64) architecture.

e2k architecture has half native / half software support of most Intel/AMD SIMD
e.g. MMX/SSE/SSE2/SSE3/SSSE3/SSE4.1/SSE4.2/AES/AVX/AVX2 & 3DNow!/SSE4a/XOP/FMA4

Ref: https://en.wikipedia.org/wiki/Elbrus_2000
2021-11-23 22:26:33 +03:00
Stuart Buchanan
fee4481ef6 WS30: Add zUpTransform and modelOffset Uniforms. 2021-11-19 22:05:47 +00:00
James Turner
6562546771 Nasal Math: add precision to floor(), add trunc()
To simplify various rounding / truncation operations, especially when
dealing with frequency values, give floor() the same precision control
already present in math.round(), and add math.trunc() which always 
truncates towards zero.
2021-11-16 10:59:01 +00:00
Julian Smith
ddea2de3a0 simgear/nasal/codegen.c: avoid compiler warning in findConstantIndex(). 2021-11-12 23:03:47 +00:00