From 5cfe2b89e797ed553f5a27d4baed7fc9af0c231c Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 12 Mar 2016 21:01:57 +0100 Subject: [PATCH] Support getting FBO attachment with only 8 red bits --- makepanda/config.in | 2 +- panda/src/display/frameBufferProperties.cxx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/makepanda/config.in b/makepanda/config.in index 9b0943918d..e61f73f04b 100755 --- a/makepanda/config.in +++ b/makepanda/config.in @@ -41,7 +41,7 @@ framebuffer-software #f # consistent with the other framebuffer requirements. depth-bits 1 -color-bits 1 +color-bits 1 1 1 alpha-bits 0 stencil-bits 0 multisamples 0 diff --git a/panda/src/display/frameBufferProperties.cxx b/panda/src/display/frameBufferProperties.cxx index 5cb0f05973..4d0751a7d2 100644 --- a/panda/src/display/frameBufferProperties.cxx +++ b/panda/src/display/frameBufferProperties.cxx @@ -138,6 +138,9 @@ get_default() { break; case 1: default_props.set_color_bits(color_bits[0]); + default_props.set_red_bits(1); + default_props.set_green_bits(1); + default_props.set_blue_bits(1); break; case 3: default_props.set_color_bits(color_bits[0] + color_bits[1] + color_bits[2]); @@ -649,13 +652,14 @@ setup_color_texture(Texture *tex) const { // as the below one would be generated dynamically by the GSG to reflect the // formats that are supported for render-to-texture. - static const int num_formats = 13; + static const int num_formats = 15; static const struct { unsigned char color_bits, red_bits, green_bits, blue_bits, alpha_bits; bool has_float; Texture::Format format; } formats[num_formats] = { - // { 1, 1, 0, 0, 0, false, Texture::F_red}, + { 1, 1, 0, 0, 0, false, Texture::F_red }, + { 1, 1, 1, 0, 0, false, Texture::F_rg }, { 1, 1, 1, 1, 0, false, Texture::F_rgb }, { 1, 1, 1, 1, 1, false, Texture::F_rgba }, { 24, 8, 8, 8, 0, false, Texture::F_rgb8 },