Commit Graph

52 Commits

Author SHA1 Message Date
fteppe 22dc383f63 fixes errors and warnings
Applies review comments

getWorldspaceTerrain => returns a reference because never null
crashfix in navigator
updateLandPositions fixes naming of it
const ESM4::Land* MWWorld::Store<ESM4::Land>::search(ESM::ExteriorCellLocation cellLocation) const removes useless else
ExteriorCellLocation uses default initializers
get terrain height returns -MAX_FLOAT when there is no esm4 terrain.

applied review comments

use default initlializer when possible
factorise code
uses pattern matching in for loop.
2023-05-29 12:10:42 +02:00
florent.teppe 1b718f09c5 adding worldspace info to terrain data structures
Rendering manager can have multiple terrain, one for each queried worldspace
Terrain::World has a worldspace member
storage functions require a worldspace parameter.
2023-05-29 11:31:37 +02:00
florent.teppe 93e7b0d946 Terrain has a mandatory worldspace in constructor
getTerrainHeightAt takes a worldspace.

Doesn't change anything for now => Therrain is created with the default ESM3 worldspace, and is never changed.
2023-05-29 11:31:36 +02:00
clang-format-bot ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
ζeh Matt c5d85c1854
Revert removal of <atomic> 2022-07-18 19:40:26 +03:00
ζeh Matt ddf43ec42f
Move structs into separate headers, cleanup includes, cleanup forwarders 2022-07-18 19:15:03 +03:00
Bo Svensson 5f1bf89369
improves groundcover view distance (#3219)
This PR aims to solve all issues with `Groundcover` view distance handling in a satisfying way while preserving other optimisations that benefit other features. The main idea here is not to rely on `ViewData` updates for distance culling calculations because we can not accurately determine distance against lazily updated views. Instead, we perform an accurate measurement in a cull callback we can run every frame in `Groundcover` itself. While we do have to add some code to handle this feature, it is quite loosely coupled code that could be useful elsewhere in the future. These changes should address a performance regression @akortunov experienced.
2021-11-08 10:27:42 +01:00
Bo Svensson d88d006984
fixes getViewDistance (#3207)
I have been informed by @akortunov that my addition of `Groundcover::getViewDistance` is not working in some cases. Investigations revealed that some `ViewData` code interacting with my additions had been quite thoroughly optimised in a way that was not sufficiently documented and interfered with the new feature. With this PR we repair `getViewDistance` while preserving such optimisations and add a necessary comment to avoid issues in the future. In addition, we now rebuild views when the global `mViewDistance` changes.
2021-10-31 12:59:34 +01:00
Bo Svensson d8707a763f
fixes build (#3134)
* quadtreeworld.cpp

* renderingmanager.cpp [ci skip]

* quadtreeworld.hpp

* cellborder.hpp

* cellborder.cpp
2021-09-29 17:10:58 +02:00
Bo Svensson 01cc61087b
improves paging preloader (#3126)
* Return check for distance when we try to reuse data

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* cellpreloader.cpp

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* [ci skip]

* quadtreeworld.cpp

* chunkmanager.cpp

* chunkmanager.cpp

* cellpreloader.cpp

* jvoisin

* whitespace

* whitespace
2021-09-27 21:32:18 +02:00
Bo Svensson 3f68ddd8f4
alternate debug chunks (#3127)
* quadtreeworld.cpp

* chunkmanager.cpp

* chunkmanager.hpp

* quadtreeworld.hpp

* chunkmanager.cpp

* quadtreeworld.cpp

* quadtreeworld.cpp

* quadtreeworld.cpp [ci skip]

* quadtreeworld.hpp

* quadtreeworld.cpp

* quadtreeworld.cpp

* quadtreeworld.cpp

* chunkmanager.cpp

* chunkmanager.cpp
2021-09-27 21:25:39 +02:00
Cédric Mocquillon 4b7d0bba53 Avoid adding redundant osg;;Group in non debug mode 2021-09-11 21:53:04 +02:00
Bo Svensson 9d661359a1
Groundcover consolidation (#3096)
* chunkmanager.hpp viewdistance

* chunkmanager.cpp viewdistance

* chunkmanager.hpp viewdistance

* quadtreeworld.cpp viewdistance

* quadtreeworld.cpp consolidate

* quadtreeworld.hpp consolidate

* renderingmanager.cpp groundcover consolidate

* renderingmanager.hpp groundcover consolidate

* renderingmanager.cpp updater move

* renderingmanager.hpp updater move

* groundcover.hpp activegrid consolidation

* groundcover.cpp activegrid consolidation

* settings-default.cfg dead settings remove

* viewdata.cpp revert

* wrong file paste mistake

* wrong file paste mistake

* wrong file paste mistake

* renderingmanager.cpp updatecallback fix

* renderingmanager.cpp namespace fix

* groundcover.hpp redefinition fix

* groundcover.cpp redefinition fix

* renderingmanager.cpp crash fix

* renderingmanager.cpp euclidean groundcover distance

* viewdata.hpp getreusedistance

* quadtreeworld.cpp reusedistance

* groundcover.rst [ci skip]
2021-09-09 23:10:22 +02:00
elsid 605cb8db7c
Make sync terrain preloading sleep free
This reduces average time spent on in. 5 milliseconds as a base precision is
quite a lot considering that for 60 FPS frame time is 1000/16 = ~16.67 ms
when it's a cell loading frame and there is more important work to do rather
than sleeping.
2021-09-07 14:52:42 +02:00
Andrei Kortunov 2d869ca9ff Fix node masks signed/unsigned mismatch 2021-04-20 10:52:51 +04:00
Andrei Kortunov 14cf0ce1dc Implement instanced groundcover 2021-01-26 22:29:41 +04:00
elsid 40ad87bc4d
Replace OpenThreads by std types 2020-06-25 22:16:09 +02:00
Andrei Kortunov 805d826d5b Fix Clang warnings about invalid overrides 2020-06-16 16:59:37 +04:00
bzzt lost a hitlab login c7fda6d280 activegrid paging = 2xfps
Signed-off-by: Bret Curtis <psi29a@gmail.com>
2020-06-13 00:22:28 +02:00
bzzt lost a hitlab login b4af2ac672 avoid blocking on pagerebuild
Signed-off-by: Bret Curtis <psi29a@gmail.com>
2020-06-13 00:22:28 +02:00
bzzt lost a hitlab login 17637c6575 pagerebuild on disable
Signed-off-by: Bret Curtis <psi29a@gmail.com>
2020-06-13 00:22:28 +02:00
bzzt lost a hitlab login ffbed7ee38 loadingscreen
Signed-off-by: Bret Curtis <psi29a@gmail.com>
2020-06-13 00:22:28 +02:00
bzzt lost a hitlab login b7b31926a8 fix map glitch + cleanup
Signed-off-by: Bret Curtis <psi29a@gmail.com>
2020-06-13 00:22:28 +02:00
bzzt lost a hitlab login ce505a9bb3 crashfix + optimiziation
Signed-off-by: Bret Curtis <psi29a@gmail.com>
2020-06-13 00:22:27 +02:00
bzzt d684f1a78f terrainbased objectpaging
Signed-off-by: Bret Curtis <psi29a@gmail.com>
2020-06-13 00:22:27 +02:00
Bret Curtis 8a8107e837 as it says; revert vismask and uncomplicate openmw 2020-04-20 20:57:38 +02:00
Andrei Kortunov 84979fa8b7 Move VisMask to components 2020-02-16 16:03:35 +04:00
bzzt e4ba6ecf15 Do not store a LOD callback in the every QuadTreeNode 2019-06-05 18:27:37 +04:00
bzzt 391f6faffb Remove unused defaultViewer / defaultViewPoint 2019-04-07 11:21:09 +04:00
Andrei Kortunov 489e5c6cce Store preloaded terrain view in the main thread 2019-04-07 11:15:21 +04:00
bzzt 63ab7345be Reuse traversal result for different traversal with same view point
Rename eyePoint to viewPoint to match OSG conventions (eyePoint is the camera position, viewPoint is for LOD handling)
2019-04-07 11:14:37 +04:00
Bret Curtis b819690e82
Merge pull request #2264 from akortunov/optimize_terrain
Delete composite map layers in the background thread
2019-03-18 13:52:17 +01:00
bzzt aa5a071aef Delete composite map layers in the background thread 2019-03-18 14:00:50 +04:00
Bret Curtis d56733149c
Merge pull request #2201 from akortunov/optimize_terrain
Optimize terrain
2019-03-18 08:59:10 +01:00
Andrei Kortunov 12f9184d00 Allow to interrupt terrain preloading 2019-03-09 13:15:23 +04:00
bzzt e0cf460ba3 Do not load terrain beyond the viewing distance 2019-03-08 22:15:27 +04:00
Andrei Kortunov a6fd077537 Render nearby default cells if the Distant Terrain is disabled 2019-03-08 22:15:27 +04:00
Andrei Kortunov 56fea4b062 Add setting to control composite geometry size 2019-03-01 18:02:40 +04:00
bzzt 9d44e18af6 Allow to configure terrain vertex LOD 2019-03-01 18:02:38 +04:00
bzzt fd94d7f7ff Make Distant Terrain more configurable (feature #4890) 2019-03-01 14:51:13 +04:00
Miloslav Číž db8aaa74d6 Start cell border debug drawing 2018-06-13 01:48:31 +02:00
scrawl ac78d01b2b Terrain: use the main camera's viewpoint for intersection tests
Fixes lag spikes caused by intersection tests loading/unloading terrain pages.
2017-07-19 13:11:44 +02:00
scrawl 7f5beb3172 Remove unused includes 2017-03-14 19:27:56 +01:00
scrawl 7d50b6c2e2 Add QuadTreeWorld::cacheCell to preload cells at max LOD for local maps 2017-03-14 19:27:56 +01:00
scrawl 3c29e2dbeb Refactor ownership of terrain views 2017-03-14 19:27:56 +01:00
scrawl e7a0878c10 Add CompositeMapRenderer info to the stats panel 2017-03-14 19:27:56 +01:00
scrawl 4baa795152 Add preloading implementation to QuadTreeWorld 2017-03-14 19:27:56 +01:00
scrawl 1c15686353 Remove non required use of WorkQueue 2017-03-14 19:27:56 +01:00
scrawl 433900fca5 Fix waiting on initial quad tree build 2017-03-14 19:27:56 +01:00
scrawl 4dbd224249 Hide the terrain in non-exterior cells 2017-03-14 19:27:56 +01:00