Revert "internal/graphicsdriver: bug fix: render semi-transparent vectors correctly"

This reverts commit 202f642395.

Reason: TestImageEvenOdd failed

Updates #1933
This commit is contained in:
Hajime Hoshi 2022-01-06 03:19:46 +09:00
parent 202f642395
commit 3b0ce21a56
5 changed files with 7 additions and 8 deletions

View File

@ -43,7 +43,7 @@ const (
screenHeight = 480 screenHeight = 480
) )
func drawEbitenText(screen *ebiten.Image, counter int) { func drawEbitenText(screen *ebiten.Image) {
var path vector.Path var path vector.Path
// E // E
@ -119,7 +119,6 @@ func drawEbitenText(screen *ebiten.Image, counter int) {
vs[i].ColorR = 0xdb / float32(0xff) vs[i].ColorR = 0xdb / float32(0xff)
vs[i].ColorG = 0x56 / float32(0xff) vs[i].ColorG = 0x56 / float32(0xff)
vs[i].ColorB = 0x20 / float32(0xff) vs[i].ColorB = 0x20 / float32(0xff)
vs[i].ColorA = float32((counter/30)%2)/2 + 0.5
} }
screen.DrawTriangles(vs, is, emptySubImage, op) screen.DrawTriangles(vs, is, emptySubImage, op)
} }
@ -246,7 +245,7 @@ func (g *Game) Update() error {
func (g *Game) Draw(screen *ebiten.Image) { func (g *Game) Draw(screen *ebiten.Image) {
screen.Fill(color.White) screen.Fill(color.White)
drawEbitenText(screen, g.counter) drawEbitenText(screen)
drawEbitenLogo(screen, 20, 90) drawEbitenLogo(screen, 20, 90)
drawArc(screen, g.counter) drawArc(screen, g.counter)
drawWave(screen, g.counter) drawWave(screen, g.counter)

View File

@ -737,13 +737,13 @@ func (g *Graphics) Initialize() error {
BackFaceStencil: mtl.StencilDescriptor{ BackFaceStencil: mtl.StencilDescriptor{
StencilFailureOperation: mtl.StencilOperationKeep, StencilFailureOperation: mtl.StencilOperationKeep,
DepthFailureOperation: mtl.StencilOperationKeep, DepthFailureOperation: mtl.StencilOperationKeep,
DepthStencilPassOperation: mtl.StencilOperationZero, DepthStencilPassOperation: mtl.StencilOperationKeep,
StencilCompareFunction: mtl.CompareFunctionNotEqual, StencilCompareFunction: mtl.CompareFunctionNotEqual,
}, },
FrontFaceStencil: mtl.StencilDescriptor{ FrontFaceStencil: mtl.StencilDescriptor{
StencilFailureOperation: mtl.StencilOperationKeep, StencilFailureOperation: mtl.StencilOperationKeep,
DepthFailureOperation: mtl.StencilOperationKeep, DepthFailureOperation: mtl.StencilOperationKeep,
DepthStencilPassOperation: mtl.StencilOperationZero, DepthStencilPassOperation: mtl.StencilOperationKeep,
StencilCompareFunction: mtl.CompareFunctionNotEqual, StencilCompareFunction: mtl.CompareFunctionNotEqual,
}, },
}) })

View File

@ -520,6 +520,6 @@ func (c *context) beginStencilWithEvenOddRule() {
func (c *context) endStencilWithEvenOddRule() { func (c *context) endStencilWithEvenOddRule() {
gl.StencilFunc(gl.NOTEQUAL, 0x00, 0xff) gl.StencilFunc(gl.NOTEQUAL, 0x00, 0xff)
gl.StencilOp(gl.KEEP, gl.KEEP, gl.ZERO) gl.StencilOp(gl.KEEP, gl.KEEP, gl.KEEP)
gl.ColorMask(true, true, true, true) gl.ColorMask(true, true, true, true)
} }

View File

@ -660,6 +660,6 @@ func (c *context) beginStencilWithEvenOddRule() {
func (c *context) endStencilWithEvenOddRule() { func (c *context) endStencilWithEvenOddRule() {
gl := c.gl gl := c.gl
gl.stencilFunc.Invoke(gles.NOTEQUAL, 0x00, 0xff) gl.stencilFunc.Invoke(gles.NOTEQUAL, 0x00, 0xff)
gl.stencilOp.Invoke(gles.KEEP, gles.KEEP, gles.ZERO) gl.stencilOp.Invoke(gles.KEEP, gles.KEEP, gles.KEEP)
gl.colorMask.Invoke(true, true, true, true) gl.colorMask.Invoke(true, true, true, true)
} }

View File

@ -488,6 +488,6 @@ func (c *context) beginStencilWithEvenOddRule() {
func (c *context) endStencilWithEvenOddRule() { func (c *context) endStencilWithEvenOddRule() {
c.ctx.StencilFunc(gles.NOTEQUAL, 0x00, 0xff) c.ctx.StencilFunc(gles.NOTEQUAL, 0x00, 0xff)
c.ctx.StencilOp(gles.KEEP, gles.KEEP, gles.ZERO) c.ctx.StencilOp(gles.KEEP, gles.KEEP, gles.KEEP)
c.ctx.ColorMask(true, true, true, true) c.ctx.ColorMask(true, true, true, true)
} }