Commit Graph

17 Commits

Author SHA1 Message Date
Hajime Hoshi
20ef839e03 all: rename arguments in Fragment
Updates #2767
2023-09-21 01:35:57 +09:00
Hajime Hoshi
db34930ae8 internal/graphics: add built-in Kage functions
This change adds these Kage functions:

* imageDstOrigin
* imageDstSrc
* imageSrcNOrigin
* imageSrcNSrc

and deprecates these functions:

* imageDstRegionOnTexture
* imageSrcRegionOnTexture

Closes #1870
2023-08-28 15:06:45 +09:00
Hajime Hoshi
63df6168d9 internal/shader: use plural forms for Kage compiler directives
This change renames

```
//kage:unit texel
//kage:unit pixel
```

to

```
//kage:unit texels
//kage:unit pixels
```

.

Closes #2717
2023-08-01 11:41:38 +09:00
Hajime Hoshi
49582519c1 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
2023-04-23 22:11:57 +09:00
Hajime Hoshi
01bb42526a examples/shader: refactoring 2023-04-23 16:29:23 +09:00
Hajime Hoshi
1c14ba8eeb examples/shader: add comments
Updates #1431
2023-04-13 14:16:55 +09:00
Hajime Hoshi
0776a54712 examples/shader: remove comments 2023-04-13 14:10:34 +09:00
Hajime Hoshi
2d6e13cda4 examples/shader: bug fix: wrong usages of position
Closes #2638
Updates #1431
2023-04-13 02:02:15 +09:00
Hajime Hoshi
760e6b9ebd examples/shader: bug fix: use pixels instead of texels for offsets
Closes #2483
2022-12-03 22:46:10 +09:00
Artem Yadelskyi
5b53cef59e
all: remove old // +build comments (#2431)
Closes #2325
2022-11-03 12:55:14 +09:00
Hajime Hoshi
a615be69c7 examples: Add //go:build 2021-06-24 21:49:37 +09:00
Hajime Hoshi
e406ebb1aa ebiten: Rename imageSrcTextureRegion -> imageSrcRegionOnTexture
Updates #1325
2020-09-19 19:36:53 +09:00
Hajime Hoshi
9f7d6962ff ebiten: Rename shader functions to get colors from textures
Updates #1325
2020-09-19 19:01:05 +09:00
Hajime Hoshi
d2cfed7558 examples/shader: Remove an unused variable
Updates #1328
2020-09-01 23:50:19 +09:00
Hajime Hoshi
dd7b0d81ae ebiten: Rename shader builtin functions
* imageSrcTextureSourceRegion -> imageSrcTextureRegion
 * image[N]TextureAt -> imageSrc[N]At
 * image[N]TextureBoundsAt -> imageSrc[N]BoundsAt

Updates #1325
2020-09-01 21:31:50 +09:00
Hajime Hoshi
05a1c2faa1 examples/shader: Always use 1 for an alpha
This is necessary to keep the color pre-multiplied
2020-08-16 02:34:21 +09:00
Hajime Hoshi
a1d278b097 examples/shader: Add water.go
Updates #1284
2020-08-15 21:36:13 +09:00