mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-12 22:17:26 +01:00
internal/builtinshader: move a clearing shader to builtinshader
This commit is contained in:
parent
ca9a80600d
commit
d7df5ebcbd
@ -104,13 +104,7 @@ func init() {
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
wg.Go(func() error {
|
wg.Go(func() error {
|
||||||
ir, err := graphics.CompileShader([]byte(`//kage:unit pixels
|
ir, err := graphics.CompileShader([]byte(builtinshader.ClearShaderSource))
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
|
|
||||||
return vec4(0)
|
|
||||||
}`))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("atlas: compiling the clear shader failed: %w", err)
|
return fmt.Errorf("atlas: compiling the clear shader failed: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -188,3 +188,12 @@ func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
|
|||||||
return mix(mix(c0, c1, rate.x), mix(c2, c3, rate.x), rate.y)
|
return mix(mix(c0, c1, rate.x), mix(c2, c3, rate.x), rate.y)
|
||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
|
|
||||||
|
var ClearShaderSource = []byte(`//kage:unit pixels
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
|
||||||
|
return vec4(0)
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
Loading…
Reference in New Issue
Block a user