Flutter Engine
The Flutter Engine
Classes | Variables
runtimefunctions.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkData.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/effects/SkRuntimeEffect.h"

Go to the source code of this file.

Classes

class  RuntimeFunctions
 

Variables

static const char * RUNTIME_FUNCTIONS_SRC
 

Variable Documentation

◆ RUNTIME_FUNCTIONS_SRC

const char* RUNTIME_FUNCTIONS_SRC
static
Initial value:
= R"(
// Source: @notargs https://twitter.com/notargs/status/1250468645030858753
uniform half4 iResolution;
const float iTime = 0;
float f(vec3 p) {
p.z -= iTime * 10.;
float a = p.z * .1;
p.xy *= mat2(cos(a), sin(a), -sin(a), cos(a));
return .1 - length(cos(p.xy) + sin(p.yz));
}
half4 main(vec2 fragcoord) {
vec3 d = .5 - fragcoord.xy1 / iResolution.y;
vec3 p=vec3(0);
for (int i = 0; i < 32; i++) {
p += f(p) * d;
}
return ((sin(p) + vec3(2, 5, 9)) / length(p)).xyz1;
}
)"

Definition at line 17 of file runtimefunctions.cpp.