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

header {
	title: #r80 de hlblp crew
	width: 1280
	height: 720	
	music: noise.ogg
	bpm: 60.0
}

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

objects {
	cam: camera {
	}
	env: enviroment {
		lighting: 0
	}
	ball: 3ds seko.3ds {
		texture: 0 rainbow.jpg
	}
	texts: image text1.jpg text2.jpg text3.jpg title.jpg {
		blend: 2
	}
	outPlane: image *buffer noise.jpg {
		shader: out.frag
		multiTexturing: 1
		shaders[0].noise: 1
	}
}

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

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

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

script {
	@0.0 enable cam, env, ball, texts, outPlane
	@0.0 call randoms

	@0.0 main.clear.a = 1
	
	@0.0 texts.frame = 0 to 5 in @40.0
	
	@0.0 cam.pos.z = 0 to -10 in @24.0
	@0.0 cam.lookAt.y = 1 to 0 in @32.0
	@24.0 cam.pos.z = 0 to -1 in @8.0
	@24.0 cam.lookAt.x = 1 to -0.5 in @8.0
	@32.0 cam.pos.y = 4 to 7 in @8.0
	
	@0.0 loop @8.0 5 times {
		@0.0 main.clear.r = rand( 0.0 - 0.5 ) for @7.0
		@0.0 main.clear.g = rand( 0.0 - 0.25 ) for @7.0
		@0.0 main.clear.b = rand( 0.0 - 0.125 ) for @7.0
		@7.0 main.clear.r = 0
		@7.0 main.clear.g = 0
		@7.0 main.clear.b = 0
	}
	@0.0 loop @8.0 4 times {
		@0.0 disable texts
		@7.0 enable texts
		@7.0 texts.col.a = rand( 0.0 - 1.0 ) for @1.0
		@8.0 disable texts
	}
	
	@0.0 ball.rot.z = 0 to 360 in @64.0
	@0.0 ball.rot.y = 0 to 290 in @64.0
	
	@0.0 loop @12.0 3 times {
		@0.0 outPlane.shaders[0].distort = 0.005 to 0.025 in @6.0
		@6.0 outPlane.shaders[0].distort = 0.025 to 0.005 in @6.0
	}
	@36.0 outPlane.shaders[0].distort = 0.005 to 1.0 in @4.0
	
	@0.0 ball.mesh.bob.sphereMap = 1
	@0.0 outPlane.shaders[0].coef = 0.5 to 1.5 in @1.0
	@1.0 outPlane.shaders[0].coef = 1.5 to 3 in @15.0
	@16.0 outPlane.shaders[0].coef = 2 to 0.5 in @8.0
	@24.0 outPlane.shaders[0].coef = 3.0 to 1.5 in @8.0
	@32.0 outPlane.shaders[0].coef = 2 to 5 in @4.0
	@36.0 outPlane.shaders[0].coef = 5 to 0 in @4.0
	
	@41.0 end
}

randoms {
	@0.0 outPlane.shaders[0].noiseOffset.0 = rand( 0.0 - 1.0 ) for @128.0
	@0.0 outPlane.shaders[0].noiseOffset.1 = rand( 0.0 - 1.0 ) for @128.0
}