This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /***********************************************/ | |
| /* Copyright (c) 2026 Belmu */ | |
| /* All Rights Reserved */ | |
| /***********************************************/ | |
| /* | |
| [References]: | |
| SCHOTT. (2021). Downloads for Optical Glass. https://www.schott.com/en-be/products/optical-glass-p1000267/downloads | |
| Ohara. (2025). Catalog Download. https://oharacorp.com/glass-catalog/ | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /********************************************************************************/ | |
| /* */ | |
| /* Copyright (C) 2026 Belmu */ | |
| /* */ | |
| /* This program is free software: you can redistribute it and/or modify */ | |
| /* it under the terms of the GNU General Public License as published by */ | |
| /* the Free Software Foundation, either version 3 of the License, or */ | |
| /* (at your option) any later version. */ | |
| /* */ | |
| /* This program is distributed in the hope that it will be useful, */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| [References]: | |
| ProofWiki. (2018). Definition:Inverse Sine/Complex. https://proofwiki.org/wiki/Definition:Inverse_Sine/Complex | |
| Jessie. (2021). open-source-utility-code. https://github.com/Jessie-LC/open-source-utility-code/blob/main/advanced/complexNumber.glsl | |
| Wikipedia. (2023). Trigonométrie complexe. https://fr.m.wikipedia.org/wiki/Trigonom%C3%A9trie_complexe | |
| */ | |
| struct complexFloat { | |
| float r; | |
| float i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| [References]: | |
| Museo Galileo. (2015). In-depth Ecliptic coordinates. https://catalogue.museogalileo.it/indepth/EclipticCoordinates.html#:~:text=The%20first%20of%20the%20two,celestial%20body%20and%20the%20ecliptic. | |
| Strous, L. (2021). Astronomy Answers Positions in the Sky. https://aa.quae.nl/en/reken/hemelpositie.html | |
| Strous, L. (2021). Astronomy Answers Position of the Sun. https://aa.quae.nl/en/reken/zonpositie.html | |
| Wikipedia. (2024). Equation of the center. https://en.wikipedia.org/wiki/Equation_of_the_center | |
| Wikipedia. (2024). Mean anomaly. https://en.wikipedia.org/wiki/Mean_anomaly | |
| */ | |
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def quick_sort(s: list, start: int, end: int): | |
| if start < end: | |
| pos = start | |
| for i in range(start, end): | |
| if s[i] < s[end]: | |
| s[i], s[pos] = s[pos], s[i] | |
| pos += 1 | |
| s[pos], s[end] = s[end], s[pos] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define BINARY_REFINEMENT 1 | |
| #define BINARY_COUNT 4 | |
| #define BINARY_DECREASE 0.5 | |
| vec3 diagonal(mat4 mat) { return vec3(mat[0].x, mat[1].y, mat[2].z); } | |
| vec3 projectionOrthogonal(mat4 mat, vec3 v) { return diagonal(mat) * v + mat[3].xyz; } | |
| vec3 viewToScreen(vec3 viewPos) { | |
| return (projectionOrthogonal(gbufferProjection, viewPosition) / -viewPosition.z) * 0.5 + 0.5; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define EPS 1e-4 | |
| #define PI 3.14159265 | |
| #define INV_PI 0.31830988 | |
| float maxEps(float x) { return max(EPS, x); } | |
| float clamp01(float x) { return clamp(x, 0.0, 1.0); } | |
| float pow2(float x) { return x*x; } | |
| vec3 pow2(vec3 x) { return x*x; } |