#####################################################
#                                                   #
#   HEADER                                          #
#                                                   #
#####################################################

header {
	title: xt%%%
	width: 1280
	height: 550
	music: experimental_artmusic.ogg
	bpm: 70.0
}

#####################################################
#                                                   #
#    OBJECTS                                        #
#                                                   #
#####################################################

objects {
	cam: camera {
	}
	env: enviroment {
		lighting: 0
	}
	ball: 3ds seko2.3ds {
		#texture: 0 xt2.png
		#texture: 1 xt3.png
	}
	texts: image xt1.png xt2.png xt3.png xt4.png xt2.png xt3.png xt4.png xt5.png xt6.png {
		blend: 1
	}
	outPlane: image *buffer {
		shader: out.frag
	}
}

#####################################################
#                                                   #
#    RENDER LINES                                   #
#                                                   #
#####################################################

renderLines {
	main {
		output: *buffer
		exclude: outPlane
	}
	out {
		objects: outPlane
	}
}

#####################################################
#                                                   #
#    SCRIPT                                         #
#                                                   #
#####################################################

script {
	@0.0 enable cam, env, ball, texts, outPlane
	
	@0.0 outPlane.shaders[0].resolution = 10000 to 0 in @64.0
	@0.0 outPlane.shaders[0].mix = rand( 0 - 0.05 ) for @32.0
	@32.0 outPlane.shaders[0].mix = rand( 0 - 0.25 ) for @16.0
	@48.0 outPlane.shaders[0].mix = rand( 0 - 0.5 ) for @4.0
	@52.0 outPlane.shaders[0].mix = rand( 0 - 1.0 ) for @16.0
	
	@0.0 main.clear.r = 1
	@0.0 main.clear.g = 1
	@0.0 main.clear.b = 1
	@0.0 main.clear.a = 1
	@16.0 main.clear.r = 1 to 0 in @48.0
	@16.0 main.clear.g = 1 to 0 in @48.0
	@16.0 main.clear.b = 1 to 0 in @48.0
	
	@0.0 loop @8.0 4 times {
		@7.3 outPlane.col.a = 1 to 0 in @0.0.1
		@8.1 outPlane.col.a = 0 to 1 in @0.0.1
	}
	
	
	@0.0 cam.pos.z = 10 to 5 in @32.0
	@0.0 cam.pos.x = 0 to 2 in @32.0
	@0.0 cam.pos.y = 0 to -2 in @32.0
	
	@0.0 loop @8.0 4 times {
		@0.0 cam.lookAt.x = rand( -10 - 10 )
		@0.0 cam.lookAt.y = rand( -5 - 5 )
		@0.0 cam.lookAt.z = rand( -10 - -5 )
		@0.0 cam.fovy = 10 to 45 in @8.0
	}
	
	@32.0 cam.fovy = 170
	@32.0 ball.mesh.cube1.rot.y = 0 to 90 in @32.0
	@32.0 ball.mesh.cube2.rot.x = 0 to 70 in @32.0
	@32.0 loop @1.0 16 times {
		@0.0 cam.pos.x = rand( -2 - 2 )
		@0.0 cam.pos.y = rand( -2 - 2 )
		@0.0 cam.pos.z = rand( -2 - 2 )
		
		@0.0 cam.lookAt.x = rand( -10 - 10 )
		@0.0 cam.lookAt.y = rand( -10 - 10 )
		@0.0 cam.lookAt.z = rand( -10 - -10 )
		
		@32.0 cam.up.x = rand( -2 - 2 )
		@32.0 cam.up.y = rand( -2 - 2 )
		@32.0 cam.up.z = rand( -2 - 2 )
	}
	
	148.0 cam.fovy = rand( 45 - 50 ) for 25.0
	173.0 cam.fovy = rand( 40 - 55 ) for 25.0
	198.0 cam.fovy = rand( 30 - 70 ) for 25.0

	
	@48.0 cam.pos.z = 10 to 5 in @16.0
	@48.0 cam.pos.x = 0 to 2 in @16.0
	@48.0 cam.pos.y = 0 to -2 in @16.0
	@48.0 loop @1.0 16 times {
		@0.0 cam.lookAt.x = rand( -10 - 10 )
		@0.0 cam.lookAt.y = rand( -10 - 10 )
		@0.0 cam.lookAt.z = rand( -10 - -5 )
	}

	@0.0 loop @8.0 9 times {
		@0.0 texts.col.a = 0.0 to 1.0 in @4.0
		@4.0 texts.col.a = 1.0 to 0.0 in @4.0
		@0.0 texts.zoom = 0.1 to 0 in @8.0
		@0.0 texts.col.g = rand( 0.75 - 1.0 ) for @4.0
		@0.0 texts.col.b = rand( 0.5 - 1.0 ) for @4.0
	}
	@0.0 texts.frame = 0 to 8 in @64.0

	225.0 outPlane.col.a = 1 to 0 in 10.0
	240.0 end
}
