1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-24 21:35:21 +02:00
Commit Graph

59 Commits

Author SHA1 Message Date
Lucas OH
ecc876045f Replace some raw pointers by unique_ptr (#16304) 2025-08-06 23:17:34 +02:00
Lucas OH
f71e1447c9 Fix downward shadows at time 12000 (#16326) 2025-07-12 13:23:17 +02:00
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
e84ac56e35 Don't try to update uninitialized shadow frustum 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
wrrrzr
f17498b049 Delete irrlichttypes_extrabloated.h (#15723)
Co-authored-by: cx384 <cx384@proton.me>
2025-02-01 13:41:51 +01:00
sfan5
b861f0c5c5 Fix shadow flicker on camera offset update (#15709) 2025-01-25 10:47:52 +01:00
lhofhansl
d15214af52 Remove shadow direction quantization, increase shadow update frames instead (#15665)
* This removes shadow direction quantization and defaults shadow_update_frames to 16 instead.
2025-01-11 16:41:50 -08: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
Lars Mueller
7e4919c6ed Refactor matrix4.h
Sets the surprising row-major conventions used here straight.

Renames rotateVect to rotateAndScaleVect:
If the matrix also scales, that is applied as well by the method.
Obsolete rotateVect variants are removed.
The inverseRotateVect method is also renamed accordingly.
Note that this applies the transpose of the product
of the scale and rotation matrices, which inverts just the rotation.
2024-10-10 17:40:31 +02:00
GefullteTaubenbrust2
d8f1daac25 Visual Effects Vol. 1 (#14610)
This PR adds a variety of effects to enhance the visual experience.

    "soft" clouds look
    Tinted shadows
    Crude water reflections (sky and sun) and waves
    Translucent foliage
    Node specular highlights
    Adjusted fog color (more saturated where the fog is lighter)
    Minor changes to volumetric lighting (crudely simulates the effect of depth)

Co-authored-by: sfan5 <sfan5@live.de>
2024-09-24 11:14:27 -07:00
grorp
70e169f165 Drop fixed pipeline lighting stuff (#15165) 2024-09-18 12:18:28 +02: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
Lars Müller
5c187363b2 Fix some clang compiler warnings (#14654)
* Fix some clang compiler warnings

* Get rid of sdl_supports_primary_selection

* Fix draw2DImage hiding overloaded virtual function
2024-05-15 19:56:25 +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
0c3a4cc7b9 Improve ergonomics of CachedShaderSetting 2024-02-29 17:20:49 +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
HybridDog
345e93d19c Code style: Use non-static member initialisation instead of member initialiser lists for shader uniform names
Before this change,
the member type and member name are at one place,
and the member name and uniform name are at another place.
If the uniform name is written directly at the member declaration,
the member type, member name and uniform name are all at one place,
which leads to shorter code and may be easier to read.
2024-01-11 20:04:42 +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
Thresher
180ec92ef9 Remove trailing whitespace (#13505) 2023-05-18 20:34:18 +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
x2048
70a82b0784 Avoid shadow flicker at certain angles (#12961)
Change the way look direction and camera position are quantized when calculating light frustum
2022-11-20 21:28:01 +01: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
ed26ed5a1f Quantize light frustum calculations (#12357)
* Quantize light frustum calculations

Reduces shadow flicker

* Fix function name to match conventions
2022-05-23 23:45:18 +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
Dmitry Kostenko
26c046a563 Increase the ratio between shadow range and viewing range 2022-04-02 10:39:43 +02:00