Commit 46b3f163 authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Compile

parent 8f869839
......@@ -19,7 +19,7 @@ include(ECMPoQmTools)
################# Find dependencies #################
find_package(Qt5 REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg Sql)
find_package(KF5 REQUIRED COMPONENTS Kirigami2 I18n CoreAddons)
find_package(KF5 REQUIRED COMPONENTS Kirigami2 I18n CoreAddons Config Declarative)
################# Enable C++11 features for clang and gcc #################
set(CMAKE_CXX_STANDARD 11)
......
......@@ -230,6 +230,50 @@ Kirigami.ScrollablePage {
}
}
}
ShaderEffect {
height: 300
width: 300
property point u_resolution: Qt.point(width, height)
property real u_time: 1.0
fragmentShader: "#ifdef GL_ES
precision mediump float;
#endif
#define TWO_PI 6.28318530718
uniform vec2 u_resolution;
uniform float u_time;
// Function from Inigo Quiles
// https://www.shadertoy.com/view/MsS3Wc
vec3 hsb2rgb(in vec3 c)
{
vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),
6.0)-3.0)-1.0,
0.0,
1.0 );
rgb = rgb*rgb*(3.0-2.0*rgb);
return c.z * mix( vec3(1.0), rgb, c.y);
}
void main()
{
vec2 st = gl_FragCoord.xy/u_resolution;
vec3 color = vec3(0.0);
// Use polar coordinates instead of cartesian
vec2 toCenter = vec2(0.5)-st;
float angle = atan(toCenter.y,toCenter.x);
float radius = length(toCenter)*2.0;
// Map the angle (-PI to PI) to the Hue (from 0 to 1)
// and the Saturation to the radius
color = hsb2rgb(vec3((angle/TWO_PI)+0.5,radius,1.0));
gl_FragColor = vec4(color,1.0);
}";
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment