1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00
Commit graph

93 commits

Author SHA1 Message Date
Lars Müller
7ac5502fdf
Fix handling of skinned meshes for nodes
Second try after the revert in 8a28339 due to an unexpected regression.

- Rigidly animated models (e.g. the glTF frog node) were not working correctly,
  since cloning the mesh ignored the transformation matrices.
  Note that scaling the mesh needs to occur *after* transforming the vertices.
- Visual scale did not apply to skinned models,
  as resetting the animation overwrote scaled vertex data with static positions & normals.
  For backwards compatibility, we now apply a 10x scale to static, non-glTF models.

We now do scale static meshes, as the bug that caused meshes not to be scaled was limited to skeletally animated meshes,
hence we ought not to reproduce it for skinned meshes that do not take advantage of skeletal animations (e.g. current MTG doors).

However, glTF models (e.g. Wuzzy's eyeballs) up until recently were always affected due to technical reasons
(using skeletal animation for rigid animation).

Thus, to preserve behavior, we:

1. Do not apply 10x scale to glTF models.
2. Apply 10x scale to obj models.
3. Apply 10x scale to static x or b3d models, but not to animated ones.

See also: #16141
2025-05-20 18:37:33 +02:00
siliconsniffer
9b2ee1dd5d
Remove Irrlicht GUI gradients (#16015)
Co-authored-by: rollerozxa <rollerozxa@voxelmanip.se>
Co-authored-by: grorp <grorp@posteo.de>
2025-05-07 08:56:00 +02:00
Lars Müller
f4285a59ac
Purge some dead code (mostly Irrlicht) (#16111)
* Remove obsolete Irrlicht attributes system

* Remove dead GUI element types

* Remove some obsolete Irrlicht headers

* Fix some oopsies from d96f5e1
2025-05-04 16:31:44 +02:00
Lars Mueller
e1143783e5 Fix some (MSVC) compiler warnings 2025-04-20 20:49:10 +02:00
Lars Mueller
695d526764 Get rid of _IRR_OVERRIDE_ macro 2025-04-20 20:49:10 +02:00
Lars Mueller
5f1ff453c9 Replace _IRR_DEBUG_BREAK_IF with assertions 2025-04-20 20:49:10 +02:00
y5nw
bf15036831
Show SDL version in the About tab (#16046) 2025-04-20 20:20:22 +02:00
sfan5
a00b9cab36
Fix operator[] for vector2d and vector3d being potentially UB (#15977)
We don't have a C++ expert on hand, but taking a pointer to one member
and expecting to access another by an offset is very fishy:
- for one, there could theoretically be padding
- the compiler might assume that we are only writing to that first member

The new code has shown to be free for constant parameter values.
Non-constant ones cause the assembly to have branches (why?), but we don't
use that much.
2025-04-08 22:25:45 +02:00
sfan5
46db688cc8 Implement support for array textures in GL driver
note: feature detection was not implemented in the legacy driver, but the code itself probably works.
2025-04-08 22:24:37 +02:00
sfan5
d5bf094f9a Prefer immutable texture storage when available 2025-04-08 22:24:37 +02:00
sfan5
38c3876c4e Drop support for storing mipmap data alongside IImage 2025-04-08 22:24:37 +02:00
sfan5
03affa1bbb Some minor code cleanups 2025-04-08 22:24:37 +02:00
Lars Müller
a3648b0b16
Add spatial index for objects (#14631) 2025-04-08 08:44:53 +02:00
sfan5
785c042f1f Drop gzip support from CZipReader
This allowed reading concatenated gzip-compressed files as if they were an archive.
Aside from being generally uncommon we literally don't need this.
2025-03-30 18:17:19 +02:00
sfan5
89e3bc8d56 Improve std::hash<SMaterial> implementation 2025-03-30 18:17:19 +02:00
y5nw
cc65c8bd70
SDL: Use scancodes for keybindings (#14964)
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2025-03-16 20:35:34 +01:00
sfan5
7892541383 Various random code cleanups 2025-03-04 19:53:01 +01:00
sfan5
7abaa8d4cd Make Irrlicht identity material const 2025-03-04 19:53:01 +01:00
sfan5
7602308835 Revert "Restrict relative mouse mode to Wayland users (#15697)"
see #15761
SDL is the only device that supports relative mode and
mouse input is actually somewhat broken if it's *not* enabled.

This reverts commit 45c5ef8798
and 88b007907a.
2025-03-04 19:53:01 +01:00
Lars Mueller
b6c71b2379 Improve matrix4::getRotationDegrees a bit, radians 2025-02-27 12:31:04 +01:00
sfan5
5a8720a484 Change material sharing for CMeshSceneNode 2025-02-22 16:19:04 +01:00
Lars Müller
319e270664
Clean up Irrlicht matrices a bit more (#15733) 2025-02-15 12:17:30 +01:00
sfan5
45c5ef8798
Restrict relative mouse mode to Wayland users (#15697) 2025-01-26 19:16:46 +01:00
Lars Müller
8719a816e7
Fix CMatrix<T>::getScale returning negative scale (#15687) 2025-01-18 00:27:27 +01:00
sfan5
2cdf3af1b8 Reduce size of SMaterial struct 2025-01-12 14:49:25 +01:00
sfan5
4774e65ed9 Implement polygon offset in GL3 driver 2025-01-05 16:30:53 +01:00
sfan5
4e2ca05f08 Add debug mode that shows mesh buffer bounding boxes 2025-01-04 12:40:14 +01:00
SmallJoker
e8f6127779
Reduce irrlicht_extrabloated.h includes in header files 2025-01-04 12:39:34 +01:00
sfan5
1ea8763259 Clean up Irrlicht shader API 2024-12-31 14:47:46 +01:00
sfan5
d884a1624f Show active HW buffers in profiler 2024-12-31 14:47:46 +01:00
sfan5
f2b1cc3e61
Fix situation around aabbox3d default constructor (#15586)
Co-authored-by: JosiahWI <41302989+JosiahWI@users.noreply.github.com>
2024-12-29 14:36:30 +01:00
sfan5
33b8307119 OpenGL: allow uploads of buffers to hardware ahead-of-time 2024-12-24 15:27:08 +01:00
sfan5
c49ff76955
IGUIFont / CGUITTFont code cleanups (#15581) 2024-12-23 12:49:47 +01:00
sfan5
7354cbe463 Fix core::array::reallocate when shrinking 2024-12-20 15:04:08 +01:00
Lars Müller
fef28aced9
Irrlicht: Get rid of obsolete setDebugName (#15541)
Co-authored-by: sfan5 <sfan5@live.de>
2024-12-14 17:03:08 +01:00
Lars Müller
23e502fa0e
Test & document conventions used by matrix4::setRotation* (#15542)
Also includes a minor `matrix4::transformVect` refactor to make testing easier.
2024-12-14 17:02:16 +01:00
Lars Müller
1e59b9a756
Refactor SkinnedMesh (#15522) 2024-12-12 15:33:08 +01:00
Lars Müller
3e10d9ccf5
Refactor: Merge [IC]SkinnedMesh into SkinnedMesh (#15511) 2024-12-06 18:03:44 +01:00
sfan5
810f39767c Move SMaterial std::hash impl to its header 2024-12-04 18:20:34 +01:00
sfan5
a799a54894 Fix some issues with mt_opengl 2024-12-04 18:20:34 +01:00
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
Lars Müller
d068f34753
Get rid of definitelyIdentityMatrix (#15480) 2024-11-29 12:00:09 +01:00
Christian Betancourt Dias
b63e988bd6
Fix naming conventions for CMatrix4::set(Inverse)RotationRadians() (#15204) 2024-11-19 13:38:19 +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
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
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