-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
laurelin
committed
May 4, 2019
1 parent
1a2d191
commit 6a5e1eb
Showing
12 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const one 1.0; | ||
fun main() Unit { | ||
outColor := Vec4(get !fragColor.X, get !fragColor.Y, get !fragColor.Z, one); | ||
return | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const one 1.0; | ||
|
||
fun cmult(a | Vec2, b | Vec2) Vec2 { | ||
return(Vec2( | ||
-(*(get a.X, get b.X), *(get a.Y, get b.Y)), | ||
+(*(get a.X, get b.Y), *(get a.Y, get b.X)) | ||
)) | ||
}; | ||
|
||
fun main() Unit { | ||
coord | Vec2 = Vec2(get !fragColor.X, get !fragColor.Y); | ||
l | Float = length(cmult(coord, coord)); | ||
outColor := Vec4(l, l, l, one); | ||
return | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const zero 0.0; | ||
const two 2.0; | ||
const one 1.0; | ||
const d 10.0; | ||
|
||
fun cmult(a | Vec2, b | Vec2) Vec2 { | ||
return(Vec2( | ||
-(*(get a.X, get b.X), *(get a.Y, get b.Y)), | ||
+(*(get a.X, get b.Y), *(get a.Y, get b.X)) | ||
)) | ||
}; | ||
|
||
fun mandelbrot(depth | Float, z | Vec2, c | Vec2) Vec2 | ||
when lt(depth, zero) is z | ||
else mandelbrot(-(depth, one), +(cmult(z, z), c), c); | ||
|
||
fun sign(x | Float) Float { | ||
return(-(x, length(x))) | ||
}; | ||
|
||
fun main() Unit { | ||
coord | Vec2 = Vec2(get !fragColor.X, get !fragColor.Y); | ||
l | Vec2 = mandelbrot(d, coord, coord); | ||
color | Float = /(length(l), two); | ||
outColor := Vec4(color, color, color, one); | ||
return | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const one 1.0; | ||
|
||
fun main() Unit { | ||
shade | Float = *(get !fragColor.X, get !fragColor.Y); | ||
outColor := Vec4(shade, shade, shade, one); | ||
return | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const zero 0.0; | ||
const pointone 0.1; | ||
const one 1.0; | ||
const ten 10.0; | ||
|
||
fun loop(i | Float, x | Float) Float when lt(i, pointone) is x else loop(-(i, one), +(x, pointone)); | ||
|
||
fun main() Unit { | ||
color | Float = loop(ten, zero); | ||
outColor := Vec4(color, color, color, one); | ||
return | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const zero 0.0; | ||
const pointone 0.1; | ||
const one 1.0; | ||
const ten 10.0; | ||
|
||
fun loop(i | Float, x | Float) Float when lt(i, pointone) is x else loop(-(i, one), +(x, pointone)); | ||
|
||
fun main() Unit { | ||
var color | Float; | ||
color := zero; | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
color := +(!color, pointone); | ||
c | Float = !color; | ||
outColor := Vec4(c, c, c, one); | ||
return | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const one 1.0; | ||
fun main() Unit {outColor := Vec4(one, one, one, one); return} |