Commit Graph

55 Commits (8cf431aeb2b80907e25d941ee6078da0236720e7)

Author SHA1 Message Date
AnyOldName3 83b940397e AdD lInE bReAk ThAt ClAnG-fOrMaT wAnTeD 2 years ago
AnyOldName3 7d4410d4fb Use reserveGlobalTextureUnits for shadow maps 2 years ago
AnyOldName3 80d6f6bc97 Add line break that clang-format wanted 2 years ago
AnyOldName3 0edc8fc77d Don't use FFP-friendly texture image units for shadow maps
This more-or-less gets rid of the shadow system's only depencency on FFP
stuff. All that remains is it using OSG cameras, which OSG provides a
uniform-based implementation of, too, which we can trivially migrate to.

This should mean we're not eating any of the ~8 FPP-friendly texture
units, which is good as Morrowind models can use all of those on their
(although they very rarely do), and instead use some of the ~160
shader-only texture image units. This just requires not calling
glEnable(GL_TEXTURE_2D), accomplished by changing
setTextureAttributeAndModes to setTextureAttribute.

Also changes from using glTexGen and its eye plane matrices to pass the
shadow space matrix for each light to explicit uniforms. Thankfully, the
maths was a simple combination of the valid region matrix and eye plane
matrix maths.

As of this commit, I believe this kills shadows in one eye for stereo
rendering.
2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
Evil Eye 2222b47e3d Make Settings::Manager::getString return a reference 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
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
Alexei Dobrohotov 7a0c13fcf8 Make better use of std::clamp 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
AnyOldName3 37661bffea Merge branch 'shadowdisable-fix' into 'master'
Make disableShadowsForStateSet a no-op when shadows are disabled

See merge request OpenMW/openmw!205
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
Icecream95 f14db21745
Make disableShadowsForStateSet a no-op when shadows are disabled
Otherwise the GPU has to do useless shadow comparisons when shadows
are disabled.
5 years ago
Bret Curtis 5f0f2f0f16 rename to better reflect what is going on per AnyOldName3 comment; added none option 5 years ago
psi29a bb5fe13e13 Make sure it is either one or the other with the default to bounding volumes. 5 years ago
Bret Curtis d38c3e971c remove extra line 5 years ago
Bret Curtis ae729a1ac7 add ability to set the type of near far method to be used in shadow calculation; default to bounding volumes; cleaned up code while there and re-ordered items 5 years ago
bzzt dc33eeadf1 tightscenebound is uncessary after water bbfix 5 years ago
Bret Curtis 8a8107e837 as it says; revert vismask and uncomplicate openmw 5 years ago
Andrei Kortunov 84979fa8b7 Move VisMask to components 5 years ago
Andrei Kortunov f09d20434c Clamp number of shadow maps 5 years ago
Andrei Kortunov 7074baa1c2 Clamp number of shadow maps, as described in docs 5 years ago
bzzt b6ed2f1718 Add optional shadow map max distance and fading 5 years ago
AnyOldName3 cfe921fb82 Remove uneeded includes. 6 years ago
AnyOldName3 2761a38562 Prettify shadow define map setup. 6 years ago
AnyOldName3 57e10e26b2 Make variable name less confusing 6 years ago
AnyOldName3 a24b8ec3d2 Fix enable/disable mixup. 6 years ago
AnyOldName3 556c9a3382 Add normal-offset shadow mapping to remove shadow acne (flicker) 6 years ago
AnyOldName3 199e6ed82d Revert "Use forward declaration to reduce build times."
This reverts commit 305b9826df.
6 years ago
AnyOldName3 305b9826df Use forward declaration to reduce build times. 6 years ago
AnyOldName3 2d5da1a6fa Don't exclusively rely on a shadow map if its bounds have been expanded since the cull traversal. 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 1ca7ea23d1 Add extra uniforms to the disabled shadows StateSet so that the shadow texture samplers are bound ot the dummy shadow maps correctly. 6 years ago
AnyOldName3 474770eca8 Switch shadow map rendering to a specialised, simplified shader. 6 years ago
AnyOldName3 3b3721897d Make indoor shadows disableable. 6 years ago
AnyOldName3 85aba2e1da Add toggleable shadow debug overlay. 7 years ago
AnyOldName3 84284a60a7 Make CSM shader changes controllable by the setting. 7 years ago
AnyOldName3 5d05aadb37 Begin to let settings toggle between CSM and PSSM 7 years ago
AnyOldName3 66a114d6ec Fix a couple of warnings 7 years ago
AnyOldName3 f9cf1ac94b Separate indoor and outdoor shadow casting masks. 7 years ago
AnyOldName3 35eb71052e Tidy up the shadow manager 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 02d0ee3485 Rename old shadow class to shadow manager 7 years ago
AnyOldName3 9ec59783ba Add basic support for distant terrain CLSB
(cherry picked from commit 0f9dc3e65b72e6fff762f7a0933bae6f861e5fd4)
7 years ago
AnyOldName3 cb6767b4fc Move the declaration of ComputeLightSpaceBounds to the header so that it can be accessed from other compilation units.
(cherry picked from commit 8ac4fb208897a18da4934dd6f2fe84560b44ba9d)
7 years ago
AnyOldName3 6251e0519e Use CLSB results to reduce maximum shadow map distance when sensible. 7 years ago
AnyOldName3 9f20aaccfb Add some more advanced settings to control shadows. 7 years ago
AnyOldName3 c3e0398d1c Add settings 7 years ago