diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-01-03 15:15:32 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-01-04 12:43:54 +0300 |
commit | c79216d77df77e10f7ee3fed17836c77eb29da54 (patch) | |
tree | fbe99933aec3cbabe0bf8949f751dafc4732b23a /source/blender/gpu/intern/gpu_framebuffer.c | |
parent | 6b2989ae7524f6728aa4cdfd2134fbf3dcd31315 (diff) |
GPU_offscreen: Add option for high bit depth.
This way we can render in HDR and read the real pixel values.
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index 6830e73cb03..09013cd29bd 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -650,7 +650,7 @@ struct GPUOffScreen { GPUTexture *depth; }; -GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, char err_out[256]) +GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, bool high_bitdepth, char err_out[256]) { GPUOffScreen *ofs; @@ -683,7 +683,12 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, char err_ return NULL; } - ofs->color = GPU_texture_create_2D_multisample(width, height, NULL, samples, err_out); + if (high_bitdepth) { + ofs->color = GPU_texture_create_2D_custom_multisample(width, height, 4, GPU_RGBA16F, NULL, samples, err_out); + } + else { + ofs->color = GPU_texture_create_2D_multisample(width, height, NULL, samples, err_out); + } if (!ofs->color) { GPU_offscreen_free(ofs); return NULL; |