Commit Graph

42 Commits (66a6b80df92f88a3b506c3cc0f4044734f8f380b)

Author SHA1 Message Date
Bo Svensson 5242e2695c
avoids memory allocations within ComputeLightSpaceBounds (#3156)
Currently, we create a new ComputeLightSpaceBounds visitor per frame. Within this visitor, we require excessive memory allocations, mainly a new osg::RefMatrix per encountered Transform node.

With this PR we reuse a single ComputeLightSpaceBounds visitor across frames and enable the createOrReuseMatrix functionality to avoid allocating new matrices every frame. osgUtil::CullVisitor internally uses the same approach.
3 years ago
AnyOldName3 4f510d85ba Merge remote-tracking branch 'upstream/master' into alpha-meddling 4 years ago
AnyOldName3 3e273a759a Clarify method name now we're using it differently 4 years ago
AnyOldName3 05ad44d0b1 Set correct array size 4 years ago
AnyOldName3 ce2bcba5d4 Replace deprecated alpha test in shader visitor 4 years ago
AnyOldName3 7768556ce6 Set dummy state when disabling shadows indoors
As we don't reconfigure all shaders without shadows when we disable them
indoors (as it'd probably add a hitch to transitioning in and out) we
need to set up dummy state so the shaders don't do anything illegal.

This hadn't had symptoms for most objects as when indoors, nearly
everything would be drawn first in one of the water RTTs, which had
dummy state to disable shadows already. This wasn't true of the water
plane itself, though, yet somehow it took until just now for anyone to
report that.

This resolves vtastek's issue where the water would be invisible indoors
4 years ago
AnyOldName3 72f7e6a702 Handle all shadow alpha uniforms in shadowsbin 4 years ago
Andrei Kortunov 8ca3c3b123 Mark overrided methods by override keyword 4 years ago
AnyOldName3 707204133d Double-buffer shadow uniforms that change each frame 4 years ago
AnyOldName3 ce98d7053b Double buffer view-dependent data stateset 4 years ago
AnyOldName3 98b2d5d921 Make shadow debug HUD thread-safe
* Double buffer the frustum uniforms.
* Don't mess with the debug geometry's StateSet.
* Change two-element vectors to arrays so the size is explicit.
4 years ago
elsid 40ad87bc4d
Replace OpenThreads by std types 5 years ago
AnyOldName3 12044a607b Only alpha-test shadows when necessary
Previously we always discarded shadow map fragments if the alpha channel of the output would have been low, but there were some (modded) assets that have non-one alpha but have testing or blending disabled so end up opaque anyway. This lets the shadows of those objects match.
5 years ago
elsid 2e1d8a5e55
Remove unused virtual modifiers in DebugHUD
/home/elsid/dev/openmw/components/sceneutil/mwshadowtechnique.cpp:3127:9: warning: Call to virtual function during construction [clang-analyzer-optin.cplusplus.VirtualCall]
        addAnotherShadowMap();
        ^
/home/elsid/dev/openmw/components/sceneutil/mwshadowtechnique.cpp:3094:5: note: Loop condition is true.  Entering loop body
    for (int i = 0; i < 2; ++i)
    ^
/home/elsid/dev/openmw/components/sceneutil/mwshadowtechnique.cpp:3094:5: note: Loop condition is true.  Entering loop body
/home/elsid/dev/openmw/components/sceneutil/mwshadowtechnique.cpp:3094:5: note: Loop condition is false. Execution continues on line 3102
/home/elsid/dev/openmw/components/sceneutil/mwshadowtechnique.cpp:3126:21: note: Assuming 'i' is < 'numberOfShadowMapsPerLight'
    for (int i = 0; i < numberOfShadowMapsPerLight; ++i)
                    ^
/home/elsid/dev/openmw/components/sceneutil/mwshadowtechnique.cpp:3126:5: note: Loop condition is true.  Entering loop body
    for (int i = 0; i < numberOfShadowMapsPerLight; ++i)
    ^
/home/elsid/dev/openmw/components/sceneutil/mwshadowtechnique.cpp:3127:9: note: This constructor of an object of type 'DebugHUD' has not returned when the virtual method was called
        addAnotherShadowMap();
        ^
/home/elsid/dev/openmw/components/sceneutil/mwshadowtechnique.cpp:3127:9: note: Call to virtual function during construction
5 years ago
bzzt b6ed2f1718 Add optional shadow map max distance and fading 5 years ago
AnyOldName3 d34724a3c4 Hopefully fix Clang warning about hiding overloaded virtual functions 6 years ago
AnyOldName3 0c8ad0a3bb Double buffer debug HUD frustum geometries to prevent race conditions. 6 years ago
AnyOldName3 0a409c0ab8 Make shadow map front-face culling configurable 6 years ago
AnyOldName3 dd207d9e54 Make the shadow polygon offset parameters configurable 6 years ago
AnyOldName3 061fa57335 Switch to better-performing data types for debug hud geometry 6 years ago
AnyOldName3 474770eca8 Switch shadow map rendering to a specialised, simplified shader. 6 years ago
AnyOldName3 db707a31ec Add clipping planes when allow shadow map overlap is enabled 6 years ago
AnyOldName3 2c30bc1b4f Accidentally fix the one remaing case where shadows look awful while refactoring some stuff. 7 years ago
AnyOldName3 7255c266ba Merge branch 'osgshadow-test-vdsm' into osgshadow-test-dicking-around-with-cascading-shadow-maps 7 years ago
AnyOldName3 fc1aee10f4 Remove function declaration that somehow snuck in. 7 years ago
AnyOldName3 1b30d47d7f Add a hacky temporary version of cascading shadow maps 7 years ago
AnyOldName3 166e7df778 Improve debug HUD frustum 7 years ago
AnyOldName3 4547151863 Add the view frustum to the debug HUD (in the most annoying way possible) 7 years ago
AnyOldName3 882b63cba9 Make split point control parameters configurable with the new shadow technique. 7 years ago
AnyOldName3 e233dae1cd Hook up the new shadow technique 7 years ago
AnyOldName3 97b607fc66 Make whitespace match upstream OSG 7 years ago
AnyOldName3 639a4f5e8c Remove TODO left in by accident. Also, become 100 commits ahead of upstream. 7 years ago
AnyOldName3 478367bef3 Ensure the debug HUD won't crash if settings are changed at runtime. 7 years ago
AnyOldName3 7b52091a82 Make the debug hud enableable 7 years ago
AnyOldName3 5d719e9d5f Add the debug HUD to the new shadow technique 7 years ago
AnyOldName3 76f23c28b1 Make shadows disableable. 7 years ago
AnyOldName3 4c31b38f77 Move CLSB changes to new shadow technique 7 years ago
AnyOldName3 06b2ce6646 Fix alignment issues caused by renaming classes 7 years ago
AnyOldName3 7bd4c5e4b3 Change class name 7 years ago
AnyOldName3 c815366044 Move to the correct namespace part 2 7 years ago
AnyOldName3 11e59d3c11 Move to the correct namespace. 7 years ago
AnyOldName3 324b398d29 Add a notice clarifying the source of the shadow technique files. 7 years ago