mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Take 3D resolution scaling into account for mesh LOD
(cherry picked from commit ac4ca89000)
This commit is contained in:
parent
88475cfba9
commit
05eeb8783c
1 changed files with 6 additions and 1 deletions
|
|
@ -964,7 +964,12 @@ void RendererSceneRenderRD::render_scene(const Ref<RenderSceneBuffers> &p_render
|
||||||
scene_data.z_far = p_camera_data->main_projection.get_z_far();
|
scene_data.z_far = p_camera_data->main_projection.get_z_far();
|
||||||
|
|
||||||
// this should be the same for all cameras..
|
// this should be the same for all cameras..
|
||||||
scene_data.lod_distance_multiplier = p_camera_data->main_projection.get_lod_multiplier();
|
const float lod_distance_multiplier = p_camera_data->main_projection.get_lod_multiplier();
|
||||||
|
|
||||||
|
// Also, take into account resolution scaling for the multiplier, since we have more leeway with quality
|
||||||
|
// degradation visibility. Conversely, allow upwards scaling, too, for increased mesh detail at high res.
|
||||||
|
const float scaling_3d_scale = GLOBAL_GET("rendering/scaling_3d/scale");
|
||||||
|
scene_data.lod_distance_multiplier = lod_distance_multiplier * (1.0 / scaling_3d_scale);
|
||||||
|
|
||||||
if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_DISABLE_LOD) {
|
if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_DISABLE_LOD) {
|
||||||
scene_data.screen_mesh_lod_threshold = 0.0;
|
scene_data.screen_mesh_lod_threshold = 0.0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue