Bloom looks cool:
Rem ***** Main Source File *****
rem set up sync
sync on : sync rate 60
rem set up camera
autocam off
position camera 0,0,-15
`======= Make Light Object =======
make object plain 1,10,4
make object sphere 2,3
make mesh from object 1,2
delete object 2
add limb 1,1,1
add limb 1,2,1
offset limb 1,1,-2.5,0,0
offset limb 1,2,2.5,0,0
scale limb 1,1,100,100,20
scale limb 1,2,100,100,20
color object 1,RGB(255,255,255)
SET OBJECT EMISSIVE 1,RGB(55,55,55)
`=================================
`======= Set Up Lights ===========
set ambient light 20
position light 0,0,0,-100
gosub InitiateBloom
`=================================
`======= Set Up Light Vars =======
rem on off state
state=0
rem set up timer
delay=250
t=timer()+delay
`=================================
do
gosub UpdateLights
gosub UpdateBloom
yrotate object 1,object angle y(1)+0.5
sync
loop
UpdateLights:
rem if state is zero and timer() less than t do this
if state=0
rem color object 1
color limb 1,1,RGB(6,0,0)
rem color object 2
color limb 1,2,RGB(255,0,0)
endif
rem if state=1 and timer() less than t do this
if state=2
rem color object 2
color limb 1,1,RGB(255,0,0)
rem color object 1
color limb 1,2,RGB(6,0,0)
endif
rem if timer() greater than t then change state and reset t
if timer()>t
inc state,1
if state> 2 then state=0
t=timer()+delay
endif
return
UpdateBloom:
`bloom cam + update quad to screen
position camera BLOOMcamnum,camera position x(),camera position y(),camera position z()
rotate camera BLOOMcamnum,camera angle x(),camera angle y(),camera angle z()
update_quad(BLOOMobjnum+3)
return
`===================================================================
`========= BLOOM SHADER STUFF ======================================
`From the 2006 Free Shaders Pack
InitiateBloom:
`================
` variables
quad_dummy=200
FOV=100
BLOOMcamnum=1
BLOOMcamimgnum=10
BLOOMobjnum=5
blurWidth#=8
Brightness#=22
global Bloom_DummyX#
global Bloom_DummyY#
`================
` main cam
set camera range 1,10000
color backdrop 0
set camera fov FOV
make_dummy(quad_dummy)
make camera BLOOMcamnum
set camera to image BLOOMcamnum,BLOOMcamimgnum,256,256
set camera range BLOOMcamnum,2,10000
set camera fov BLOOMcamnum,FOV
color backdrop BLOOMcamnum,0
`================
`tone
make_quad(BLOOMobjnum)
load effect "tone.fx",BLOOMobjnum,0
texture object BLOOMobjnum,0,BLOOMcamimgnum
set object effect BLOOMobjnum,BLOOMobjnum
position object BLOOMobjnum,2000,-10000,1.5
make camera BLOOMcamnum+1
set camera to image BLOOMcamnum+1,BLOOMcamimgnum+1,256,256
set camera range BLOOMcamnum+1,1,100
set camera fov BLOOMcamnum+1,FOV
color backdrop BLOOMcamnum+1,0
position camera BLOOMcamnum+1,2000,-10000,0
`================
`bloom filter 1
make_quad(BLOOMobjnum+1)
load effect "bloom.fx",BLOOMobjnum+1,0
texture object BLOOMobjnum+1,BLOOMcamimgnum+1
set object effect BLOOMobjnum+1,BLOOMobjnum+1
position object BLOOMobjnum+1,2500,-10000,1.5
make camera BLOOMcamnum+2
set camera to image BLOOMcamnum+2,BLOOMcamimgnum+2,256,256
set camera range BLOOMcamnum+2,1,100
set camera fov BLOOMcamnum+2,FOV
color backdrop BLOOMcamnum+2,0
position camera BLOOMcamnum+2,2500,-10000,0
`================
`bloom filter 2
make_quad(BLOOMobjnum+2)
load effect "bloom.fx",BLOOMobjnum+2,0
texture object BLOOMobjnum+2,BLOOMcamimgnum+2
set object effect BLOOMobjnum+2,BLOOMobjnum+2
position object BLOOMobjnum+2,2500,-10000,1.5
make camera BLOOMcamnum+3
set camera to image BLOOMcamnum+3,BLOOMcamimgnum+3,256,256
set camera range BLOOMcamnum+3,1,100
set camera fov BLOOMcamnum+3,FOV
color backdrop BLOOMcamnum+3,0
position camera BLOOMcamnum+3,2500,-10000,0
`================
`camera quad
make_quad(BLOOMobjnum+3)
load effect "screen.fx",BLOOMobjnum+3,0
texture object BLOOMobjnum+3,BLOOMcamimgnum+3
set object effect BLOOMobjnum+3,BLOOMobjnum+3
ghost object on BLOOMobjnum+3,0
set object light BLOOMobjnum+3,0
set effect constant float BLOOMobjnum+1,"Brightness",Brightness#/150
set effect constant float BLOOMobjnum+1,"blurWidth",blurWidth#/2000
set effect constant float BLOOMobjnum+2,"Brightness",Brightness#/150
set effect constant float BLOOMobjnum+2,"blurWidth",blurWidth#/4000
return
`================
`================
function make_dummy(QD)
x#=camera position x()
y#=camera position y()
z#=camera position z()
ax#=camera angle x()
ay#=camera angle y()
az#=camera angle z()
position camera 0,0,0
rotate camera 0,0,0
make object box QD,10000,10000,1
position object QD,0,0,0
rotate object QD,0,0,0
move object QD,1.5
pick=pick object(screen width(),0,QD,QD)
delete object QD
Bloom_DummyX#=camera position x()+GET PICK VECTOR X()
Bloom_DummyY#=camera position y()+GET PICK VECTOR y()
position camera x#,y#,z#
rotate camera ax#,ay#,az#
endfunction
function make_quad(Q)
make object plain Q,100,100
position object Q,camera position x(),camera position y(),camera position z()
rotate object Q,camera angle x(),camera angle y(),camera angle z()
scale object Q,-Bloom_DummyX#*3,Bloom_DummyY#*3,100
endfunction
function update_quad(Q)
position object Q,camera position x(),camera position y(),camera position z()
rotate object Q,camera angle x(),camera angle y(),camera angle z()
scale object Q,-0.1-Bloom_DummyX#*3,0.1+Bloom_DummyY#*3,100
move object Q,1.5
move object up Q,0.05
move object left Q,0.05
endfunction
Download attachment