1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00
Commit Graph

59 Commits

Author SHA1 Message Date
Lars Müller
08bc036311 Remove obsolete SMeshBuffer.h (#16308) 2025-07-03 17:32:35 +02:00
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
sfan5
8a28339ed3 Revert "Fix handling of skinned meshes for nodes"
It literally breaks torches and doors in MTG.
Regardless of whether this is an oversight or not let's not pull this in so close to release.
This reverts commit 612db5b2ca.
2025-05-14 23:21:33 +02:00
Lars Mueller
612db5b2ca Fix handling of skinned meshes for nodes
- 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 only apply a 10x scale to static (.obj) models.
2025-05-14 22:28:33 +02:00
sfan5
4c4e296274 Handle texture filtering sanely to avoid blurriness (#16034) 2025-04-21 12:31:44 +02:00
cx384
52b974184d Move client code out of ItemDefManager (#15967) 2025-04-04 18:58:14 +02:00
cx384
a6d4cd7c15 Draw node animation for items (#15930) 2025-04-04 18:47:11 +02:00
sfan5
7892541383 Various random code cleanups 2025-03-04 19:53:01 +01:00
sfan5
83fd837d75 Clean up TileLayer::applyMaterialOptions 2025-02-22 16:19:04 +01:00
sfan5
5a8720a484 Change material sharing for CMeshSceneNode 2025-02-22 16:19:04 +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
636a734d78 Resolve some quirks with (wield) item meshes for nodes (#15654) 2025-01-13 09:39:06 +01:00
Desour
d044c27b5f MeshMakeData: Explain members, and add grid size and minimap flag 2025-01-11 16:43:37 +01:00
Desour
c0ce918d77 Meshgen: Handle enable_water_reflections like smooth_lighting 2025-01-11 16:43:37 +01:00
sfan5
06f39e1915 Fix missing bounding box for CAO 'wielditem' visual 2025-01-05 16:30:53 +01:00
sfan5
5b14c03301 Use polygon offset to fix z-fighting for overlay tiles 2025-01-05 16:30:53 +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
Lars Müller
412cc96bc9 Fix some compiler warnings (#15596) 2024-12-26 11:29:00 +01:00
sfan5
794aea8e92 Drop fixed pipeline support code (#15421)
OpenGL 2.0 is now mandatory.
2024-11-13 14:24:01 +01:00
sfence
d849d51c2d Replace licensing text in headers (LGPLv2.1) (#15321) 2024-10-28 15:57:39 +01:00
sfan5
4e9aa7dc77 Make itemdef.h safe to include anywhere 2024-10-16 19:39:59 +02:00
grorp
70e169f165 Drop fixed pipeline lighting stuff (#15165) 2024-09-18 12:18:28 +02:00
sfan5
275bef0633 Remove unused leftovers from normal mapping 2024-09-07 14:23:37 +02:00
sfan5
d8190e1c5f Some globals (un-)init fixes 2024-04-20 13:03:42 +02:00
sfan5
bb7f57b095 VBO-related optimizations and improvements (#14395) 2024-02-29 17:20:57 +01:00
numzero
bf2098c07f Decouple MeshMakeData from Client 2024-02-22 15:45:17 +00:00
sfan5
7f9326805c Return texture filter settings to previous state
This partially reverts commit 72ef90885d.

fixes #14007
2023-11-29 21:09:21 +01:00
SmallJoker
4ef93fe25f Allow place_param2 = 0 node placement predictions (#13787)
The placement prediction value 0 was accidentally ignored
and made the clients fall back to automatic rotation based
on the node paramtype2 value.

This now changes the internal representation to properly
indicate the disabled state (e.g. 'nil' in Lua).
2023-09-13 13:57:57 +02:00
Gregor Parzefall
72ef90885d Clean up texture filtering settings (#13683) 2023-08-24 10:50:47 +02:00
Gregor Parzefall
6f0d36c41a Fixes and improvements 2023-07-20 22:15:47 +02:00
Gregor Parzefall
7473e4cafd Expose all OpenGL filtering modes, use OpenGL names for them
Because of a review comment on the Irrlicht PR by numberZero.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
6bf63d4b41 Rename SMaterial::TextureLayer -> SMaterial::TextureLayers
It's not the "texture layer" of the material, but an array of texture layers.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
9bef3c136a Split up texture filtering properties of SMaterialLayer into MinFilter and MagFilter
You can	now set	the filter used	when scaling textures down and the filter used when scaling textures up separately.
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
rubenwardy
4158b72971 Add ability to override item images using meta (#12614) 2023-04-17 19:44:41 +01:00
x2048
69fc206109 8x block meshes (#13133)
Reduce the number of drawcalls by generating a mesh per 8 blocks (2x2x2). Only blocks with even coordinates (lowest bit set to 0) will get a mesh.

Note: This also removes the old 'loops' algorithm for building the draw list, because it produces visual artifacts and cannot be made compatible with the approach of having a mesh for every 8th block without hurting performance.

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
Co-authored-by: Lars <larsh@apache.org>
Co-authored-by: sfan5 <sfan5@live.de>
2023-01-31 17:30:59 +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
DS
c9ed059d91 Client map: do frustum culling via planes (#12710) 2022-09-18 15:28:53 +02:00
x2048
7c261118e0 Release shadow mapping resources when not needed (#12497) 2022-07-09 22:26:39 +02:00
Dmitry Kostenko
8756b7a735 Initialize wield mesh color when wield_image is set
#12245
2022-05-15 21:44:55 +02:00
x2048
c7bcebb628 Initialize wield mesh colors when changing item. (#12254)
Fixes #12245
2022-05-01 17:21:00 +02:00
Dmitry Kostenko
54dccc480e Improve lighting of entities.
Pass correct natural & artificial light to the shaders
Use natural/artificial light ratio for correct rendering of shadows
2022-03-07 23:45:26 +01:00
Dmitry Kostenko
4e39cdef94 Apply shadow texture to wield-based entities
For example, dropped nodes and items.
2022-03-07 23:45:26 +01:00
Wuzzy
86b44ecd82 Add no_texture.png as fallback for unspecified textures 2021-10-20 21:50:16 +02:00
SmallJoker
b3b075ea02 Fix segfault caused by shadow map on exit 2021-08-12 20:08:39 +02:00
Liso
c47313db65 Shadow mapping render pass (#11244)
Co-authored-by: x2048 <codeforsmile@gmail.com>
2021-06-06 18:51:21 +02:00
Loic Blot
5a02c376ea refacto: RenderingEngine::get_scene_manager() is now not callable from singleton
This permits to make evidence that we have some bad object passing on various code parts. I fixed majority of them to reduce the scope of passed objects

Unfortunately, for some edge cases i should have to expose ISceneManager from client, this should be fixed in the future when our POO will be cleaner client side (we have a mix of rendering and processing in majority of the client objects, it works but it's not clean)
2021-05-03 19:49:19 +02:00
Wuzzy
90a7bd6a0a Put torch/signlike node on floor if no paramtype2 (#11074) 2021-04-20 19:50:03 +02:00
sfan5
1e4913cd76 Irrlicht support code maintenance 2021-03-31 13:15:47 +02:00
Wuzzy
6c9be39db0 Fix wield image of plantlike_rooted (#11067) 2021-03-30 00:27:46 +02:00