diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-02-25 16:24:31 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-02-25 16:24:31 +0300 |
commit | 2ffd53021761dd128ce4eb983a8cf82bc4796fbb (patch) | |
tree | 2ff293a2060314053634482d20e7354f1a0dbb21 /source/blender/draw | |
parent | 19de81afe52793ae9aa45d099f99a1392aceff2f (diff) |
EEVEE: Lookdev: Fix lookdev spheres positioning in viewport render
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lookdev.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c index 90977beb911..d39d2a61657 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.c +++ b/source/blender/draw/engines/eevee/eevee_lookdev.c @@ -78,7 +78,18 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, if (LOOK_DEV_OVERLAY_ENABLED(v3d)) { /* Viewport / Spheres size. */ - const rcti *rect = ED_region_visible_rect(draw_ctx->ar); + const rcti *rect; + rcti fallback_rect; + if (DRW_state_is_opengl_render()) { + const float *vp_size = DRW_viewport_size_get(); + fallback_rect.xmax = vp_size[0]; + fallback_rect.ymax = vp_size[1]; + fallback_rect.xmin = fallback_rect.ymin = 0; + rect = &fallback_rect; + } + else { + rect = ED_region_visible_rect(draw_ctx->ar); + } /* Make the viewport width scale the lookdev spheres a bit. * Scale between 1000px and 2000px. */ |