Commit Graph

65 Commits (63b8e636f391e80388a7d7a5077c16cf9847fd64)

Author SHA1 Message Date
Alexei Kotov f0e4793321 Remove allow shadow map overlap setting (#7939) 8 months ago
AnyOldName3 3335ccbc32 Capitulate 10 months ago
AnyOldName3 8c92f6ee87 Make uniform a signed int again 10 months ago
AnyOldName3 d282fdb77a Eliminate unused uniform 10 months ago
AnyOldName3 132c43affa Fix warning
Also attempt to make an equivalent warning fire with MSVC, then have to fix other stuff because /WX wasn't working, then back out of enabling the warning because none of the ones I could find disliked the old code.
10 months ago
AnyOldName3 7391bf2814 Fix OpenGL errors
There's no reason to use the AndModes variant as we never (intentionally) attempt to sample from a shadow map via the FFP.
10 months ago
AnyOldName3 535c5e328a Affect correct texture units when disabling shadows for stateset
Knowing which are right required making the function non-static, so the shadow manager had to become a singleton as the results of passing it around to where it's needed were hellish.

I'm seeing a bunch of OpenGL errors when actually using this, so I'll investigate whether they're happening on master.
I'm hesitant to look into it too much, though, as I'm affected by https://gitlab.com/OpenMW/openmw/-/issues/7811, and also have the Windows setting enabled that turns driver timeouts into a BSOD so a kernel dump is collected that I can send to AMD.
10 months ago
elsid f4efbcc1c4
Use settings values for Shadows settings 1 year ago
Bret Curtis ff6944701f Be more explicit about use of CLAMP_TO_EDGE instead of defaulting to GL CLAMP 2 years ago
Mads Buvik Sandvei fe066069d7 /components/ code should not access the stereo manager without checking whether or not stereo is enabled first. Stereo component code should not read settings itself, but rather take settings as parameters. 2 years ago
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