Commit Graph

348 Commits (84f8a6848a8b05502d7618ca7af8cca74f2c3bae)

Author SHA1 Message Date
elsid cc8c7002ea
Cleanup components includes 2 years ago
Andrei Kortunov de58c9dff3 Get rid of obsolete osg::Geode where it is possible 2 years ago
ζeh Matt c5d85c1854
Revert removal of <atomic> 2 years ago
ζeh Matt ddf43ec42f
Move structs into separate headers, cleanup includes, cleanup forwarders 2 years ago
elsid bef15edf0b
Remove redundant ostream, istream, iostream and sstream includes
* Replace by std::to_string and operator+ where possible.
* Move the code requiring to include <sstream> from .hpp to .cpp files.
3 years ago
Evil Eye a95b6e050a Replace new with make_unique in components 3 years ago
cody glassman 04843fed6d moddable post-processing pipeline 3 years ago
madsbuvi dd5901d351 Initial commit
Multiview shaders.

Refactor Frustum management

Rewrite shared shadow map

cull mask should respect stereo

Stereo savegame screencap

LocalMap refactoring

use the vertex buffer hint instead of the display list patch to enable/disable display lists

Character preview fixes
3 years ago
Bret Curtis 74e7cfc023 remove unused includes: part1
remove unused imports: part2

revert one tidy we will keep for c++20
3 years ago
Bret Curtis a126e29a19 relative to absolute path 3 years ago
Bret Curtis d1fb854521 move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo

esm typo
3 years ago
glassmancody.info 2c52695361 fix regression where LEQUAL was used instead of LESS for depth function 3 years ago
Cody Glassman d85f772269 Depth refactor 3 years ago
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.
3 years ago
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.
3 years ago
Bo Svensson 41318a585f
fixes enable and disable commands (#3186)
This PR fixes a recent regression concerning enable and disable commands with object paging. In addition, we add a necessary comment to avoid such issues in the future.
3 years ago
Bo Svensson a854a6e04a
removes UnrefQueue (#3181)
Currently, we use an `UnrefQueue` which supposedly aims to transfer destruction costs to another thread. The implications of this unusual pattern can not be well understood because some allocators might free resources more efficiently if they are freed by the same thread that allocated them. In addition, `UnrefQueue` complicates the validation of thread safety in our engine. Lastly, our current usage of `UnrefQueue` triggers `ref()`, `unref()` atomic operations as objects are passed into the queue. These operations could be more expensive than the actual destruction.

With this PR we thus remove `UnrefQueue`. We can expect these changes to have a minor impact at most because we free most resources elsewhere in `ResourceSystem::updateCache`.
3 years ago
Bo Svensson 01605433cb
quadtreeworld.cpp (#3174)
Currently, we disable a paging root node that we only need in exterior cells by setting its node mask to 0 when transitioning into an interior cell. Node masks are not ideal for this usage case because Node::getBound is unaware of masks. With this PR we just detach the unused node from the scene graph. _shadowedScene->getBound() in the MWShadowTechnique should return a much better value in interior cells with these changes.
3 years ago
Bo Svensson 98f8295765
allows to skip ComputeLightSpaceBounds traversal (#3152)
Currently, we always traverse the scene graph an additional time with a ComputeLightSpaceBounds visitor during shadow casting. ComputeLightSpaceBounds is only useful when the shadow casting mask allows us to shrink the bounds of the rendered scene, so we guard its traversal with a check against getCastsShadowTraversalMask. In practice, this guard never works because we build the traversal mask inclusively.

With this PR we limit the getCastsShadowTraversalMask check to relevant masks. This new check allows us to skip a superfluous ComputeLightSpaceBounds traversal with most settings.
3 years ago
Bo Svensson b2af81bc18
converts remaining osg::NodeCallback (#3147)
With this PR we convert remaining instantiations of the deprecated osg::NodeCallback in Open MW to SceneUtil::NodeCallback.
3 years ago
Bo Svensson 3f731cd102
attempts to fix spellcasting freezes (#3146)
Firstly, this PR reintroduces commit "Recreate a special case for IntersectionVisitor on QuadTreeWorld" we forgot to reapply while reverting a revert commit. Secondly, in cases we still need to build a view for an intersection visitor, we now use the available `osgUtil::IntersectionVisitor::getReferenceEyePoint` instead of falling back to the origin position that was previously causing long rebuild times.
3 years ago
Bret Curtis b7c1d9edb0 remove unnecessary includes 3 years ago
Bo Svensson d8707a763f
fixes build (#3134)
* quadtreeworld.cpp

* renderingmanager.cpp [ci skip]

* quadtreeworld.hpp

* cellborder.hpp

* cellborder.cpp
3 years ago
Bret Curtis 803195a05f add back some explicit includes 3 years ago
Bret Curtis 9fabf99250 remove mDebugChunks from chunkManager 3 years ago
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
3 years ago
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
3 years ago
Bo Svensson d38c8c6dcb
optimise chunk drawing order (#3116)
* material.cpp

* material.cpp
3 years ago
Bo Svensson 095f4b2ed5
material.cpp (#3117) 3 years ago
Cédric Mocquillon d7352ded36 Add configurable color and offset 3 years ago
Cédric Mocquillon 4b7d0bba53 Avoid adding redundant osg;;Group in non debug mode 3 years ago
Cédric Mocquillon 98a0819d52 Debug terrain chunks 3 years ago
Bo Svensson ac72f3d636
reduces virtual function calls in a hotspot of cache retrieval (#3100)
* chunkmanager.cpp static_cast [ci skip]

* groundcover.cpp static_cast [ci skip]

* Update objectpaging.cpp

objectpaging.cpp static_cast [ci skip]
3 years ago
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]
3 years ago
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.
3 years ago
jvoisin cb08f490d7 Sprinkle some const-ref in loop
This was done on the good advices of clang-tidy
3 years ago
Bret Curtis 436c640da2 the old switch-a-roo because we shoudl only StopTraversal when the node size is larger than 1 and not the other way around 3 years ago
glassmancody.info 09e03fde2e refactor and fix wobbly shores 3 years ago
glassmancody.info cad0b151cb enable shaders path and dehardcode depth formats 3 years ago
glassmancody.info 70fac33940 initial reverse-z depth implementation 3 years ago
Andrei Kortunov 54c8375672 Recreate a special case for IntersectionVisitor on QuadTreeWorld 4 years ago
Andrei Kortunov 3e281f625d Return check for distance when we try to reuse data (bug #6026) 4 years ago
psi29a e94181b2b2 Merge branch 'constexpr' into 'master'
Sprinkle a couple of constexpr found by VS

See merge request OpenMW/openmw!800

(cherry picked from commit 5e8ea624bc85acebf457592dd10b790124ecf6ef)

5704b2ac Sprinkle a couple of constexpr found by VS
4 years ago
Andrei Kortunov 2d869ca9ff Fix node masks signed/unsigned mismatch 4 years ago
Andrei Kortunov 14cf0ce1dc Implement instanced groundcover 4 years ago
AnyOldName3 eb80c997b8 Avoid OSG setting array binding from multiple threads 4 years ago
Andrei Kortunov 8e5f26c109 Code cleanup 4 years ago
Andrei Kortunov 8084a336b5 Replace zeroes and nulls by nullptrs 4 years ago
Alexei Dobrohotov 53f91a3aa5
Merge pull request #3018 from akortunov/emplace
Use emplace_back instead of push_back
4 years ago
Andrei Kortunov 065ed5138e Use emplace_back instead of push_back 4 years ago