Commit Graph

45 Commits (fee639a74fe237067950a9e30459c968c6fbade3)

Author SHA1 Message Date
glassmancody.info 750514cda2 simply lightmanager and fix racey behavior 3 years ago
Bo Svensson 1979ee1491
refactors hashed std::map (#3199)
We currently apply a strange algorithm to `LightManager::mStateSetCache`. For some reason this algorithm inserts hashed keys into `std::map` in a way that fails to handle hash collisions and exhibits worse lookup complexity than `std::unordered_map`. With this PR we just use `std::unordered_map` here.
3 years ago
Bo Svensson cd4d76f8c5
discard off-screen lights (#3120)
Currently, we run culling tests against all lights in the scene during LightListCallback::pushLightState. We can avoid most of these tests by removing off-screen lights at an earlier stage. We should benchmark the cumulative time spent within LightListCallback::pushLightState before and after this PR.
3 years ago
Bo Svensson aaf7b423d6
adds a replacement for osg::NodeCallback (#3144)
* nodecallback.hpp

* lightmanager.hpp

* lightmanager.cpp

* lightmanager.hpp

* nodecallback.hpp

* nodecallback.hpp

* [ci skip]

* lightmanager.hpp

* nodecallback.hpp

* nodecallback.hpp

* lightmanager.cpp

* lightmanager.cpp

* nodecallback.hpp

* [ci skip]

* [ci skip]

* controller.cpp

* [ci skip]

* osgacontroller.cpp

* keyframe.hpp

* controller.hpp

* keyframe.hpp

* [ci skip]

* keyframe.hpp

* animation.hpp

* [ci skip]

* weaponanimation.cpp

* nodecallback.hpp
3 years ago
Andrei Kortunov 11c57978b6 Fix crashes on exit in the LightManager (bug #6044) 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 9e80091aff clear up force shaders and make it less convoluted 4 years ago
glassmancody.info 8ce65232ff fix race condition with sun uniform 4 years ago
glassmancody.info eecb9886a9 Shader cleanup, fix indicies 4 years ago
glassmancody.info 4ba473b684 Finalize settings, torch fix 4 years ago
glassmancody.info 71c30a31df in-game settings, some require restart 4 years ago
glassmancody.info 690995988b More formatting, OpenCS cells are unbroken 4 years ago
glassmancody.info 05a5cee132 Brighter point lights and light fade 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 8ca3c3b123 Mark overrided methods by override keyword 4 years ago
bzzt 1a65adacdd Do not allocate dummy LightStateAttribute's for every stateset 6 years ago
Andrei Kortunov e06f0b797a Replace all NULLs to nullptr 6 years ago
scrawl b78a9f89af Refactor LightListCallback to allow for integration in custom Drawables. 8 years ago
scrawl 67e4a7e37b Change some osg::clone's to direct copy constructor to avoid dynamic_cast overhead 8 years ago
scrawl 34deb6e7b1 Add 'showSceneGraph' command to export the scene or a particular object to .osgt for debugging purposes 8 years ago
MiroslavR 11565b5966 Make actors with non-portable lights in inventory glow (Closes #2042, #3338) 8 years ago
scrawl aec8c38461 Move observer_ptr include where it belongs 9 years ago
scrawl 438b30d6f0 Move configureLight to a separate file 9 years ago
scrawl e39f49a88f OSG extensions namespace fixes 9 years ago
scrawl c442af09c5 Write more documentation for the lighting system 9 years ago
scrawl 8e9571d155 Double buffer the light StateAttributes and StateSets
Fixes a race condition where the position of a light could jump a frame ahead.
9 years ago
scrawl 1b77428c59 Use const reference, thanks ace13 9 years ago
scrawl fc7456e0a1 Explicitely opt for float matrices in performance critical places 9 years ago
scrawl 35459f20d5 Refactor lighting mask 9 years ago
scrawl bd8332d2b0 Remove default copyop argument for nodecallback copy constructors
Works around a compiler warning with OSG 3.4:

warning: base class 'class osg::Callback' should be explicitly initialized in the copy constructor [-Wextra]

With no default argument for osg::CopyOp&, the compiler no longer sees the function as a real copy constructor and stops warning about the missing virtual initializations.

We don't care about this warning because there is nothing interesting to initialize in the osg::NodeCallback base anyway.

A proper fix for the warning would require to inserting OSG_VERSION conditional compiling all over the place, that is as long as we are still supporting OSG 3.2.
9 years ago
scrawl 0210b87ffc Revert "Fix LightSource crash"
This reverts commit f336c6db87.

Root cause should be fixed in next commit.
9 years ago
scrawl c996702b56 Fix some uninitialised variables found by static analysis 9 years ago
scrawl c23609e22b Cache the light list in LightListCallback
When multiple cameras are rendering, the later cameras can reuse the light lists from the first camera.
9 years ago
scrawl f336c6db87 Fix LightSource crash 9 years ago
scrawl 49df6b7450 LightManager: fix incorrect view matrix for RELATIVE_RF cameras 9 years ago
scrawl 8552a9d82c Add multiple camera support to LightManager 9 years ago
scrawl 18f4eaa8dc Preliminary handling for overflowing light lists 10 years ago
scrawl 1d198a5592 Keep the light list StateSet cache for more than one frame 10 years ago
scrawl 5a7f2a4f1f Restore light attenuation settings 10 years ago
scrawl 3dcb167066 Map rendering 10 years ago
scrawl 61aaf0cf70 Attach light lists to the object base nodes instead of each renderable
Apparently that is how Ogre worked (on the SceneNode) so let's roll with it for now. Have not tested yet what MW does.
10 years ago
scrawl c92592493e OpenMW: create a window and render the starting cell(s) 10 years ago
scrawl 591a35b8d7 *very* early version of the LightManager 10 years ago