Commit Graph

6076 Commits

Author SHA1 Message Date
Stuart Buchanan
a8cb72d653 WS30: Improved coastlines
Build a high resolution texture containing coastline
data that will be mixed with the landclass texture
in the ws30 shader.

Replaces the previous approach of creating a separate
coastline mesh.
2022-05-28 21:03:48 +01:00
Lars Toenning
e04f89e8b2 Use std::function for callbacks
Reduce complexity by using std::function for callbacks instead of our own class.
2022-05-25 10:37:26 +01:00
James Turner
e1aba1364b Disable the 'no shaders defined' error for now
Until we have a way to mark techqniues as permanently disabled,
remove this check, since it generates false positives. Especially,
see model-combined technnique n=9.
2022-05-25 10:36:43 +01:00
James Turner
5afeb44cec Effects: pass model XML file path, not dir path
Pass the full path to the XML file, not is containg directory, through
effects, so that it's available for error reporting. Convert to an
actual directory when using the path to lookup other resources.
2022-05-25 10:35:31 +01:00
Lars Toenning
e0e3456a68 Refactor SGTimerQueue
Use std::unique_ptrs to handle SGTimer
Use std::vector as container together with STL heap functions
2022-05-16 09:50:54 +01:00
Julian Smith
13ca3cec56 simgear/screen/video-encoder*: build fixes for ffmpeg code on Windows.
simgear/screen/video-encoder-internal.hxx:
    Fixed initialisation of AVRational instance to work on Windows.
simgear/screen/video-encoder.cxx:
    av_log(): vasprintf() is not available on Windows so use fixed buffer on
    Windows.
2022-05-04 17:54:46 +01:00
Julian Smith
20898923e0 simgear/timing/rawprofile.hxx: minor update to docs. 2022-05-01 23:24:42 +01:00
Julian Smith
eb94d12c4f simgear/screen/video-encoder.cxx: fixed build failure when SG_FFMPEG undefined. 2022-05-01 23:24:42 +01:00
Julian Smith
ac37f734ba simgear/screen/video-encoder*: support for logging timing info for sws_scale(). 2022-05-01 15:18:58 +01:00
Julian Smith
8037a0eb20 simgear/timing/rawprofile.hxx: support for profiling single piece of code. 2022-05-01 15:18:54 +01:00
Julian Smith
294e0b0bb7 simgear/structure/commands.cxx: removed assert that fires if we don't use thread-cpu affinities. 2022-04-30 00:45:23 +01:00
Erik Hofman
12c0166f92 Calculate if the sound source is within the mach cone relateive the the listener and calculate the offset within the mach code for use by the sound configuration file. 2022-04-29 15:07:14 +02:00
Erik Hofman
6719a8e3d5 Add functions to return the squared length of a vector: Comparing two squared values prevents two computionally heavy sqrt calls. 2022-04-25 10:48:07 +02:00
Stuart Buchanan
fa2b5911b7 WS30: Add waterline-start and waterline-end params
Used for coastline mixing.
2022-04-09 16:24:51 +01:00
James Turner
363906828f Reduce log noise for a common message in input 2022-04-06 07:50:36 +01:00
Lars Toenning
b01e8f51f1 Add missing include 2022-03-27 20:07:27 +01:00
Erik Hofman
718b09d7c3 Do not use ShaderVG until it's ready for use 2022-03-25 07:40:51 +01:00
James Turner
2993671fa4 Subsystems: only record timings if enabled
Avoid some overhead in copying std::map<>, in the common case where
subsystem timing reporting is not enabled.
2022-03-24 16:06:09 +00:00
Julian Smith
de0ab92cca simgear/nasal/code.c: fixed conversion of strings to bool.
We need to check IS_OBJ(r) after IS_STR(r) because all strings are also
objects.

For example this fixes a bug where an empty string evaluated as true.
2022-03-20 15:07:13 +00:00
Richard Harrison
3cc7b9a17b DDS-TC: Add origin to CanvasImage loadImage
Method loadImage should set the canvas origin to allow the DDS texture cache to act appropriately (i.e. not include anything from Canvas)
2022-03-17 11:43:46 +01:00
Richard Harrison
9e0ab6e268 DDS-TC : Always exclude all of canvas origin
The assumption is that all images coming from Canvas should be excluded from inclusion into the DDS texture cache.

Previously there was special logic that only excluded transparent images of Canvas origin but this was probably wrong.
2022-03-17 11:42:33 +01:00
Richard Harrison
91eca221f9 Fix Translate axis animation Refs ticket #2706
Due to an error I made in 7ac90850 all AxisObject-based translate animations were inverted.

I think this correctly fixes the animations so that a value of zero is the 'start' vertex of the axis and a value of 1.0 is the 'end' value of the axis.

Start and end are now defined on the lowest x,y,z that aren't equivalent (within 0.01mm)

see: https://sourceforge.net/p/flightgear/codetickets/2706/
2022-03-14 16:58:12 +01:00
Richard Harrison
83eda09558 Remove threaded Nasal garbage collection refs #2674 Nasal corruption:
refs: https://sourceforge.net/p/flightgear/codetickets/2674/

Because disabling threaded GC wouldn't result in exactly the same allocation and GC due to changes I made to the GC as part of the threaded GC work the only safe thing to do is to remove it all.

Once we have figured out if it is the threaded GC causing the problem or not then we will at least know what needs fixing.
2022-03-13 21:37:28 +01:00
Richard Harrison
30736ea057 Use helper method for OSGText alignment 2022-03-10 20:13:25 +01:00
Richard Harrison
92c4ea9f45 Added helper method for OSGText alignment conversion 2022-03-10 15:11:52 +01:00
James Turner
56e3a652f9 Fix ShaderVG compilation on macOS (and others?)
We had a manual change in ShivaVG, to include the shConfig.h file
explicitly, since the sources do not include it themselves. Replicate
this change in our copy of ShaderVG.

Necessary to fix compilation on macOS and likely FreeBSD as well.
2022-03-09 10:43:22 +00:00
James Turner
ddb5e52885 Nasal: extend boolify() to work on containers/objects
Consider non-empty containers and non-nil objects (eg, ghosts) to be
true-like, in boolify(). This makes for more natural testing of return
values.

Since these types previously caused a runtime error, should be backwards
compatible, unless code was relying on the error. This seems improbable,
if it happens in practice, we can revert and find a different solution.
2022-03-09 10:36:58 +00:00
James Turner
47a103f7ea Nasal: add str() helper to force a type to be a string
Calls existing naStringValue internally.
2022-03-09 09:58:37 +00:00
James Turner
6bbf7ed109 Add missing declaration to SpacerItem 2022-03-09 09:58:37 +00:00
James Turner
a6bd613159 Remove log message, now property changes are stable 2022-03-09 09:58:37 +00:00
Erik Hofman
6a32b758af Remove a mistake, GLEW is not required when including the correct headers 2022-02-26 13:24:07 +01:00
James Turner
bb18c59530 Grid: Add row/column stretch implementation
Also add a basic test case for stretch behaviour.
2022-02-26 11:23:21 +00:00
James Turner
6b9575d076 Expat: build on older GLibC versions
getrandom() is only in GLibC >= 2.2.5, and CentOS 7 uses an older
GCC version, so add CMake logic to fallback to /dev/urandom as the
Expat entroy source.
2022-02-25 20:59:20 +00:00
James Turner
7ee427c202 Add GridLayout for Canvas.Layout
Need a grid layout in addition to the existing vbox/hbox layouts,
add a basic one. Still work in progress, minimal test cases pass.
No height-for-width support yet, but row/column spanning and stretch
factors are supported.

Move some functionality from Layout.cxx into BoxLayout.cxx, which
is specific to the one-dimensions layout types.
2022-02-25 16:39:39 +00:00
Lars Toenning
d146c0561f Fix compilation with libavcodec >5
API was constified: 626535f6a1
2022-02-25 10:54:37 +01:00
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