add gl-support-rescale-normal

This commit is contained in:
David Rose 2006-01-13 16:02:17 +00:00
parent 42b082e5b9
commit 9dab4ee9ea
2 changed files with 31 additions and 4 deletions

View File

@ -461,7 +461,8 @@ reset() {
_supports_bgr =
has_extension("GL_EXT_bgra") || is_at_least_version(1, 2);
_supports_rescale_normal =
has_extension("GL_EXT_rescale_normal") || is_at_least_version(1, 2);
CLP(support_rescale_normal) &&
(has_extension("GL_EXT_rescale_normal") || is_at_least_version(1, 2));
_supports_multisample =
has_extension("GL_ARB_multisample");
@ -4840,8 +4841,14 @@ do_auto_rescale_normal() {
if (_external_transform->has_identity_scale()) {
// If there's no scale at all, don't do anything.
GLP(Disable)(GL_NORMALIZE);
if (GLCAT.is_spam()) {
GLCAT.spam() << "glDisable(GL_NORMALIZE)\n";
}
if (_supports_rescale_normal && support_rescale_normal) {
GLP(Disable)(GL_RESCALE_NORMAL);
if (GLCAT.is_spam()) {
GLCAT.spam() << "glDisable(GL_RESCALE_NORMAL)\n";
}
}
} else if (_external_transform->has_uniform_scale()) {
@ -4849,15 +4856,28 @@ do_auto_rescale_normal() {
if (_supports_rescale_normal && support_rescale_normal) {
GLP(Enable)(GL_RESCALE_NORMAL);
GLP(Disable)(GL_NORMALIZE);
if (GLCAT.is_spam()) {
GLCAT.spam() << "glEnable(GL_RESCALE_NORMAL)\n";
GLCAT.spam() << "glDisable(GL_NORMALIZE)\n";
}
} else {
GLP(Enable)(GL_NORMALIZE);
if (GLCAT.is_spam()) {
GLCAT.spam() << "glEnable(GL_NORMALIZE)\n";
}
}
} else {
// If there's a non-uniform scale, normalize everything.
GLP(Enable)(GL_NORMALIZE);
if (GLCAT.is_spam()) {
GLCAT.spam() << "glEnable(GL_NORMALIZE)\n";
}
if (_supports_rescale_normal && support_rescale_normal) {
GLP(Disable)(GL_RESCALE_NORMAL);
if (GLCAT.is_spam()) {
GLCAT.spam() << "glDisable(GL_RESCALE_NORMAL)\n";
}
}
}
}

View File

@ -31,9 +31,16 @@ ConfigVariableBool CLP(ignore_clamp)
ConfigVariableBool CLP(support_clamp_to_border)
("gl-support-clamp-to-border", true,
PRC_DESC("Configure this true to enable the use of the clamp_to_border "
"if the GL claims to support it, or false not to use it even "
"if it appears to be available. (On some OpenGL drivers, "
"enabling this mode can force software rendering.)"));
"extension if the GL claims to support it, or false not to "
"use it even if it appears to be available. (On some OpenGL "
"drivers, enabling this mode can force software rendering.)"));
ConfigVariableBool CLP(support_rescale_normal)
("gl-support-rescale-normal", true,
PRC_DESC("Configure this true to enable the use of the rescale_normal "
"extension if the GL claims to support it, or false not to use "
"it even if it appears to be available. (This appears to be "
"buggy on some drivers.)"));
ConfigVariableBool CLP(ignore_filters)
("gl-ignore-filters", false,