Allow using rgb32 and rgb16 for render to texture when alpha-bits is 0

This commit is contained in:
rdb 2014-12-06 14:00:17 +01:00
parent cabe17abdb
commit 9567247c9a

View File

@ -673,13 +673,22 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
if (_fb_properties.get_float_color()) { if (_fb_properties.get_float_color()) {
tex->set_component_type(Texture::T_float); tex->set_component_type(Texture::T_float);
} }
if (_fb_properties.get_color_bits() > 16 * 3) { if (_fb_properties.get_alpha_bits() == 0) {
tex->set_format(Texture::F_rgba32); if (_fb_properties.get_color_bits() > 16 * 3) {
tex->set_component_type(Texture::T_float); tex->set_format(Texture::F_rgb32);
} else if (_fb_properties.get_color_bits() > 8 * 3) { } else if (_fb_properties.get_color_bits() > 8 * 3) {
tex->set_format(Texture::F_rgba16); tex->set_format(Texture::F_rgb16);
} else {
tex->set_format(Texture::F_rgb);
}
} else { } else {
tex->set_format(Texture::F_rgba); if (_fb_properties.get_color_bits() > 16 * 3) {
tex->set_format(Texture::F_rgba32);
} else if (_fb_properties.get_color_bits() > 8 * 3) {
tex->set_format(Texture::F_rgba16);
} else {
tex->set_format(Texture::F_rgba);
}
} }
} }
} }