Commit Graph

12237 Commits

Author SHA1 Message Date
sfan5
1fb7202028 GL: fix and clean up some code 2024-12-04 18:20:34 +01:00
sfan5
36edc3f161 Add 10-bit texture format and setting to chose PP color depth
(and move some settings to the advanced category)
2024-12-04 18:20:34 +01:00
AFCMS
e545e96d2b
Make string to v3f parsing consistent, replace core.setting_get_pos() by core.settings:get_pos() (#15438)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2024-12-04 18:19:46 +01:00
Lars Müller
18caf3a18d
Fix false positive compiler warning 2024-12-04 18:19:12 +01:00
HybridDog
a45b04ffb4
Less explicit memory management in Irrlicht image writer classes (#15493)
CImageWriterPNG::writeImage() and writeJPEGFile() explicitly allocate
and deallocate memory with `new` and `delete`, which is prone to programming errors.
The code also has non-functional error handling:
When memory allocation fails, `new` throws an `std::bad_alloc` exception
and never returns `nullptr`, so the check for `nullptr` is always false.

Co-authored-by: DS <ds.desour@proton.me>
2024-12-03 16:52:48 +01:00
JosiahWI
03813a5b5e
Use CMake list directives where appropriate
I think this communicates the intent a little better than using a `set`
directive, and it makes the code a little less verbose, too.
2024-12-03 16:52:15 +01:00
JosiahWI
818bca68d1
Use add_compile_options where appropriate 2024-12-03 16:51:53 +01:00
sfan5
a4d1b5b155
Fix script security path normalization in presence of links (#15481) 2024-12-03 16:51:34 +01:00
wrrrzr
e9080f91f2
Cleanup ban.cpp/h (#15496)
Make BanManager more const correctly
Delete unused includes
2024-12-01 20:52:13 +01:00
Kevin @ Sesam Solutions
7cc5a6ec68
Add Minetest keyword for backwards compatibility (#15491)
This helps people looking for `minetest`
2024-12-01 20:51:33 +01:00
JosiahWI
c3db9492a7
Update CMakeLists to use add_compile_definitions (#15483)
This is a newer feature introduced in CMake 3.12, which is now our
minimum version. It supercedes `add_definitions`. I've also replaced
some calls to set `CMAKE_<LANG>_FLAGS` that were used to set
definitions. This is a fairly trivial routine build maintenance that
is not intended to have any behavioral effects.
2024-11-29 12:02:48 +01:00
Lars Müller
d068f34753
Get rid of definitelyIdentityMatrix (#15480) 2024-11-29 12:00:09 +01:00
DS
df4e70b2c7
Add a setting to group transparency sorted triangles by buffer (#15115) 2024-11-28 14:22:53 +01:00
SmallJoker
c175046d30
Network: Fix serialization version checks (#15477)
This fixes some incorrect assumptions that the read and write version ranges are identical - whereas they're in fact not.
2024-11-27 18:39:57 +01:00
Lars Müller
6c324cb871
Main menu: Fix server selection (#15466)
Server selections are now always correct (no more arbitrarily changing selections if the order of the serverlist changes) and consistent with the address + port in the sidebar.
2024-11-27 18:39:28 +01:00
lhofhansl
8c56434bd3
Clamp pre-bloom color to valid range (#15453)
That avoids flashing artifacts when combining MSAA and bloom.
2024-11-25 11:56:32 -08:00
Lars Müller
b77ad82fb9
Sanitize invalid particle spawner time (#15465) 2024-11-24 19:23:53 +01:00
veprogames
11b19cd126
Doc: Add missing jpeg package for Arch Linux (#15461) 2024-11-24 19:23:32 +01:00
grorp
6a1d22b2c5
Implement an editor to customize the touchscreen controls (#14933)
- The editor is accessible via the pause menu and the settings menu.
- Buttons can be moved via drag & drop.
- Buttons can be added/removed. The grid menu added by #14918 is used to show
  all buttons not included in the layout.
- Custom layouts are responsive and adapt to changed screen size / DPI /
  hud_scaling.
- The layout is saved as JSON in the "touch_layout" setting.
2024-11-24 11:33:39 +01:00
luk3yx
4faa16fe0d
Clarify behaviour of core.hypertext_escape (#15464) 2024-11-22 17:56:35 +01:00
siliconsniffer
b6eaf7b5a4
Main menu: Player list for public servers (#15425) 2024-11-21 20:34:40 +01:00
Richard Try
946b3a4222
Typo in lua_api.md (#15440)
Duplicate text removed.
2024-11-20 18:36:35 +00:00
Christian Betancourt Dias
b63e988bd6
Fix naming conventions for CMatrix4::set(Inverse)RotationRadians() (#15204) 2024-11-19 13:38:19 +01:00
Lars Müller
15e8f9e6a0
Fix rendering regression with TGA type 1 files with BGRA8 color (#15402)
TGA uses BGR(A)8, stored in memory in that order. Irrlicht typically expects 0xAARRGGBB, which depends on endianness.
(This means that on little endian, no [B][G][R][A] -> 0xAARRGGBB conversion needs to be done, but Irrlicht was swapping the bytes.)

This makes both conversion functions consistently convert from [B][G][R]([A]) to 0xAARRGGBB (SColor), documents them properly and moves them to CImageLoaderTGA.cpp
so no poor soul shall be fooled by them in the near future.

---------

Co-authored-by: Ælla Chiana Moskopp <erle@dieweltistgarnichtso.net>
2024-11-19 13:37:05 +01:00
Lars Müller
138052adfc
Add particle blend mode "clip" (#15444)
This lets modders avoid alpha blending rendering bugs as well as potential (future) performance issues.
The appropriate blend modes are also used for node dig particles.

---------

Co-authored-by: sfan5 <sfan5@live.de>
2024-11-19 13:30:17 +01:00
sfan5
f493e73aeb Fix changing secure settings from mainmenu
forgotten in ea4ae55e24d2c27524490cb8e0d3c34aa46e3da3
closes #15454
2024-11-18 23:58:42 +01:00
grorp
9b6a399011
Implement support for FSAA in combination with post-processing (#15392)
- Actually it's MSAA I think, or perhaps the terms are equivalent
- I've made it fit into the existing Irrlicht architecture, but that has resulted in code duplication compared to my original "hacky" approach
- OpenGL 3.2+ and OpenGL ES 3.1+ are supported
- EDT_OPENGL3 is not required, EDT_OPENGL works too
- Helpful tutorial: https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing, section "Off-screen MSAA"
- This may be rough around the edges, but in general it works
2024-11-18 14:06:48 +01:00
veprogames
a8ea165042
Replace occurences of 'wiki.minetest.net' with 'wiki.luanti.org' 2024-11-18 00:04:32 +01:00
HybridDog
7295b6c88c
Remove unused and rarely used irrlicht color functions (#15442)
SColor.h contains many functions which are unused and/or perform linear
operations on non-linear 8 bit sRGB color values, such as the plus operator and
`SColor::getInterpolated()`, and there is no documentation about missing gamma
correction.
Some of these functions are not called or called only once:
* `getAverage(s16 color)`: Unused
* `SColor::getLightness()`: Unused
* `SColor::getAverage()`: Claims to determine a color's average intensity but
  calculates something significantly different since SColor represents
  non-linear sRGB values.
* `SColor::getInterpolated_quadratic()`: Claims to interpolate between colors
  but uses the sRGB color space, which is neither physically nor perceptually
  linear.
* `SColorf::getInterpolated_quadratic()`: Unused
* `SColorf::setColorComponentValue()`: Unused

Removing or inlining these functions can simplify the code and documenting
gamma-incorrect operations can reduce confusion about what the functions do.

This commit does the following:
* Remove the above-mentioned unused functions
* Inline `SColor::getAverage()` into
  `CIrrDeviceLinux::TextureToMonochromeCursor()`
* Rename `SColor::getLuminance()` into `SColor::getBrightness()` since it does
  not determine a color's luminance but calculates something which differs
  significantly from physical luminance since SColor represents non-linear sRGB
  values.
* Inline `SColor::getInterpolated_quadratic()` into `GameUI::update()`,
  where it is only used for the alpha value calculation for fading
* Document gamma-incorrect behaviour in docstrings
2024-11-18 00:02:53 +01:00
sfan5
8d2e770361 Minor corrections in gl3/gles2 drivers 2024-11-16 16:54:22 +01:00
sfan5
cc8c3d501c Don't keep a copy of all texture images around 2024-11-16 16:54:22 +01:00
sfan5
58ccf0ba82 Fix some smaller issues with texture/image handling 2024-11-16 16:54:22 +01:00
sfan5
4aae31ad5e Add support for ECF_D24 texture format
and prefer it over D32 for our depth buffer, this can have performance benefits
2024-11-16 16:54:22 +01:00
sfan5
3c42cc8684 Revive texture download code and fix it on GLES 2024-11-16 16:54:22 +01:00
sfan5
11837d4623
Remove BMP image support (#15434)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-11-15 12:21:30 +01:00
Erich Schubert
46f0baff09
Improve documentation of liquid_surface (#15012) 2024-11-15 12:19:41 +01:00
SmallJoker
8f03b70584 IrrlichtMt: Document Driver/Device compatibility 2024-11-15 12:18:48 +01:00
SmallJoker
4838eb2f7d Non-SDL: Add opengl3 support 2024-11-15 12:18:48 +01:00
SmallJoker
87ac32edea Dynamic shadows: whitelist the 'opengl3' driver 2024-11-15 12:18:48 +01:00
sfence
58dd42166d
Add some info to compiling README 2024-11-15 11:39:08 +01:00
grorp
a9fe83126a
Get rid of depth buffer workaround in the render pipeline code (#15407)
I originally wanted to get of the legacy IVideoDriver::setRenderTarget altogether,
but that ended up being too much work.
The remaining usage is in "dynamicshadowsrender.cpp".

Here's a comment I wrote about the workaround:

----------------------------------------

Use legacy call when there's single texture without depth texture
This means Irrlicht creates a depth texture for us and binds it to the FBO

This is currently necessary for a working depth buffer in the following cases:

- post-processing disabled, undersampling enabled
  (addUpscaling specifies no depth texture)

- post-processing disabled, 3d_mode = sidebyside / topbottom / crossview
  (populateSideBySidePipeline specifies no depth texture)

- post-processing disabled, 3d_mode = interlaced
  (probably, can't test since it's broken)
  (populateInterlacedPipeline specifies no depth texture)

With post-processing disabled, the world is rendered to the TextureBufferOutput
created in the functions listed above, so a depth buffer is needed
(-> this workaround is needed).
With post-processing enabled, only a fullscreen rectangle is rendered to
this TextureBufferOutput, so a depth buffer isn't actually needed.
But: These pipeline steps shouldn't rely on what ends up being rendered to
the TextureBufferOutput they provide, since that may change.

This workaround was added in 1e9640395468beb53f70303ef6b7aa72e395b7b4 /
https://irc.minetest.net/minetest-dev/2022-10-04#i_6021940

This workaround should be replaced by explicitly configuring depth
textures where needed.

----------------------------------------
2024-11-15 11:38:56 +01:00
cx384
d4378a74d3
Fix register_ore ore_type error handling 2024-11-15 11:37:17 +01:00
sfan5
0c3117f9b3 Fix mainmenu settings crash caused by last commit
closes #15432
2024-11-13 18:39:10 +01:00
sfan5
794aea8e92
Drop fixed pipeline support code (#15421)
OpenGL 2.0 is now mandatory.
2024-11-13 14:24:01 +01:00
veprogames
0fde9ab7e8
Change minetest.net to luanti.org in 'Further documentation' 2024-11-13 14:23:39 +01:00
grorp
11e04ec113
Replace forgotten SEvent memset 2024-11-13 14:23:13 +01:00
sfan5
ea4ae55e24 Implement script sandboxing for main menu 2024-11-13 14:22:41 +01:00
sfan5
1fd4e0b82d Refactor ScriptApiSecurity for cleaner separation of concerns 2024-11-13 14:22:41 +01:00
Erich Schubert
4c44942a39
Add weights to biomes (#15142) 2024-11-12 10:53:17 +01:00
cx384
44b261d136
Luacheck: add VoxelManip to globals 2024-11-12 10:53:04 +01:00