diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2018-05-02 21:39:30 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2018-05-02 21:39:30 +0100 |
commit | 362f70b04da8f8e9c0c159527bce7da65591c260 (patch) | |
tree | 4547bf3ad23c663b4cae20a56560aab235bd03c1 | |
parent | 0ce30b0e09621694430e3afe25c8209b147064de (diff) | |
download | faqe-362f70b04da8f8e9c0c159527bce7da65591c260.tar.gz faqe-362f70b04da8f8e9c0c159527bce7da65591c260.tar.xz faqe-362f70b04da8f8e9c0c159527bce7da65591c260.zip |
Cleanup: License headers, spacing, naming
Rename vnorm to fnorm (fragment normal).
Change shader license headers to C++ style comments.
Fix spacing for PI define in faqe.c.
Add missing license headers.
-rw-r--r-- | ensize.c | 4 | ||||
-rw-r--r-- | ensize.h | 4 | ||||
-rw-r--r-- | faqe.c | 2 | ||||
-rw-r--r-- | frag.glsl | 10 | ||||
-rw-r--r-- | ieee754.c | 4 | ||||
-rw-r--r-- | ieee754.h | 4 | ||||
-rw-r--r-- | mtl.c | 4 | ||||
-rw-r--r-- | mtl.h | 4 | ||||
-rw-r--r-- | test_ieee754.c | 4 | ||||
-rw-r--r-- | tex.c | 4 | ||||
-rw-r--r-- | vert.glsl | 10 |
11 files changed, 45 insertions, 9 deletions
@@ -1,3 +1,7 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #include <assert.h> #include "ensize.h" @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #ifndef ENSIZE_H #define ENSIZE_H @@ -18,7 +18,7 @@ enum { HEIGHT = 600, }; -# define PI 3.14159265358979323846 +#define PI 3.14159265358979323846 #define FOV (PI * 0.5) void viewport(GLuint proj, int width, int height) @@ -1,8 +1,10 @@ -// Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> -// SPDX-License-Identifier: MIT +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #version 330 core out vec4 color; -in vec3 vnorm; +in vec3 fnorm; in vec3 fpos; in vec2 fuv; in vec3 lipos; @@ -16,7 +18,7 @@ void main() float amb = 0.1; - vec3 norm = normalize(vnorm); + vec3 norm = normalize(fnorm); vec3 lidir = normalize(lipos - fpos); float dif = max(dot(norm, lidir), 0.0); @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #include <assert.h> #include <math.h> #include <stdbool.h> @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #ifndef IEEE754_H #define IEEE754_H @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #include <assert.h> #include <stdio.h> #include <string.h> @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #ifndef MTL_H #define MTL_H diff --git a/test_ieee754.c b/test_ieee754.c index 44873c9..85a1c95 100644 --- a/test_ieee754.c +++ b/test_ieee754.c @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #include <math.h> #include <stdint.h> #include <stdio.h> @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #include <assert.h> #include <png.h> #include <stdlib.h> @@ -1,11 +1,13 @@ -// Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> -// SPDX-License-Identifier: MIT +/* + * Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> + * SPDX-License-Identifier: MIT + */ #version 330 core layout (location = 0) in vec3 pos; layout (location = 1) in vec3 norm; layout (location = 2) in vec2 uv; -out vec3 vnorm; +out vec3 fnorm; out vec3 fpos; out vec2 fuv; out vec3 lipos; @@ -22,6 +24,6 @@ void main() fpos = vec3(view * model * vec4(pos, 1.0)); fuv = uv; // TODO: Try to work out how to only do this ONCE in C or see if it matters - vnorm = mat3(transpose(inverse(view * model))) * norm; + fnorm = mat3(transpose(inverse(view * model))) * norm; lipos = vec3(view * vec4(light, 1.0)); } |