diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2022-08-11 21:41:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 21:41:37 +0200 |
commit | ff9118d103596dea8c5b0ffb5efd27fab60ee59d (patch) | |
tree | 0931a71764a4941c4ed30d8f9ff4fe89b880a4ca /servers/rendering/renderer_viewport.cpp | |
parent | 368446de552265926c17fa630e0009cc40b7f047 (diff) | |
parent | b06890c2b7f142de81a0d6f3623a7538bfc36fd0 (diff) |
Merge pull request #64225 from Calinou/3d-scaling-bilinear-use-negative-mipmap-bias
Diffstat (limited to 'servers/rendering/renderer_viewport.cpp')
-rw-r--r-- | servers/rendering/renderer_viewport.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index 118bf532b3..73b03966c5 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -138,7 +138,11 @@ void RendererViewport::_configure_3d_render_buffers(Viewport *p_viewport) { p_viewport->internal_size = Size2(render_width, render_height); - RSG::scene->render_buffers_configure(p_viewport->render_buffers, p_viewport->render_target, render_width, render_height, width, height, p_viewport->fsr_sharpness, p_viewport->texture_mipmap_bias, p_viewport->msaa, p_viewport->screen_space_aa, p_viewport->use_taa, p_viewport->use_debanding, p_viewport->get_view_count()); + // At resolution scales lower than 1.0, use negative texture mipmap bias + // to compensate for the loss of sharpness. + const float texture_mipmap_bias = log2f(MIN(scaling_3d_scale, 1.0)) + p_viewport->texture_mipmap_bias; + + RSG::scene->render_buffers_configure(p_viewport->render_buffers, p_viewport->render_target, render_width, render_height, width, height, p_viewport->fsr_sharpness, texture_mipmap_bias, p_viewport->msaa, p_viewport->screen_space_aa, p_viewport->use_taa, p_viewport->use_debanding, p_viewport->get_view_count()); } } } |