mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
glgsg: Fix half float color buffers with GLES 3 / WebGL 2
Part of fix for #1296
This commit is contained in:
parent
d2fc682fd7
commit
0538106d52
@ -857,6 +857,26 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
|
|||||||
gl_format = GL_DEPTH_COMPONENT16;
|
gl_format = GL_DEPTH_COMPONENT16;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifndef OPENGLES_1
|
||||||
|
case RTP_aux_hrgba_0:
|
||||||
|
case RTP_aux_hrgba_1:
|
||||||
|
case RTP_aux_hrgba_2:
|
||||||
|
case RTP_aux_hrgba_3:
|
||||||
|
case RTP_aux_float_0:
|
||||||
|
case RTP_aux_float_1:
|
||||||
|
case RTP_aux_float_2:
|
||||||
|
case RTP_aux_float_3:
|
||||||
|
if (glgsg->has_extension("GL_EXT_color_buffer_float")) {
|
||||||
|
if (slot >= RTP_aux_float_0 && slot <= RTP_aux_float_3) {
|
||||||
|
gl_format = GL_RGBA32F;
|
||||||
|
} else {
|
||||||
|
gl_format = GL_RGBA16F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (glgsg->has_extension("GL_EXT_color_buffer_half_float")) {
|
||||||
|
gl_format = GL_RGBA16F_EXT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
// NB: we currently use RTP_stencil to store the right eye for stereo.
|
// NB: we currently use RTP_stencil to store the right eye for stereo.
|
||||||
// case RTP_stencil: gl_format = GL_STENCIL_INDEX8; break
|
// case RTP_stencil: gl_format = GL_STENCIL_INDEX8; break
|
||||||
default:
|
default:
|
||||||
@ -914,9 +934,12 @@ bind_slot(int layer, bool rb_resize, Texture **attach, RenderTexturePlane slot,
|
|||||||
}
|
}
|
||||||
#ifndef OPENGLES_1
|
#ifndef OPENGLES_1
|
||||||
} else if (_fb_properties.get_float_color() &&
|
} else if (_fb_properties.get_float_color() &&
|
||||||
_fb_properties.get_color_bits() > 16 * 3 &&
|
|
||||||
glgsg->has_extension("GL_EXT_color_buffer_float")) {
|
glgsg->has_extension("GL_EXT_color_buffer_float")) {
|
||||||
gl_format = GL_RGBA32F_EXT;
|
if (_fb_properties.get_color_bits() > 16 * 3) {
|
||||||
|
gl_format = GL_RGBA32F;
|
||||||
|
} else {
|
||||||
|
gl_format = GL_RGBA16F;
|
||||||
|
}
|
||||||
} else if (_fb_properties.get_float_color() &&
|
} else if (_fb_properties.get_float_color() &&
|
||||||
glgsg->has_extension("GL_EXT_color_buffer_half_float")) {
|
glgsg->has_extension("GL_EXT_color_buffer_half_float")) {
|
||||||
gl_format = GL_RGBA16F_EXT;
|
gl_format = GL_RGBA16F_EXT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user