Experiment in graphics programming, C++, OpenGL, simulation techniques.
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
9 | 16 Nov 2023 11:11 | a4d3636 | Fractal Viewer | Josh Stockin | 1 | 1 | 1 | G |
1 | R""( |
2 | |
3 | #version 460 core |
4 | |
5 | |
6 | in vec3 vertexColor; |
7 | uniform uint time; |
8 | |
9 | out vec4 fragColor; |
10 | |
11 | |
12 | vec3 hueShift(vec3 color, float hue) { |
13 | const vec3 k = vec3(0.57735, 0.57735, 0.57735); |
14 | float cosAngle = cos(hue); |
15 | return vec3(color * cosAngle + cross(k, color) * sin(hue) + k * dot(k, color) * (1.0 - cosAngle)); |
16 | } |
17 | |
18 | |
19 | void main() |
20 | { |
21 | fragColor = vec4(hueShift(vertexColor, time/1000.), 1.0f); |
22 | } |
23 | |
24 | )"" |
25 |