From e77b01d4b5504cea08a3f88cf8502897d868a1d3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 18:04:21 -0300 Subject: Add glTF scene rendering, resource setup and 9P controls --- src/gltf_render/basic.frag | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/gltf_render/basic.frag (limited to 'src/gltf_render/basic.frag') diff --git a/src/gltf_render/basic.frag b/src/gltf_render/basic.frag new file mode 100644 index 0000000..73209ea --- /dev/null +++ b/src/gltf_render/basic.frag @@ -0,0 +1,10 @@ +#version 450 +layout(location = 0) in vec3 world_normal; +layout(location = 1) in vec4 color; +layout(location = 0) out vec4 out_color; +void main() { + vec3 normal = normalize(world_normal); + if (!gl_FrontFacing) normal = -normal; + float light = 0.42 + 0.58 * max(dot(normal, normalize(vec3(-0.45, 0.85, 0.3))), 0.0); + out_color = vec4(pow(max(color.rgb * light, vec3(0.0)), vec3(1.0 / 2.2)), 1.0); +} -- cgit v1.3