Allow/require renderers to enable alpha blending when needed. Fixes voxel shadow issues.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user