set global alpha

This commit is contained in:
Thomas Friedel 2019-04-18 21:13:06 +02:00
parent 287ff8905f
commit abfc73419b
2 changed files with 2 additions and 0 deletions

View file

@ -38,6 +38,7 @@ func (b *GoGLBackend) Clip(pts [][2]float64) {
gl.UseProgram(b.sr.ID)
gl.Uniform4f(b.sr.Color, 1, 1, 1, 1)
gl.Uniform2f(b.sr.CanvasSize, float32(b.fw), float32(b.fh))
gl.Uniform1f(b.sr.GlobalAlpha, 1)
gl.EnableVertexAttribArray(b.sr.Vertex)
gl.ColorMask(false, false, false, false)

View file

@ -115,6 +115,7 @@ func (b *GoGLBackend) Fill(style *backendbase.FillStyle, pts [][2]float64) {
gl.UseProgram(b.sr.ID)
gl.Uniform4f(b.sr.Color, 0, 0, 0, 0)
gl.Uniform2f(b.sr.CanvasSize, float32(b.fw), float32(b.fh))
gl.Uniform1f(b.sr.GlobalAlpha, 1)
gl.EnableVertexAttribArray(b.sr.Vertex)
gl.VertexAttribPointer(b.sr.Vertex, 2, gl.FLOAT, false, 0, nil)