byte-engine 0.1.0

A composable Rust game engine focused on graphics, input, audio, physics, and retained UI.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
BloomParameters: struct {
	prefilter: vec4f[1],
	blur_data: vec4f[1],
}

source_texture: descriptor<Texture2D, 0, read>;
result_texture: descriptor<StorageImage<rgba16>, 1, write>;
bloom_parameters: descriptor<BloomParameters, 2, read>;

main: fn() -> void {
	let coord: vec2u = thread_id();
	guard_image_bounds(result_texture, coord);
	let result_size: vec2u = image_size(result_texture);
	let source_size: vec2u = texture_size(source_texture);
	let uv: vec2f = (vec2f(f32(coord.x), f32(coord.y)) + vec2f(0.5, 0.5)) / vec2f(f32(result_size.x), f32(result_size.y));
	let center: vec4f = texture_lod(source_texture, uv);
	write(result_texture, coord, vec4f(center.x, center.y, center.z, 1.0));
}