Sat, 02 Aug 2025 21:43:39 +0200
add a frame to the main scene + implement the necessary asc_rectangle_set_bounds() function
16
c5dde81b6fb2
add text rendering and demo FPS counter
Mike Becker <universe@uap-core.de>
parents:
15
diff
changeset
|
1 | layout(location = 0) out vec4 diffuse; |
88
6234b7ea48f3
add support for 2d textures in sprite shader - fixes #386
Mike Becker <universe@uap-core.de>
parents:
50
diff
changeset
|
2 | in vec2 uvcoord; |
15
362b7659dc76
add shader loading and unloading
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
3 | |
242 | 4 | uniform sampler2D map_albedo; |
5 | uniform sampler2D map_color; | |
6 | uniform vec4 color; | |
15
362b7659dc76
add shader loading and unloading
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
7 | |
362b7659dc76
add shader loading and unloading
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
8 | void main(void) { |
242 | 9 | // TODO: use greyscale texture instead |
10 | vec4 color_map_pixel = texture(map_color, uvcoord); | |
11 | if (color_map_pixel.a > 0) { | |
12 | diffuse = color * color_map_pixel * texture(map_albedo, uvcoord); | |
13 | } else { | |
14 | diffuse = texture(map_albedo, uvcoord); | |
15 | } | |
15
362b7659dc76
add shader loading and unloading
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
16 | } |