Commit Graph

5994 Commits

Author SHA1 Message Date
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
Julian Smith
629b681a29 simgear/nasal/code.c:setupFuncall(): improve diagnostic if not callable.
If we have an uncallable object error, also show the type and value of the
uncallable object.

To make this work, have upgraded simgear/nasal/lib.c:dosprintf() to be globally
available. Could perhaps rename it and declare in a different header. But it's
C so we don't want to make it part of simgear's general utility functions.
2021-08-26 23:24:39 +01:00
Julian Smith
624581f470 simgear/nasal/code.c:logError(): simplified the code. 2021-08-26 23:24:39 +01:00
Julian Smith
d4701c309b simgear/nasal/code.c: naRuntimeError(): added disabled code to show info. 2021-08-26 23:24:39 +01:00
Fernando García Liñán
2c82cd4475 glTF: Remove separate occlusion texture 2021-08-27 00:06:47 +02:00
Julian Smith
d7dd7e2c6e 3rdparty/tiny_gltf/tiny_gltf.h: fix for OpenBSD - no wordexp.h. 2021-08-25 23:10:03 +01:00
Fernando García Liñán
6d891eae7e Compositor: Add missing #define for buffer format 2021-08-23 22:29:24 +02:00
Fernando García Liñán
81fb4e7dfd Compositor: Add extra buffer formats
These formats are not defined by OSG, so we manually define them. Some GPUs might not support them as we are using a GL compatibility context, but it shouldn't matter for now as they are only being used by the HDR pipeline.
2021-08-23 12:45:55 +02:00
Stuart Buchanan
fafa259c1d WS30: Lighting for roads
Using attributes on the LINE_FEATURE_LIST we now generate
lighting for roads.
2021-08-21 17:18:18 +01:00
Erik Hofman
1174124144 Michael Danilov: Fix issue #2169 Sound with condition=false will play when moving into its max-dist (patch available) 2021-08-20 11:47:03 +02:00
Stuart Buchanan
e7659941ef WS30: Better landclass cache for tree generation 2021-08-19 19:57:09 +01:00