Created
March 28, 2020 15:57
-
-
Save kig/5d572e7666df83d252a075cc3e9cc8a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct float4 | |
{ | |
float x; | |
float y; | |
float z; | |
float w; | |
}; | |
export void runner_main(uniform int work_groups[3], uniform struct inputs& input, uniform struct outputs& output) | |
{ | |
// Vectorise the workgroup | |
foreach(lx = 0 ... 4) | |
{ | |
varying float4 c = {0.0f, 0.0f, 0.0f, 0.0f}; | |
varying float roz = -10.0f; | |
varying float roy = 10.0f; | |
varying float rox = 1.0f; | |
for (varying int i = 0; i < 4; i++) | |
{ | |
varying float t = abs( roz - 15.0f - rox ); | |
roz = roz + t*2.0f; | |
roy = roy + t; | |
rox = rox + t; | |
if (lx < i) | |
{ | |
varying float fi = (float)i / 1.00001f; | |
varying float4 d = {1+rox * 0.00001f * fi, 2+roy * 0.00001f * fi, 3+roz * 0.00001f * fi, 0}; | |
c = d; | |
break; | |
} | |
} | |
print("%\n%\n%\n", c.x, c.y, c.z); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment