aboutsummaryrefslogtreecommitdiff
path: root/src/client/clientmap.cpp
AgeCommit message (Collapse)Author
2023-02-20Fix rounding errors when slicing the shadow draw list (#13226)x2048
2023-02-16Add mesh-holding blocks to shadow drawlist. (#13203)lhofhansl
When mesh chunking and shadows are enabled, make sure that the mesh-holding blocks are added to the shadow drawlist. Otherwise those portions of the shadows will not be rendered.
2023-02-08Generalize mesh chunking, and make it configurable. (#13179)lhofhansl
* 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-01Separate drawlist from non-rendered blocks. (#13176)lhofhansl
2023-01-318x block meshes (#13133)x2048
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-23Remove the 'loops' occlusion culler (#13169)x2048
2023-01-06Occlusion culling algorithm based on recursive descend (#13104)x2048
Co-authored-by: DS <vorunbekannt75@web.de>
2022-11-03Reduce exposure of various internals (#12885)Loïc Blot
* 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-10-28Fix incorrect culling introduced by ##12710 (#12887)lhofhansl
2022-10-09Optimize lighting calculation (#12797)Jude Melton-Houghton
2022-09-18Client map: do frustum culling via planes (#12710)DS
2022-09-06Code optimizations / refactor (#12704)Herman Semenov
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com> Co-authored-by: sfan5 <sfan5@live.de>
2022-08-13Reduce the use of porting::getTimeMs() when rendering frames (#12679)x2048
* Avoid calling TimeTaker too frequently in renderMapXXX * Calculate animation timer once per frame * Remove code that breaks rendering frame at 2000ms Co-authored-by: sfan5 <sfan5@live.de> Co-authored-by: sfan5 <sfan5@live.de>
2022-07-09Release shadow mapping resources when not needed (#12497)x2048
2022-06-03Properly keep noclip state in Game and ClientMapsfan5
2022-05-22Fixes needed to use irrArray backed by std::vector (#12263)paradust7
2022-05-21Improve shadow filters (#12195)x2048
* 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-04-08Spacing fixesShadowNinja
2022-04-07Remove obsolete commented code (follow up to #12166)Dmitry Kostenko
2022-04-07Adjust shadowmap distortion to use entire SM texture (#12166)x2048
2022-04-02Add depth sorting for node faces (#11696)x2048
Use BSP tree to order transparent triangles https://en.wikipedia.org/wiki/Binary_space_partitioning
2021-10-01Improvements to colored shadows (#11516)x2048
2021-09-27Order drawlist by distance to the camera when rendering (#11651)x2048
2021-07-25Distribute shadow map update over multiple frames to reduce stutter (#11422)x2048
Reduces stutter and freezes when playing. * Maintains double SM and SM Color textures * Light frustum update triggers incremental generation of shadow map into secondary 'future' textures. * Every incremental update renders a portion of the shadow draw list (split equally). * After defined number of frames (currently, 4), 'future' and 'current' textures are swapped, and DirectionalLight 'commits' the new frustum to use when rendering shadows on screen. Co-authored-by: sfan5 <sfan5@live.de>
2021-06-06Shadow mapping render pass (#11244)Liso
Co-authored-by: x2048 <codeforsmile@gmail.com>
2021-05-03refacto: protect some RenderingEngine::get_scene_managerLoic Blot
* protect it from Camera, Sky, ClientMap object calls * rename Game::sky to Game::m_sky
2021-04-05Reserve vectors before pushing and other code quality changes (#11161)sfan5
2021-02-26Keep mapblocks in memory if they're in range (#10714)hecks
Some other minor parts of clientmap.cpp have been cleaned up along the way
2020-12-23Minor profiler fixes.Lars
2020-12-05Implement mapblock camera offset correctly (#10702)hecks
Implement mapblock camera offset correctly - reduce client jitter Co-authored-by: hecktest <>
2020-11-25Fix camera panning glitches (partially revert 10489.)Lars
2020-10-19Minor clientmap improvements.Lars
- Avoid calculating isBlockInSight for blocks without meshes. - Add metric for how many blocks the client has currently loaded. - Make some variables constant.
2020-10-13Avoid drawing invisible blocks on the client.Lars
2020-10-05Remove unused functions reported by cppcheck (#10463)SmallJoker
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.
2019-08-23Occlusion: Check for light_propagates and do mapblock bounds checksSmallJoker
2019-08-23Occlusion: Begin cleanupSmallJoker
2019-08-13Fix unnecessary exception use in Map::getSectorXXX (#8792)Jozef Behran
The Map::getSectorNoGenerate throws an exception but no other code is really dependent on that. Fix the odd instance of misuse in ClientMap::emergeSector and remove the exception throwing version of the method along with the "NoEx" suffixes in the names of these methods.
2019-08-13Better F6 profiler (#8750)SmallJoker
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-10Merge pull request #8776 from osjc/FixGetNodeJozef Behran
Finish getNode cleanup
2018-11-28Move client-specific files to 'src/client' (#7902)Quentin Bazin
Update Android.mk Remove 'src/client' from include_directories