Allow/require renderers to enable alpha blending when needed. Fixes voxel shadow issues.

This commit is contained in:
Paul Chote
2013-06-14 06:35:38 +12:00
parent 4c22193446
commit 52335a37bf
11 changed files with 28 additions and 18 deletions

View File

@@ -104,7 +104,6 @@ namespace OpenRA.Renderer.Glsl
++nextTexUnit;
}
}
}
public void Render(Action a)
@@ -119,17 +118,9 @@ namespace OpenRA.Renderer.Glsl
Gl.glBindTexture(Gl.GL_TEXTURE_2D, ((Texture)kv.Value).ID);
}
/* configure blend state */
ErrorHandler.CheckGlError();
// TODO: Only enable alpha blending if we need it
Gl.glEnable(Gl.GL_BLEND);
ErrorHandler.CheckGlError();
Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);
ErrorHandler.CheckGlError();
a();
ErrorHandler.CheckGlError();
Gl.glDisable(Gl.GL_BLEND);
ErrorHandler.CheckGlError();
}
public void SetTexture(string name, ITexture t)