Commit Graph

5954 Commits

Author SHA1 Message Date
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
Julian Smith
5ce5044dce simgear/scene/tgdb/VPBTechnique.*: fix a clang sign-comparison warning.
Also removed unnecessary initialisation of _fileName to "".
2021-11-12 22:58:56 +00:00
Julian Smith
067875ab93 simgear/scene/util/OrthophotoManager.cxx: added missing break statement. 2021-11-12 22:58:51 +00:00
Julian Smith
7cd5d5312e simgear/props/props.hxx:SGPropertyNode: removed ununsed debug state for locking. 2021-11-11 21:07:09 +00:00
Stuart Buchanan
0470375889 WS30 Uniform arrays and photoscenery search path 2021-11-10 22:57:08 +00:00
Stuart Buchanan
2ec9df7597 Fix compile error on MacOS 2021-11-09 22:10:26 +00:00
Stuart Buchanan
6be17cc9e8 WS30: Add photoScenery Uniform for orthoscenery 2021-11-09 18:13:16 +00:00
Stuart Buchanan
9528bd0749 WS30: Photoscenery code cleanup, reduce log spam 2021-11-07 09:16:45 +00:00
Stuart Buchanan
7a7b26e75d WS30: Initial photoscenery work
Hack for hackathon
2021-11-06 14:42:23 +00:00
Stuart Buchanan
6ea99e43f1 WS30: Use NEAREST_MIPMAP_NEAREST for landclass
Only for the MIN filter, as the MAX filter causes
significant interpolation issues.
2021-11-05 01:12:01 +00:00
Stuart Buchanan
1553ac2e17 WS30: Minor cleanup and run generators for ALS (If required) 2021-11-04 21:44:01 +00:00
Fahim Imaduddin Dalvi
419e9bc128 WS30: Fix random lights density
Earlier calculations assumed degrees instead of radians for the
granularity of random lights, resulting to the wrong density. This
is now fixed. The scanline for random lights is also more efficient
now, taking the lower limit of light-coverage into account.
2021-10-30 13:07:35 +03:00
Stuart Buchanan
a1d748a0de WS30: Fix filtering of texture atlas
Previously we were taking the nearest pixel from the nearest
mipmap.  Which was braindead.  Now just use the OSG defaults,
which are NEAREST_MIPMAP_LINEAR for MIN and LINEAR for MAX.

Thanks to Julian and Henning for helping diagnose this on
the weekly hangout.
2021-10-24 21:25:08 +01:00
Stuart Buchanan
7916dfb61d WS30 Move VPB tile loading to the tile manager
Previously VPB tiles were loaded by the STG file handler.
Now they are loaded directly by the tile manager, allowing
better management of tile loading.
2021-10-20 23:37:59 +01:00
b'Fernando Garc\xc3\xada Li\xc3\xb1\xc3\xa1n
fc1d02110c Merge /u/amalon/simgear/ branch vr_5 into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/100/
2021-10-20 22:21:01 +00:00
Fahim Imaduddin Dalvi
6e7fa6b139 WS30: Generic Materials handler and Random tile lights
This commit implements a generic materials handler providing an easy way to
extend the efficient landclass scanning code for new material-specific
processing like trees, random lights, random buildings etc. The existing
vegetation code has been ported to make use of this generic interface,
and random tile lights have been added as well. Detailed commit log can
be found at [1], discussions can be found at [2] and [3].

[1] https://sourceforge.net/u/fahimdalvi/simgear/ci/feat/ws30_random_lights/~/tree/
[2] https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/AC818EC5-84A3-425B-98CB-352CCB0B8910%40gmail.com/#msg37356997
[3] https://sourceforge.net/p/flightgear/simgear/merge-requests/99/
2021-10-21 00:34:32 +03:00
James Turner
6d71ab75b2 METAR: Remove duplicate lines from manual merge
Thanks to Tobias Dammers for pointing this out.
2021-10-20 13:16:31 +01:00
Richard Harrison
148ba367ee Material animation include model directory
Include model directory in the texture path - to allows short paths relative to model root when set via a texture-prop
2021-10-18 11:40:25 +02:00
Richard Harrison
7ac90850d3 Fix axis object in translate animation
This will allow an object to be moved using a line (with 2d points).

Use the factor to switch direction (direction will depend on the order of definition of the end points of the vertex and) together with a (usually normalised property to define how much of the translation to apply).

<animation>
    <type>translate</type>
    <object-name>mm_radios-display</object-name>
    <property>/sim/model/f-14/radio-position-norm</property>
    <factor>-1</factor>
    <axis>
        <object-name>mm_radios-display-alt-position-axis</object-name>
    </axis>
</animation>
2021-10-18 11:40:25 +02:00
James Turner
bf1db210d7 SGMetar: avoid raw char pointers in the public API
Ideally would refactor to remove the raw pointers internally, but this
is a good first step.
2021-10-15 15:31:06 +01:00
James Turner
6fe7c307b2 SGmetar: catch bad temp/pressure data and throw
Also replace raw pointer with managed storage for the raw data, to
avoid manual clean-up on exception-throw paths.
2021-10-15 12:12:51 +01:00
Stuart Buchanan
119f3d9814 WS30: Remove VPB Max range and LoD scaling
Better to scale from the camera than mess with the LoD itself.
2021-10-12 21:40:09 +01:00
James Hogan
0c4c092b9f
Sky dome: Enable depth test but mask depth changes
On VR with visibility masking the depth buffer is first set to the
nearest possible value in parts of the frame that won't be visible
through the VR headset's lenses. This is meant to reduce GPU fragment
load.

The sky dome however is rendered with depth testing disabled which
bypasses the visibility masking. To allow invisible parts of the sky
dome to be culled, enable depth testing but set the depth mask to false
to prevent modification of the depth buffer.
2021-10-08 23:36:15 +01:00
Stuart Buchanan
a760730285 WS30: +50% fps by not loading tiles every loader
Previously the STG Loader had a class member keeping track
of each WS30 tile that had been loaded, to ensure the terrain
was only loaded once.

However, this was a class member on a loader, and we have multiple
OSG loading threads.  So the WS30 terrain was loaded ~6 times.

Change to a static, protected with a mutex so we only load the tile
once.

50% improvement in fps from the reduction in vertices, and an
improvement in loading.
2021-10-08 20:55:06 +01:00
b'Fernando Garc\xc3\xada Li\xc3\xb1\xc3\xa1n
f7e378a05a Merge /u/amalon/simgear/ branch vr_3 into next
https://sourceforge.net/p/flightgear/simgear/merge-requests/98/
2021-10-08 14:16:34 +00:00
Julian Smith
50170da13d simgear/scene/model: expose some animation info for use by Highlight system.
simgear/scene/model/animation.*: added TransformExpression() - returns SGExpressiond
if given a SGRotAnimTransform or SGTranslateTransform.

simgear/scene/model/SGTranslateTransform.hxx:SGTranslateTransform: added copy
of SGExpressiond for use by TransformExpression().
2021-10-05 22:54:52 +01:00
Stuart Buchanan
e7cca0c407 WS30 - Line feature texturing 2021-10-01 22:03:47 +01:00
Stuart Buchanan
0f946abc36 WS30: Correct texture coords for roads 2021-09-28 21:38:16 +01:00
James Hogan
1d0a99a077
Add LEFT & RIGHT nodemask bits
Add LEFT_BIT and RIGHT_BIT node masks, which are only shown on the left
or right viewports. These will be used for eye specific visibility masks
with VR.
2021-09-18 08:27:24 +01:00
James Hogan
d4496d3b2c
Compositor: Add resetOrderOffset()
To allow for custom compositors and passes created by C++ code alongside
those created by Compositor::create(), add a resetOrderOffset() function
which resets _order_offset back to zero. This will allow FlightGear to
prevent repeated compositor reloads from increasing _order_offset
indefinitely, which soon results in render orders beyond those set
statically for the GUI and upcoming VR mirror compositors.
2021-09-11 16:32:18 +01:00
Julian Smith
a68a0b1ccb simgear/props/props.cxx: fixed deadlock in SGPropertyNode::addChildren().
Was causing fatal "Resource deadlock avoided" error with crj700.
2021-09-05 15:55:37 +01:00
Fernando García Liñán
876e5534fd Fix precision issues on shadow mapping 2021-09-02 02:23:05 +02:00
Fernando García Liñán
0ee08cfa06 Compositor: fg_Viewport now contains the viewport properties of the specific pass it's being used on 2021-08-31 18:09:36 +02:00
Fernando García Liñán
da750c5995 Canvas: Set pointers to NULL instead of calling .release()
The Canvas camera and texture get recreated in several circumstances.
Calling .release() on a ref_ptr will just return the raw pointer and
'delete' won't be called. The proper way to explicitly delete an object
managed by a ref_ptr is to set the ref_ptr to NULL. This will delete it
as long as it's not referenced by any other ref_ptr.
2021-08-31 18:09:36 +02:00
Fernando García Liñán
2371065375 Canvas: Image depth refers to the amount of depth slices, not the bit depth 2021-08-31 18:09:36 +02:00
Stuart Buchanan
5c4bbc7552 WS30: Improved streetlights
- Use a single LightBin per tile, rather than per road
- Support lights offset on either side of the road.
2021-08-29 18:27:18 +01:00
Fernando García Liñán
a97e148a94 Canvas: Change the node mask of the ODGauge camera
Since the Canvas cameras are no longer in the scene graph, we no longer
need to explicitly make them render only in the Classic pipeline's far
camera.
2021-08-27 21:21:28 +02:00
James Turner
e76b684c20 Attempt to deal with the XML -> AC model rename
Add a fallback when a .xml model is not found, and see if we can load
a .ac instead. This logs a dev warning since dependant uses should
be updated.
2021-08-27 15:33:33 +01:00