Conversation
Bump max cells to 32678 from 8000, allowing a much larger render distance for outdoor terrain. This commit also fixes MAX_HORIZON_PIECES, which may have been broken during a clang-format.
|
It's unclear to me without diving in the rendering code why decreasing the maximum number of horizon pieces increases the render distance. What happens there? |
The horizon distance change has nothing to do with the render distance. In the current // Sky defines
#define MAX_STARS 600 // how many stars in our sky
#define MAX_SATELLITES 5 // max satellites in our sky
#define MAX_HORIZON_PIECES \
16 // how many segments of the horizon
// there are around our sphereThe change just brings it inline like the rest. I'm not sure if it was broken or not, with the random backslash after a ton of spaces, but it was inconsistent. |
|
I was talking about the |
It's an increase, not a decrease. Original value was 8000, and in if (*ccount >= MAX_CELLS_TO_RENDER) {
mprintf((0, "Trying to render too many cells! Cell limit=%d\n", MAX_CELLS_TO_RENDER));
#ifndef NEWEDITOR
Detail_settings.Terrain_render_distance = 80.0 * TERRAIN_SIZE;
#endif
return;
}That's within the It's also used in |
|
Thanks for the clear explanation! |

Pull Request Type
Description
Bump max cells to 32678 from 8000, allowing a much larger render distance for outdoor terrain. This commit also fixes MAX_HORIZON_PIECES, which may have been broken during a clang-format.
Testing on Level 7 yielded no performance loss, and in fact revealed an existing bug with z-ranges where blue electricity effects from disabled turrets are visible overtop of terrain.
Related Issues
Fixes #280