mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-10-21 06:59:29 +08:00
all: add a compiler directive kage:unit
This change adds a new compiler directive 'kage:unit' to Kage. This takes one of these two values: 'pixel' and 'texel'. The default value is 'texel'. With the pixel-unit mode, all the built-in functions treats pixels instead of texels, and the texCoord argument of Fragment is in pixels. This simplifies shader programs as programs no longer have the notion of texels. With the texel-unit mode, the behavior is the same as the current behavior. Closes #1431
This commit is contained in:
@@ -14,11 +14,12 @@
|
||||
|
||||
//go:build ignore
|
||||
|
||||
//kage:unit pixel
|
||||
|
||||
package main
|
||||
|
||||
var Time float
|
||||
var Cursor vec2
|
||||
var ScreenSize vec2
|
||||
|
||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
// Triangle wave to go 0-->1-->0...
|
||||
|
Reference in New Issue
Block a user