Commit Graph

449 Commits (master)

Author SHA1 Message Date
unelsson 4676ac4ac9 Cleaner code part 2 2 years ago
unelsson 960019cf65 Cleaner code 2 years ago
unelsson 2efc691736 clang format 2 years ago
unelsson 7ef6b3cb62 automatic clang format 2 years ago
unelsson d8de56e33c Coding style improvements, add Torso animation layer 2 years ago
unelsson ffc64205c5 Force collada animation layers, remove nif blend mask detection. 2 years ago
fteppe 125b21de20 Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID

Slowly going through all the changes to make, still hundreds of errors

a lot of functions/structures use std::string or stringview to designate an ID. So it takes time

Continues slowly replacing ids. There are technically more and more compilation errors

I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type

Continue moving forward, changes to the stores

slowly moving along

Starting to see the fruit of those changes.

still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.

More replacements. Things are starting to get easier

I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.

Still moving forward, and for the first time error count is going down!

Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably

Cells are back to using string for the name, haven't fixed everything yet. Many other changes

Under the bar of 400 compilation errors.

more good progress <100 compile errors!

More progress

Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string

some more progress on other fronts

Mostly game settings clean

one error opened a lot of other errors. Down to 18, but more will prbably appear

only link errors left??

Fixed link errors

OpenMW compiles, and launches, with some issues, but still!
2 years ago
Alexei Kotov cdd6a8c007 Merge branch 'models_for_the_model_god' into 'master'
Implement TestModels/T3D

Closes #7058

See merge request OpenMW/openmw!2506
2 years ago
AnyOldName3 66b8d4fb29 Add a setting to control coverage adjustment
With it on, which was always the case before this setting was added,
vanilla content and poorly-made mods will look acceptable, but well-made
mods will have alpha-tested meshes appear to grow and potentially gain a
weird outline as they get further away.

With it off, which replicates the 0.46 behaviour, well-made mods will
look really good, but vanilla content and poorly-made mods will have
alpha-tested meshes shrink as they get further away.

It's been bugging me that this was forced on since 0.47 released, and
I'd hoped to figure out a solution for automatic detection at some point
before 0.48 branched off, but I didn't, so now this is what we're
getting to have Tamriel Rebuilt look right.
2 years ago
Evil Eye b94818b24a Tweak message and temporarily set model ttl to 0 2 years ago
elsid 843753da14
Remove unused includes 2 years ago
jvoisin 3cbf1dc042 First pass with include-what-you-use 2 years ago
elsid 4de8ea30c8
Report used memory by Lua interpreter 2 years ago
elsid c338c1e5d3
Add Nif::FileView as read only interface for Nif::NIFFile
To make sure interface is scoped to what users require.
2 years ago
elsid f2fb3d6de8
Separate NIFFileReader from NIFFile
NIFFile might not always be created from a file or stream containing NIF data.
Basically there are 2 different responsibilities for this class:
1. Read NIF file
2. Provide input for nifosg and bulletnifloader.

Remove no longer needed NIFFileMock since the state of NIFFfile can be
initialized independently from reading NIF file.
2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
elsid ac01fd5e75
Add missing non-prefixed reserved nodes 2 years ago
elsid 8068d0153f
Initialize reserved names once to avoid race condition
CanOptimizeCallback::isReservedName function may be executed by multiple threads
simultaneously. One of them creates a static but both of them run if statement
and see it's empty because none of them added elements there yet. Both of them
go to the branch where new elements are added doing it without any
synchronization possibly causing SIGSEGV.
2 years ago
elsid 409f83a149
Use raw string literal for error marker definition 2 years ago
Project579 a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
elsid e9be8b5efe
Show stats for writing and reading navmesh db queue jobs 2 years ago
elsid 948e2f5db9
Do not use collision shapes with visual only collision to generate navmesh
These collision shapes are not used for actors movement physics simulation.
2 years ago
elsid cc8c7002ea
Cleanup components includes 2 years ago
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2 years ago
elsid ba69146ced
Use std::string_view to avoid redundant std::string construction 2 years ago
elsid 0614b82452
Restore UnrefQueue to destruct animation asynchronously 2 years ago
Andrei Kortunov c36c28e8f9 Move NIF implementation to cpp files 2 years ago
Andrei Kortunov dc0d6fe31d Avoid code duplication 2 years ago
Andrei Kortunov facdc8fc0d Use string_view 2 years ago
Andrei Kortunov d83382d236 Rework Profiler to work with VFS 2 years ago
Andrei Kortunov 59c4ea014d Rework StatsHandler to support VFS 2 years ago
Andrei Kortunov 6f6b5ba04b Some refactoring 2 years ago
Andrei Kortunov dd04bfccfb Load fonts 2 years ago
Andrei Kortunov d3da09878d Drop line about non-existent UnrefQueue 3 years ago
glassmancody.info a0265ffb89 only enable soft particles when enabled in settings 3 years ago
glassmancody.info b09411d396 allow soft particles on meshes and add extra data extensions 3 years ago
psi29a feef257584 Merge branch 'postprocessor-stereo' into 'master'
[Postprocessing] Stereo integration

See merge request OpenMW/openmw!1988
3 years ago
Mads Buvik Sandvei b0e4c7e76a [Postprocessing] Stereo integration 3 years ago
Nelsson Huotari 334c6dde0b custom class for osgAnimation::RigGeometry, Collada animated deforming body parts 3 years ago
elsid 3affe9913f
Limit the number of simultaneously open not actively used content files
Use LRU cache for ESMReaders. When cache capacity is reached close least
recently used ESMReader. Remember the file name if a reader was open. Once the
reader requested again open the file if there is stored name for it. Put
released ESMReader to the back of the free items list. Close ESMReader's from
the front of the free items list.

Cached item can be used only by one client at the same time. If the same item is
requested twice exception is thrown. This should never happen in practice. If
this happens need to fix the client logic.

It's allowed to go over the capacity limit when requesting different readers.
Ideally this should never happen but there will be system error anyway
signalizing about too many open files. Need to fix client logic in this case.

All places that were using a vector of ESMReaders now using the cache. Cache is
local for each use case and there is no need for a thread safety.
3 years ago
Evil Eye a95b6e050a Replace new with make_unique in components 3 years ago
cody glassman ac6089a430 skip flipping of 3D textures which is unsupported in OSG 3 years ago
cody glassman 04843fed6d moddable post-processing pipeline 3 years ago
Evil Eye a64979e25d Replace empty std::string assignments 3 years ago
fredzio d05a2facf3 Handle NCC flag in Nif files. Objects with this flag will collide only with camera.
Expose objects with NC flag to be used by Lua mods.
3 years ago
elsid e7f3524924
Add a tool to load and print information about all bullet objects in all cells 3 years ago
Cody Glassman 9cafc31c0d Restore ripples with soft particles 3 years ago
jvoisin 1a6be08149 Fix "warning: loop variable is copied but only used as const reference;... 3 years ago
Petr Mikheev 7fe5351f55 Fix compilation error on windows: cannot convert from 'std::filesystem::path'... 3 years ago
Petr Mikheev b06248a31f Fix #6502 3 years ago
elsid 96eb8d7be9
Write generated navmesh to navmeshdb
Perform all request to db in a single thread to avoid blocking navmesh
generator threads due to slow write operations.

Write to db navmesh for all changes except update as it done for memory cache.

Batch multiple db operations into a single transaction to speed up writing by
not executing fsync after each insert/update query. All reads are performed in
the same transaction so they see uncommited data.
3 years ago
elsid a665a38aca
Use MurmurHash3_x64_128 for file hash 3 years ago
Cody Glassman d85f772269 Depth refactor 3 years ago
Cédric Mocquillon 40656b3135 Embed error marker in osgt format inside a string defined in misc/errorMarker.hpp.
Use the embed error marker we fail to load a mesh.
3 years ago
psi29a 41bd20e358 Merge branch 'bullet_shape_hash' into 'master'
Store BulletShape source file name and content hash

See merge request OpenMW/openmw!1379
3 years ago
elsid d7041613ef
Store BulletShape source file name and content hash 3 years ago
Alexei Dobrohotov 9880c43c86 Add specular strength shader parameter 3 years ago
psi29a 5836d0225f Merge branch 'leave_butter_to_soften' into 'master'
Soft Particles (#6128)

See merge request OpenMW/openmw!980
3 years ago
Bo Svensson 1960e976e2
refactors stringops.hpp (#3192)
With this PR we refactor `StringUtils::replaceAll` to accept `string_view` as suggested in a code comment. In addition, while we are touching this rebuild happy file, we slim it down a bit by moving a few sparingly used functions elsewhere.
3 years ago
glassmancody.info 8c3b00164e soft particles 3 years ago
elsid b731a981c4
Make BulletShape::isAnimated inlined 3 years ago
elsid c83facd9d3
Avoid redundant osg::ref_ptr<const BulletShape> copy 3 years ago
elsid ed5a4e195b
Use unique_ptr to avoid possible memory leak 3 years ago
elsid 8e71c246bf
Remove redundant BulletShape getters 3 years ago
elsid fc9a405dc5
Make BulletShape::makeInstance free function 3 years ago
elsid b905dd17c3
Use unique_ptr to store btCollisionShape in BulletShape 3 years ago
elsid 80e3623d9a
Avoid dynamic cast in duplicateCollisionShape 3 years ago
elsid ca8584f6f6
Move functions independent from BulletShape into anonymous namespace 3 years ago
elsid 29a772c33f
Rename Resource::BulletShape::CollisionBox fields according to styleguide 3 years ago
Bo Svensson c9c8d02332
fixes a crash (#3183)
This PR fixes a crash caused by the improperly ensured lifetime of RigGeometry::mSourceGeometry. mSourceGeometry was not adequate to ensure mSourceGeometry would outlive mGeometry because we extend mGeometrys lifetime beyond this lifetime by passing mGeometry to the draw traversal instead of this.
In addition,

We add important comments.
We detect and prevent generally unsafe operations in high level code.
We add a sprinkling of const to help clarify intentions.
3 years ago
Bo Svensson 617eec338a
removes version guard (#3173)
We currently use a version guard to adapt to a change in the number of parameters supplied to osg::TriangleFunctor's operator() template functor. The differing parameter is unused in our code. Crucially, operator() is not an override, so we can just add a default value for the differing parameter. Such a default allows us to apply identical code to both versions of the library without regressing functionality.
3 years ago
Bo Svensson 4b1c009ffd
use StateSet define for translucentFramebuffer (#3138)
With this PR we test out osg's shader define system for a somewhat harmless feature. As we can see, our code becomes more concise and efficient in this case. Most importantly, we no longer create unneeded vertex shader objects.
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 8358418555
set the correct program link parameters (#3110)
* shadermanager.hpp setProgramTemplate

* shadermanager.hpp

* shadermanager.cpp setProgramTemplate

* shadervisitor.hpp setProgramTemplate

* shadervisitor.cpp setProgramTemplate

* scenemanager.cpp setProgramTemplate

* scenemanager.hpp setProgramTemplate

* renderingmanager.cpp

* groundcover.cpp setProgramTemplate

* groundcover.hpp

* groundcover.cpp

* shadervisitor.cpp

* util.cpp

* lightmanager.cpp

* scenemanager.cpp

* scenemanager.hpp

* lightmanager.cpp

* lightmanager.cpp

* lightmanager.cpp

* scenemanager.hpp [ci skip]

* water.cpp

* groundcover.cpp

* shadermanager.hpp
3 years ago
Bo Svensson e41fe7573a
avoids creating empty statesets for collada nodes (#3128)
* avoids creating empty statesets for collada nodes

With this PR we avoid creating empty statesets for collada nodes which will be detrimental to osg's draw performance.

* scenemanager.cpp
3 years ago
Bo Svensson 5fde6867a2
removes unused code (#3129)
* scenemanager.cpp

* scenemanager.hpp

* scenemanager.cpp

* stats.cpp

* renderingmanager.cpp
3 years ago
Bo Svensson c6f7137ee1
fixes bugs with share state (#3111)
* optimizer.cpp merge fix

* objectpaging.cpp

* optimizer.hpp setSharedStateManager

* optimizer.cpp shareState

* scenemanager.cpp shareState

* scenemanager.cpp

* optimizer.cpp

* optimizer.cpp

* scenemanager.cpp

* optimizer.cpp
3 years ago
unelsson 67894349a9 Add a check for OPAQUE_BIN 3 years ago
unelsson f2a894024a Change debug levels 3 years ago
unelsson ec0b36d21d Don't make a new osg::depth to alpha tested node 3 years ago
unelsson 96f02ab32c Per-material alpha testing for collada 3 years ago
unelsson 40497d6fe5 Set depth testing for alpha blend & test, depth writes off for blend. 3 years ago
unelsson b3d1d106af Collada alpha testing and uniforms 3 years ago
Bo Svensson f62adab43a
Avoid the terrain sync completely in most cases (#3103)
We can take elsid's commit 605cb8d further by avoiding the terrain sync completely in most cases. Currently in changeCellGrid we wait for a new preloading task to ensure the getPagedRefnums for the new active cells have been filled in by object paging. This is usually not necessary because we have already completed a preload in the past containing these active cells. With this PR we remember what we preloaded and skip the terrain sync if it is not needed.
3 years ago
Cédric Mocquillon 6817282097 Move getFileExtension to common header and use instead of repeating same code 3 years ago
Cédric Mocquillon c2df0949e2 Change normalizeFilename signature 3 years ago
jvoisin cb08f490d7 Sprinkle some const-ref in loop
This was done on the good advices of clang-tidy
3 years ago
jvoisin deb2af6acc Dont copy-construct from a const-ref when used only as a const-ref
This also makes clang-tiny a bit happier
3 years ago
elsid 0f11acf709
Report more stats from AsyncNavMeshUpdater 3 years ago
jvoisin 5793f5cf18 Sprinkle a couple of std::move and a const 3 years ago
jvoisin b01ef2629c Fix two Wreorder clang warnings 3 years ago
jvoisin 586d8684d0 Fix two coverity issues about uninitialised variables 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
elsid c8987bda2f
Store reference to BulletShapeInstance for btCollisionShape
To keep btCollisionShape lifetime.
3 years ago
fredzio c76387162b Add projectiles number to the resources stats 3 years ago
Evil Eye 4f264af5a9 Merge branch 'staticsload' into 'master'
Loads statics before actors II (#5379)

See merge request OpenMW/openmw!588
4 years ago
fredzio c795e0bce6 Some actors are supposed to spawn on an object that belongs to an adjacent cell.
Since actors can be active in 3x3 grid around the player, we need to
first load all objects in a 5x5 grid around the player.

Split load and unloading in 2 phases. Add an mInactiveCells set into the
scene, which contains all cells inside the aforementioned 5x5 grid.
These cells contains only heightfields and non-animated physics objects.

Animated objects are tied to the scene graph, which doesn't exists yet
in these cells, so we skip them.
4 years ago
Evil Eye 9f7980ecd7 Merge branch 'refenreces' into 'master'
Sprinkle some references where it makes sense

See merge request OpenMW/openmw!952
4 years ago
jvoisin cf11870b1c Sprinkle some references where it makes sense 4 years ago
jvoisin 33e035cc95 Fix two excessive type casting instances
No need to to a string -> char* -> string dance.
4 years ago
CedricMocquillon d11a6bd92c Share state 4 years ago
psi29a d843ec321e Merge branch 'DoNotSearchTwice' into 'master'
Search only in the niffilemanager for nif files

See merge request OpenMW/openmw!823
4 years ago
Thunderforge 339d347aea Fixing performance-faster-string-find issues
This addresses the Clang Tidy check [performance-faster-string-find](https://clang.llvm.org/extra/clang-tidy/checks/performance-faster-string-find.html).
4 years ago
CedricMocquillon a885134868 Do not search if it is not used 4 years ago
CedricMocquillon 813b8ee0d1 Search only in the niffilemanager for nif files 4 years ago
Andrei Kortunov 9647b670e4 Do not declare unused variables 4 years ago
glassmancody.info 16856d45c5 Lighting Patch
Fixes build errors with older OSG builds and some issues with 'shared' layout.
Bring back ambient in inventory through lightmodel instead of sun ambient, mirrors scene ambient/sunlight relationship.
Forces shaders when certain lighting methods are enabled and finalize settings.
Correctly override sun for localmap.
4 years ago
glassmancody.info 582f7b52cf Merge remote-tracking branch 'upstream/master' into why_are_the_christmas_lights_still_up 4 years ago
glassmancody.info 7370acdf54 Merge remote-tracking branch 'upstream/master' into why_are_the_christmas_lights_still_up 4 years ago
glassmancody.info 43ac32921c Rewrite, support different lighting methods 4 years ago
glassmancody.info 9d9074c244 Add shared UBO 4 years ago
glassmancody.info dda735c54a initial commit 4 years ago
Andrei Kortunov 124a33d8a3 Fix uninitialized variables 4 years ago
Alexei Dobrohotov 2fdbe9b3f6 Handle BSShader[PP/No]LightingProperty 4 years ago
psi29a cc6f08930b Merge branch 'alpha-meddling' into 'master'
Replace deprecated alpha test in shader visitor

Closes #4899

See merge request OpenMW/openmw!473
4 years ago
AnyOldName3 9be258d260 Make it possible to reinstate FFP state easily 4 years ago
psi29a 59e09cba5b Merge branch 'boltsize' into 'master'
Use projectile mesh size (#5829)

See merge request OpenMW/openmw!587
4 years ago
elsid 561628087c Merge branch 'profiler_fix' into 'master'
Fix profiler glitches (#5850)

See merge request OpenMW/openmw!605
4 years ago
AnyOldName3 4f510d85ba Merge remote-tracking branch 'upstream/master' into alpha-meddling 4 years ago
fredzio c4e909c29e Silence a clang warning:
warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
4 years ago
fredzio bc4047d815 Update engine stats for all levels above first, not only at the second. 4 years ago
psi29a c33b2e0100 Merge branch 'dehardcodebaseanim' into 'master'
Dehardcode Base_animation and improve Collada support

See merge request OpenMW/openmw!510
4 years ago
fredzio 6e969ca3fa Use mesh collision box instead of node bounding sphere for projectile
size. The bounding sphere is much bigger than the mesh.
4 years ago
Alexei Dobrohotov ab28847eaf Merge branch 'collisionextentsandcenter' into 'master'
Get collision box extents and center from btBvhTriangleMeshShape

See merge request OpenMW/openmw!579
4 years ago
unelsson 303f1912a6 less debug spam 4 years ago
unelsson d5844b0982 Use accompanying txt file for textkeys in osgAnimation formats 4 years ago
elsid 88ca4a1db6
Count navmesh cache hit rate 4 years ago
Nelsson Huotari 45fde84f4f Use nodemasks and visitors for detecting custom collision shapes 4 years ago
Nelsson Huotari 5c32460153 Add underscore-separated node-names to reserved-list 4 years ago
Nelsson Huotari 384112746c Add option for custom collision node with non-nif files 4 years ago
Nelsson Huotari 6c0c28c2eb Get collision box extents and center from btBvhTriangleMeshShape 4 years ago
Nelsson Huotari 5b88d16a50 Clean-up 4 years ago
Nelsson Huotari 2162b97fef Handle case in osgAnimation bone names 4 years ago
Nelsson Huotari f87c45c92a Get collision box extents and center from btBvhTriangleMeshShape 4 years ago
Nelsson Huotari 3194520dcd Move base_anim settings to settings-default.cfg 4 years ago
Bret Curtis b164f1aa17
Merge pull request #3023 from akortunov/grass_intsancing
Grass instancing
4 years ago
Frederic Chardon 7cd7fa2f08 Collect all available stats if OPENMW_OSG_STATS_FILE is set and point to
a valid file.
4 years ago
Andrei Kortunov 24e1dfcddc Use default argument 4 years ago
Andrei Kortunov 14cf0ce1dc Implement instanced groundcover 4 years ago
AnyOldName3 b6e92c9c6d Use ShaderVisitor to skip translucent framebuffer specific stuff 4 years ago
Andrei Kortunov f175beb304 Define template ref classes in components 4 years ago
AnyOldName3 8f4b856b44 Initial A2C implementation 4 years ago
Nelsson Huotari 8b2bf12e8f Use bip01 for root bone name 4 years ago
Nelsson Huotari 3195716a2c Don't force loop textkey 4 years ago
Nelsson Huotari 256aa5e71d Use const auto& 4 years ago
Alexei Dobrohotov 15291f15d3 Make actor collision box components a struct 4 years ago
Andrei Kortunov 8084a336b5 Replace zeroes and nulls by nullptrs 4 years ago