aboutsummaryrefslogtreecommitdiff
path: root/src/shader
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-05-25 19:49:37 +0200
committerAdrian Kummerlaender2018-05-25 19:49:37 +0200
commite516095a425d1c8d5bd9f9004416a6c19bcaf84f (patch)
treec366ffbec08dff8df561f56f6b967fbd05049815 /src/shader
parent727645613619e366ae51a2eaad69793c9e225b05 (diff)
downloadcomputicle-e516095a425d1c8d5bd9f9004416a6c19bcaf84f.tar
computicle-e516095a425d1c8d5bd9f9004416a6c19bcaf84f.tar.gz
computicle-e516095a425d1c8d5bd9f9004416a6c19bcaf84f.tar.bz2
computicle-e516095a425d1c8d5bd9f9004416a6c19bcaf84f.tar.lz
computicle-e516095a425d1c8d5bd9f9004416a6c19bcaf84f.tar.xz
computicle-e516095a425d1c8d5bd9f9004416a6c19bcaf84f.tar.zst
computicle-e516095a425d1c8d5bd9f9004416a6c19bcaf84f.zip
Dynamically build compute shader from field function
Diffstat (limited to 'src/shader')
-rw-r--r--src/shader/compute.glsl11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/shader/compute.glsl b/src/shader/compute.glsl
index 148157b..eaf5579 100644
--- a/src/shader/compute.glsl
+++ b/src/shader/compute.glsl
@@ -6,17 +6,10 @@ layout (std430, binding=1) buffer bufferA{ float data[]; };
uniform vec2 world;
-// vector field definition
-
-vec2 f(vec2 v) {
- return vec2(
- cos(v.x*sin(v.y)),
- sin(v.x-v.y)
- );
-}
-
// ODE solver
+vec2 f(vec2); // field definition is to be appended
+
vec2 explicitEuler(float h, vec2 v) {
return v + h * f(v);
}