mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 00:16:15 +00:00
gpu: add linear gradient
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
@@ -70,7 +70,7 @@ func generate() error {
|
||||
if ext := filepath.Ext(shader); ext != ".vert" && ext != ".frag" {
|
||||
continue
|
||||
}
|
||||
const nvariants = 2
|
||||
const nvariants = 3
|
||||
var variants [nvariants]struct {
|
||||
backend.ShaderSources
|
||||
hlslSrc string
|
||||
@@ -80,6 +80,10 @@ func generate() error {
|
||||
FetchColorExpr: `_color`,
|
||||
Header: `layout(binding=0) uniform Color { vec4 _color; };`,
|
||||
},
|
||||
{
|
||||
FetchColorExpr: `mix(_color1, _color2, clamp(vUV.x, 0.0, 1.0))`,
|
||||
Header: `layout(binding=0) uniform Gradient { vec4 _color1; vec4 _color2; };`,
|
||||
},
|
||||
{
|
||||
FetchColorExpr: `texture(tex, vUV)`,
|
||||
Header: `layout(binding=0) uniform sampler2D tex;`,
|
||||
|
||||
Reference in New Issue
Block a user