1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02:00
Commit Graph

41 Commits

Author SHA1 Message Date
sfan5
1214a1d4a6 Refactor ITextureSource use in main menu (#16135) 2025-05-24 22:49:29 +02:00
sfan5
900cf896db Move NodeShaderConstantSetter to game.cpp 2025-04-21 12:32:29 +02:00
sfan5
b2c2a6ff47 Rename IShaderConstantSetter 2025-04-21 12:32:29 +02:00
Lars Mueller
e1143783e5 Fix some (MSVC) compiler warnings 2025-04-20 20:49:10 +02:00
wrrrzr
4bc366b984 Refactor createShadowRenderer 2025-03-30 18:16:45 +02:00
sfan5
7892541383 Various random code cleanups 2025-03-04 19:53:01 +01:00
sfan5
eb8b449817 Fix shadow performance regression due to force update
broken by: b861f0c5c5
2025-02-26 12:22:06 +01:00
sfan5
b861f0c5c5 Fix shadow flicker on camera offset update (#15709) 2025-01-25 10:47:52 +01:00
sfan5
1ea8763259 Clean up Irrlicht shader API 2024-12-31 14:47:46 +01:00
SmallJoker
87ac32edea Dynamic shadows: whitelist the 'opengl3' driver 2024-11-15 12:18:48 +01:00
sfan5
794aea8e92 Drop fixed pipeline support code (#15421)
OpenGL 2.0 is now mandatory.
2024-11-13 14:24:01 +01:00
grorp
af61de7777 Minor rendering code fixes (#15399)
* Fix line numbers in shader errors
* Fix uninitialized variables in shadow code
2024-11-12 10:52:20 +01:00
sfence
d849d51c2d Replace licensing text in headers (LGPLv2.1) (#15321) 2024-10-28 15:57:39 +01:00
SmallJoker
efd7792add Debloat IVideoDriver and IrrlichtDevice includes (#15080)
As the project grows, compile time will not go down unless the header mess
is cleaned up one by one to only include exactly what's needed.
2024-08-31 11:44:30 +02:00
cx384
03e600a721 Fix whitespaces 2024-08-17 21:02:54 +02:00
sfan5
39fd9b93c3 Introduce proper error handling for file streams 2024-05-14 18:33:08 +02:00
sfan5
d53ef90a73 Remove Irrlicht versioning 2024-03-27 20:55:48 +01:00
sfan5
e9ab5bc223 Factor shadow constants out of MainShaderConstantSetter 2024-02-29 17:20:49 +01:00
sfan5
9fcd7f2dc0 Fix clang-tidy type promotion errors 2024-02-26 20:47:47 +01:00
Lars Müller
4acbd59162 Support absent scene node names (#14330)
Contains a hack to support IrrlichtMT revision 14 for now (until we release revision 15)
2024-02-18 11:39:16 +01:00
Rising Leaf
660151572f Do not render objects that are invisble into the shadow map 2023-08-26 20:12:17 +02:00
Gregor Parzefall
6f0d36c41a Fixes and improvements 2023-07-20 22:15:47 +02:00
Gregor Parzefall
307e380f30 Refactor the way you set material properties
Instead of using SMaterial::setFlag, you now set them directly on SMaterial or SMaterialLayer.
2023-07-20 22:15:47 +02:00
Desour
8b73743baa Reduce number of recursively included headers
This should improve compilation speed.

Things changed:
* Prefer forward-declarations in headers.
* Move header-includes out of headers if possible.
* Move some functions definitions out of headers.
* Put some member variables into unique_ptrs (see Client).
2023-04-27 18:50:33 +02:00
Lars
8982998681 Add a default direction light for shadows 2023-04-09 07:10:17 -10:00
sfan5
c26e122485 Move video_driver default selection to runtime 2023-04-08 20:19:35 +02:00
Loïc Blot
322c8cf270 Reduce exposure of various internals (#12885)
* refactoring(StaticObjectList): don't expose m_active and m_stored anymore

This prevents our old crap code where anyone can access to StaticObjectList. use proper modifiers. It also permits to do a short cleanup on MapBlock using a helper

* refactoring(MapBlock): reduce a bit exposed m_active_blocks variable

* refactoring: MapBlock::m_node_timers is now private

We already had various helpers to perform this privatization, just use it. Also factorize the MapBlock stepping code for timers using already existing code and importing them from ServerEnvironment to MapBlock.

It's currently done pretty straight forward without any inheritance as MapBlock is just used everywhere, maybe in a future we'll have ServerMapBlock over MapBlock. Currently for a simple function let's just use proper objects and add a comment warning

* refactoring(Server): fix duplicated function for add/remove node

* refactoring(guiFormSpecMenu): add removeAll function to prevent duplicated code

* refactoring(ShadowRenderer) + perf: code quality  + increase performance

* All callers are already using the point and we should never test a function with nullptr node, it's a bug. Removed workaround which was hacky and fix the bug
* Drop clientmap lookup from shadowrendered, just use directly its
  pointer and forbid to push it in the generic list
* Reduce memory pressure on the renderShadowObject by preventing
  deallocating and reallocating multiple vectors on each node

* refactoring(MapBlock): reduce exposure of MapBlock::m_static_objects

It's not complete as some parts of the code are pretty nested, but it's better than before :)

* fix: better working on new functions & drop unwanted 2 lines

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2022-11-03 17:35:31 +01:00
x2048
88820cd31c Shadow list improvements (#12898)
* Remove redundant checks when attaching SM texture to entities.
  Some of the checks were broken, leading to crashes when shadow intensity is set to 0
* Avoid memory leak in shadow casters list when wield mesh changes item stacks
2022-10-26 22:26:09 +02:00
x2048
ff6dcfea82 Implement rendering pipeline and post-processing (#12465)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: lhofhansl <lhofhansl@yahoo.com>
2022-09-06 08:25:18 +02:00
x2048
7c261118e0 Release shadow mapping resources when not needed (#12497) 2022-07-09 22:26:39 +02:00
x2048
ef22c0206f Force-update shadows when the world is changed (#12364) 2022-05-26 22:28:34 +02:00
x2048
dc45b85a54 Improve shadow filters (#12195)
* Rewrite shadow filtering for the new distortion
* Calculate penumbra radius using a single sample
* Avoid peter-panning effect due to filtering of short shadows
* Add adaptive filter quality for soft shadows
* Avoid sharp shadows on surfaces without normals (e.g. plants)
* Increase default and maximum soft shadow radius
* Make line numbers in shader errors match the code
2022-05-21 16:49:30 +02:00
sfan5
a89afe1229 Deal with compiler warnings 2022-04-30 16:49:41 +02:00
x2048
a5d29fa1d4 Implement shadow offsets for the new SM distortion function (#12191)
* Move shadow position calculation to vertex shaders
* Animate entire scene before rendering shadows to prevent lagging of shadows
* Remove unnecessary use of PolygonOffsetFactor
* Apply normal offset to both nodes and objects
* Rename getPerspectiveFactor -> applyPerspectiveDistortion
* Remove perspective distortion from fragment shaders
2022-04-14 22:49:30 +02:00
x2048
48f7c5603e Adjust shadowmap distortion to use entire SM texture (#12166) 2022-04-07 22:13:50 +02:00
x2048
31578303a4 Tune shadow perspective distortion (#12146)
* Pass perspective distortion parameters as uniforms
* Set all perspective bias parameters via ShadowRenderer
* Recalibrate perspective distortion and shadow range to render less shadow geometry with the same quality and observed shadow distance
2022-03-31 22:40:06 +02:00
x2048
0f25fa7af6 Add API to control shadow intensity from the game/mod (#11944)
* Also Disable shadows when sun/moon is hidden. Fixes #11972.
2022-03-26 16:58:26 +01:00
Dmitry Kostenko
4801bdf45a Correct normal bias for entities
Remove use of magic constants.
Apply cameraOffset
Calculate distance projected on SM plane
2022-03-07 23:45:26 +01:00
x2048
442e48b84f Move updating shadows outside of RenderingCore::drawAll. (#11491)
Fixes indirect rendering modes such as some 3D modes mentioned in #11437 and undersampled rendering.
Does not fully fix anaglyph 3d mode.
2021-08-12 20:07:09 +02:00
x2048
bf3acbf388 Distribute shadow map update over multiple frames to reduce stutter (#11422)
Reduces stutter and freezes when playing.

 * Maintains double SM and SM Color textures
 * Light frustum update triggers incremental generation of shadow map into secondary 'future' textures.
 * Every incremental update renders a portion of the shadow draw list (split equally).
 * After defined number of frames (currently, 4), 'future' and 'current' textures are swapped, and DirectionalLight 'commits' the new frustum to use when rendering shadows on screen.

Co-authored-by: sfan5 <sfan5@live.de>
2021-07-25 12:36:23 +02:00
Liso
c47313db65 Shadow mapping render pass (#11244)
Co-authored-by: x2048 <codeforsmile@gmail.com>
2021-06-06 18:51:21 +02:00