Commit Graph

48 Commits

Author SHA1 Message Date
sfan5 09d542dfe0 Drop enable_vbo setting
Consistently applying this setting requires some code work,
because Irrlicht does not provide a global toggle.
At the same time I don't see any reason for someone to disable this.
2024-02-29 17:20:49 +01:00
numzero bf2098c07f Decouple MeshMakeData from Client 2024-02-22 15:45:17 +00:00
Desour 010d08f6a4 Fix -Wmissing-braces warnings in mapblock_mesh.cpp 2023-09-09 18:48:56 +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 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
numzero 1102f92dac Use a enum for tile rotation 2023-06-22 17:50:20 +02:00
numzero 729671d6ae In getNodeTile, use a descriptive struct for the lookup table 2023-06-22 17:50:20 +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
Vitaliy 35929d27e3
Remove fast faces (#13216)
Co-authored-by: Lars <larsh@apache.org>
2023-04-08 20:17:15 +02:00
x2048 705195b43e
Scale culler steps proportionally to the mesh sizes (#13250) 2023-03-11 14:10:26 +01:00
DS 6e1c70e02b
Fix a -Wreorder warning 2023-02-22 11:06:48 +01:00
sfan5 3bafbaac49 Remove dead code behind Irrlicht version checks 2023-02-18 16:46:51 +01:00
lhofhansl d3a6ee00e6
Generalize mesh chunking, and make it configurable. (#13179)
* Generalize mesh chunking. Set 3x3x3 chunks.

* Make mesh chunk size configurable... Default to 1 (off).

* Extract all mesh grid maths into a dedicated class

---------

Co-authored-by: x2048 <codeforsmile@gmail.com>
2023-02-08 13:42:12 -08: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 2715cc8bf6
Occlusion culling algorithm based on recursive descend (#13104)
Co-authored-by: DS <vorunbekannt75@web.de>
2023-01-06 22:31:06 +01:00
x2048 3e7ee499d6 Always add increment when getting node interior light 2022-10-30 16:53:45 +01:00
Jude Melton-Houghton 9676364c1f
Optimize lighting calculation (#12797) 2022-10-09 10:50:26 -04:00
Wuzzy 3f801bc096
Fix liquid drawtype faces sometimes not rendering (#12807)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-09-26 19:27:47 -04:00
DS c9ed059d91
Client map: do frustum culling via planes (#12710) 2022-09-18 15:28:53 +02:00
rubenwardy a871115889
Fix some warnings (#12615) 2022-07-30 12:51:23 +01:00
x2048 3107c98591
Mapblock Mesh BspTree: Increase the depth of block-level splits
... before going node-level triangle search.
Fixes transparent grass on transparent land
2022-06-07 21:26:31 +02:00
sfan5 5d26ac0088 Improve code in mapblock_mesh.cpp a bit 2022-05-26 15:49:12 +02:00
paradust7 2742fef458
Fixes needed to use irrArray backed by std::vector (#12263) 2022-05-22 00:11:49 +02:00
sfan5 a66e6d4dff Consolidate some data structures in MapBlockMesh 2022-05-08 19:12:10 +02:00
paradust7 7e18a1f1be
Remove HW_buffer_counter after IrrlichtMt fix to remove HWBufferMap (#12232)
Keep code and use version check instead, for backwards compatibility
2022-04-28 18:52:19 +02:00
x2048 b0b9732359
Add depth sorting for node faces (#11696)
Use BSP tree to order transparent triangles
https://en.wikipedia.org/wiki/Binary_space_partitioning
2022-04-02 10:42:27 +02:00
rubenwardy c61998bd20
Revert "Disable dynamic shadows for the 5.5.0 release" (#12032) 2022-01-31 21:48:14 +00:00
SmallJoker a27362de6a Disable dynamic shadows for the 5.5.0 release
The dynamic shadows are yet not in the desired state to justify the
inclusion into version 5.5.0. A stable release is long overdue, hence
this allows fixes to continue in 5.6.0-dev to finally release an
acceptable version of the dynamic shadows feature.

Reverting this commit is highly recommended to proceed in development.
2022-01-29 18:42:55 -05:00
Wuzzy 1320c51d8e
Fix scaled world-aligned textures being aligned inconsistently for non-normal drawtypes 2021-08-19 20:14:04 +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 e441ab9675
Fix world-aligned node rendering at bottom (#10742) 2021-02-19 19:45:36 +01:00
rubenwardy 4c76239818
Remove dead code (#10845) 2021-01-22 15:09:26 +00:00
sfan5 74762470b2 Fix some minor code issues all over the place 2020-12-24 13:44:54 +01:00
hecks 6d7067fd37
Implement mapblock camera offset correctly (#10702)
Implement mapblock camera offset correctly - reduce client jitter

Co-authored-by: hecktest <>
2020-12-05 15:03:40 -08:00
Lars ed22260822 Remove all bump mapping and parallax occlusion related code. 2020-10-17 13:09:16 -07:00
Zughy a37e96eefc
-Wmem-access only called when GCC > 7 (#10453) 2020-10-06 20:51:27 +02:00
SmallJoker f46509d5e2
Remove unused functions reported by cppcheck (#10463)
Run unused functions reported by cppcheck

This change removes a few (but not all) unused functions.
Some unused helper functions were not removed due to their complexity and potential of future use.
2020-10-05 09:07:33 +02:00
Pierre-Yves Rollo 81c66d6efb Minimap as HUD element with API control
Features:
 * Define Minimap available modes (surface/radar, scale) from Lua, using player:set_minimap_modes()
 * New HUD elements for displaying minimap with custom size and placing
 * New minimap mode for displaying a texture instead of the map
2020-10-04 15:24:34 +02:00
Paul Ouellette 542df11bed
Fix GCC class-memaccess warnings (#10239) 2020-08-01 17:25:33 +02:00
SmallJoker 5311a27523 Silence GCC warning in mapblock_mesh
Fixes following warning:
  warning: ‘waving’ may be used uninitialized in this function [-Wmaybe-uninitialized]
2020-05-25 19:10:23 +02:00
sfan5 73180a73da
mapblock_mesh: Optimize a few things (#9713) 2020-04-25 12:39:17 +02:00
Lars Hofhansl 60bff1e6cb Waves generated with Perlin-type noise #8994 2019-11-19 19:42:52 -08:00
SmallJoker 539f016c1b
Better F6 profiler (#8750)
Update the profiler names to make more sense of what they actually represent
Move the profiler code from header to its source file
Use monospace font to align lines
Format the statistics line to align better with surrounding values
Refresh the profiler each 3 seconds (roughly)
2019-08-13 19:56:55 +02:00
sfan5 5b99abb847 Fix texture rotation for wallmounted nodeboxes
fixes #8358
2019-03-19 22:36:51 +01:00
Quentin Bazin 5f1cd555cd Move client-specific files to 'src/client' (#7902)
Update Android.mk
Remove 'src/client' from include_directories
2018-11-28 20:01:49 +01:00