Index

zydeco / fractal

Experiment in graphics programming, C++, OpenGL, simulation techniques.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
916 Nov 2023 11:11a4d3636Fractal ViewerJosh Stockin111G

Blob @ zydeco / include / render / shaders / triangle.fs.glsl

text/plain402 bytesdownload raw
1R""(
2
3#version 460 core
4
5
6in vec3 vertexColor;
7uniform uint time;
8
9out vec4 fragColor;
10
11
12vec3 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
19void main()
20{
21 fragColor = vec4(hueShift(vertexColor, time/1000.), 1.0f);
22}
23
24)""
25