Skip to content

Instantly share code, notes, and snippets.

@charlieroberts
Created March 7, 2020 22:02
Show Gist options
  • Save charlieroberts/737a21f8998fda984cfb8ed1722290a0 to your computer and use it in GitHub Desktop.
Save charlieroberts/737a21f8998fda984cfb8ed1722290a0 to your computer and use it in GitHub Desktop.
mandelbulb w/ simplex noise
// copy and paste into https://charlieroberts.github.io/marching/playground/
// select all and hit ctrl+enter
mat1 = Material( 'phong', Vec3(.0),Vec3(1,.8,.8),Vec3(1), 32, Vec3(0,.15,.25) )
march(
RoundUnion(
m = Mandelbulb( Noise(.225,4,.5) ).material( mat1 ),
Plane().material(mat1),
.25
)
)
.light(
Light( Vec3(-3,2,4), Vec3(1,.8,.8), .15 ),
Light( Vec3(0,0,4), Vec3(1,.8,.8), .95 )
)
.fog(.35,Vec3(.1,0,0))
.render( 'fractal.med' )
.camera( 0,0,3 )
t = 50
onframe = () => {
m.rotate( t*8,sin(t/6),0,0 )
t += .01
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment