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

header {
	title: death by injury
	width: 1280
	height: 720	
	music: nosfe-evolve.mp3
	bpm: 125.0
}

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

textures {
	*glowX {
		width: 320
		height: 180
		wrap: clamp
	}
	*glow {
		width: 320
		height: 180
		wrap: clamp
	}
}

objects {
	cam: camera {
	}
	env: enviroment {
		lighting: 0
	}
	srcImg1: image fist.jpg {
		stretch: yes
	}
	srcImg2: image noise.jpg {
		blend: blend::screen
		stretch: yes
	}
	srcImg3: image title.jpg {
		blend: blend::alpha
		stretch: yes
	}
	lines2d: Lines/lines2D
	imgFeedback: image *glow {
		stretch: yes
		blend: blend::screen
		col.a: 0.6
		zoom: 0.01
		shader: tv.shader
	}
	imgGlowX: image *buf {
		stretch: 1
		shader: blurx.shader
		shader0.blur: 10
		shader0.pixel: 0.0015625
	}		
	imgGlowY: image *glowX {
		stretch: 1
		shader: blury.shader
		shader0.blur: 10
		shader0.pixel: 0.0027778
	}		
	imgGlow: image *glow {
		stretch: yes
		blend: blend::screen
	}
	imgOut: image *mix {
		shader: tv.shader
	}
}

#####################################################
#                                                   #
#    RENDER PASSES                                  #
#                                                   #
#####################################################

textures {
}

renderPasses {
	src {
		objects: srcImg1, srcImg2, srcImg3
		output: *src
	}
	main {
		objects: lines2d, imgFeedback
		output: *buf
	}
	glowx {
		objects: imgGlowX
		output: *glowX
	}
	glowy {
		objects: imgGlowY
		output: *glow
	}
	mix {
		objects: imgGlow, lines2d
		output: *mix
	}
	out {
		objects: imgOut
	}
}

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

script {
	@0.0 enable lines2d, cam, env, imgGlowX, imgGlowY, imgGlow, imgFeedback, imgOut, srcImg1, srcImg2, srcImg3
	
	@0.0 lines2d.foo = 0 to 10 in 51
	@0.0 lines2d.zoom = -1 to 1 in 51
	@0.0 lines2d.mix = eval( " 0.5 + sin( time * time * 0.0000000001 ) * 0.6" ) for 41.0
	@0.0 imgOut.shader0.rgbfuck = rand( 0 to 25 ) for 41.0
	@0.0 imgFeedback.shader0.rgbfuck = rand( 0 to 1 ) for 41.0
	
	@0.0 srcImg2.col.r = eval( " 0.8 + sin ( time * 0.001 ) * 0.2" ) for 41.0
	@0.0 srcImg2.col.g = eval( " 0.8 + sin ( time * 0.0012 ) * 0.2" ) for 41.0
	@0.0 srcImg2.col.b = eval( " 0.8 + sin ( time * 0.0013 ) * 0.2" ) for 41.0
	@0.0 srcImg2.col.a = eval( " 0.05 + sin ( time * 0.0014 ) * 0.05" ) for 41.0
	@0.0 srcImg2.offset.x = rand( 0 to 1 ) for 41.0
	
	0.0 srcImg3.col.r = 0 to 1 in 1.0
	0.0 srcImg3.col.g = 0 to 1 in 2.0
	0.0 srcImg3.col.b = 0 to 1 in 3.0
	5.0 srcImg3.col.a = 1 to 0 in 1.0

	20.0 srcImg3.col.a = 0 to 1 in 21.0
	30.0 srcImg3.col.r = 1 to 0 in 15.0
	30.0 srcImg3.col.g = 1 to 0 in 13.0
	30.0 srcImg3.col.b = 1 to 0 in 11.0
	
	41.5 lines2d.mix = eval( "sin(time*0.00025)*0.1" ) for 8
	41.5 srcImg1.col.a = 0
	41.5 srcImg2.col.a = 0
	41.5 srcImg3.col.a = 0
		
	51.0 end
}
