Commit Graph

8 Commits

Author SHA1 Message Date
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
311aa7dcf8 all: use Kage shaders in internal packages
Updates #2369
2022-10-02 19:17:09 +09:00
Hajime Hoshi
5290605b2d internal/atlas: add comments 2022-06-08 11:18:08 +09:00
Hajime Hoshi
9ee56ac320 inetrnal/atlas: remove unnecessary (and risky) locks 2022-06-08 10:05:15 +09:00
Hajime Hoshi
3b6a080519 internal/atlas: bug fix: use the global lock for shaders
Closes #2129
2022-06-08 10:00:31 +09:00
Hajime Hoshi
6710808cd1 ebiten: compile shaders at NewShader
Closes #2035
2022-04-04 02:52:57 +09:00
Hajime Hoshi
81b9f91f86 internal/graphicscommand: compile shaders lazily
With DirectX, the graphics driver cannot be determined until the
main loop starts, as a transparent window cannot be treated with
DirectX so far. On the other hand, compiling shaders requires a
graphics driver as it requires information about Y directions of
NDCs and framebuffers.

This change delays compiling shaders until the graphics commands
are actually executed in the main loop.

Updates #1007
Updates #2019
2022-03-21 21:09:02 +09:00
Hajime Hoshi
ec677a258f Rename internal/shareable -> internal/atlas
Also the terms are renamed:

 * shared -> on an atlas
 * not shared -> isolated

Closes #1529
2021-03-12 00:22:08 +09:00