mirror of
https://github.com/glest/glest-source.git
synced 2025-08-23 00:12:49 +02:00
Fixed glow
This commit is contained in:
@@ -281,13 +281,13 @@ namespace Shared {
|
|||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
}
|
}
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
|
|
||||||
//glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, Vec4f(1.0f, 1.0f, 1.0f, alpha).ptr());
|
//glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, Vec4f(1.0f, 1.0f, 1.0f, alpha).ptr());
|
||||||
if (renderMode == rmNormal && mesh->getGlow() == true) {
|
if (renderMode == rmNormal && mesh->getGlow() == true) {
|
||||||
// glow on
|
// glow on
|
||||||
glDisable(GL_LIGHTING);
|
glBlendFunc(GL_ONE, GL_ONE);
|
||||||
}
|
} else
|
||||||
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
if (this->colorPickingMode == false) {
|
if (this->colorPickingMode == false) {
|
||||||
//set color
|
//set color
|
||||||
@@ -295,7 +295,7 @@ namespace Shared {
|
|||||||
Vec4f color(mesh->getDiffuseColor(), 1.f);
|
Vec4f color(mesh->getDiffuseColor(), 1.f);
|
||||||
glColor4fv(color.ptr());
|
glColor4fv(color.ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
//texture state
|
//texture state
|
||||||
const Texture2DGl *texture = static_cast<const Texture2DGl*>(mesh->getTexture(mtDiffuse));
|
const Texture2DGl *texture = static_cast<const Texture2DGl*>(mesh->getTexture(mtDiffuse));
|
||||||
if (texture != NULL && renderTextures) {
|
if (texture != NULL && renderTextures) {
|
||||||
@@ -429,11 +429,9 @@ namespace Shared {
|
|||||||
|
|
||||||
glDrawRangeElements(GL_TRIANGLES, 0, vertexCount - 1, indexCount, GL_UNSIGNED_INT, mesh->getIndices());
|
glDrawRangeElements(GL_TRIANGLES, 0, vertexCount - 1, indexCount, GL_UNSIGNED_INT, mesh->getIndices());
|
||||||
}
|
}
|
||||||
|
|
||||||
// glow
|
// glow
|
||||||
if (renderMode == rmNormal && mesh->getGlow() == true) {
|
if (renderMode == rmNormal && mesh->getGlow() == true) {
|
||||||
// glow off
|
// glow off
|
||||||
glEnable(GL_LIGHTING);
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
//assertions
|
//assertions
|
||||||
|
Reference in New Issue
Block a user