mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Seamless cube map sampling in OpenGL
This commit is contained in:
parent
8d3f7d62f4
commit
df30721f79
@ -634,12 +634,19 @@ reset() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
_cube_map_seamless = false;
|
||||||
#ifdef OPENGLES_2
|
#ifdef OPENGLES_2
|
||||||
_supports_cube_map = true;
|
_supports_cube_map = true;
|
||||||
#else
|
#else
|
||||||
_supports_cube_map =
|
_supports_cube_map =
|
||||||
has_extension("GL_ARB_texture_cube_map") || is_at_least_gl_version(1, 3) ||
|
has_extension("GL_ARB_texture_cube_map") || is_at_least_gl_version(1, 3) ||
|
||||||
has_extension("GL_OES_texture_cube_map");
|
has_extension("GL_OES_texture_cube_map");
|
||||||
|
|
||||||
|
if (_supports_cube_map && gl_cube_map_seamless) {
|
||||||
|
if (is_at_least_gl_version(3, 2) || has_extension("GL_ARB_seamless_cube_map")) {
|
||||||
|
_cube_map_seamless = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_supports_compressed_texture = false;
|
_supports_compressed_texture = false;
|
||||||
@ -2214,6 +2221,10 @@ begin_frame(Thread *current_thread) {
|
|||||||
}
|
}
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
||||||
|
if (_cube_map_seamless) {
|
||||||
|
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
|
||||||
|
}
|
||||||
|
|
||||||
report_my_gl_errors();
|
report_my_gl_errors();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -579,6 +579,7 @@ public:
|
|||||||
PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC _glCompressedTexSubImage3D;
|
PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC _glCompressedTexSubImage3D;
|
||||||
PFNGLGETCOMPRESSEDTEXIMAGEPROC _glGetCompressedTexImage;
|
PFNGLGETCOMPRESSEDTEXIMAGEPROC _glGetCompressedTexImage;
|
||||||
|
|
||||||
|
bool _cube_map_seamless;
|
||||||
bool _supports_bgr;
|
bool _supports_bgr;
|
||||||
bool _supports_rescale_normal;
|
bool _supports_rescale_normal;
|
||||||
|
|
||||||
|
@ -164,6 +164,15 @@ ConfigVariableBool gl_separate_specular_color
|
|||||||
"words, the specular highlight will be unmodulated by the "
|
"words, the specular highlight will be unmodulated by the "
|
||||||
"color of the texture."));
|
"color of the texture."));
|
||||||
|
|
||||||
|
ConfigVariableBool gl_cube_map_seamless
|
||||||
|
("gl-cube-map-seamless", true,
|
||||||
|
PRC_DESC("This configures Panda to try and enable seamless cube map "
|
||||||
|
"sampling when supported. This will help to remove seams "
|
||||||
|
"that show up at cube map edges, especially at lower "
|
||||||
|
"resolutions. On by default; disable if you suspect that "
|
||||||
|
"this is causing problems or if you simply don't need the "
|
||||||
|
"functionality."));
|
||||||
|
|
||||||
extern ConfigVariableBool gl_parallel_arrays;
|
extern ConfigVariableBool gl_parallel_arrays;
|
||||||
|
|
||||||
void CLP(init_classes)() {
|
void CLP(init_classes)() {
|
||||||
@ -189,4 +198,3 @@ void CLP(init_classes)() {
|
|||||||
// since we won't know those until we create a graphics context (and
|
// since we won't know those until we create a graphics context (and
|
||||||
// the answer may be different for different contexts).
|
// the answer may be different for different contexts).
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ extern ConfigVariableBool gl_matrix_palette;
|
|||||||
extern ConfigVariableBool gl_force_no_error;
|
extern ConfigVariableBool gl_force_no_error;
|
||||||
extern ConfigVariableBool gl_force_no_flush;
|
extern ConfigVariableBool gl_force_no_flush;
|
||||||
extern ConfigVariableBool gl_separate_specular_color;
|
extern ConfigVariableBool gl_separate_specular_color;
|
||||||
|
extern ConfigVariableBool gl_cube_map_seamless;
|
||||||
|
|
||||||
extern EXPCL_GL void CLP(init_classes)();
|
extern EXPCL_GL void CLP(init_classes)();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user