I have been trying to use a bloom effect, I think that it's working well except for an odd green border that appears around the screen.Does anyone know why this is happening?
Here's the code
Setting it up
fov=35
sw#=screen width()
sh#=screen height()
dis#=(sh#/2)/tan(fov/2)
brightness#=0.1
blurWidth#=0.0005
make camera bloomcam
set camera to image bloomcam,bloomimg,256,256
set camera range bloomcam,3,100000
set camera fov bloomcam,35
make object plain bloomobj,sw#/100,sh#/100
load effect "Bloom.fx",bloomobj,0
texture object bloomobj,0,bloomimg
set object effect bloomobj,bloomobj
position object bloomobj,0,-10000,dis#/100
make camera bloomcam+1
set camera to image bloomcam+1,bloomimg+1,256,256
set camera range bloomcam+1,1,100
set camera fov bloomcam+1,fov
position camera bloomcam+1,0,-10000,0
make object plain bloomobj+1,sw#/100,sh#/100
load effect "Bloom.fx",bloomobj+1,0
texture object bloomobj+1,bloomimg+1
set object effect bloomobj+1,bloomobj+1
position object bloomobj+1,500,-10000,dis#/100
make camera bloomcam+2
set camera to image bloomcam+2,bloomimg+2,256,256
set camera range bloomcam+2,1,100
set camera fov bloomcam+2,fov
position camera bloomcam+2,500,-10000,0
make object plain bloomobj+2,-sw#/(400),sh#/(400)
load effect "Bloom.fx",bloomobj+2,0
texture object bloomobj+2,0,bloomimg+2
set object effect bloomobj+2,bloomobj+2
ghost object on bloomobj+2
set effect technique bloomobj,"Tone"
set effect technique bloomobj+1,"blurpassX"
set effect technique bloomobj+2,"blurpassY"
set effect constant float bloomobj+1,"Brightness",brightness#
set effect constant float bloomobj+1,"blurWidth",blurWidth#
set effect constant float bloomobj+2,"Brightness",brightness#
set effect constant float bloomobj+2,"blurWidth",blurWidth#
Updating it
position camera bloomcam,camera position x(),camera position y (),camera position z()
rotate camera bloomcam,camera angle x(),camera angle y(),camera angle z()
dis#=(sh#/2)/tan(fov/2)
position object bloomobj+2,camera position x(),camera position y(),camera position z()
rotate object bloomobj+2,camera angle x(),camera angle y(),camera angle z()
move object bloomobj+2,dis#/400
move object up bloomobj+2,0.01
move object left bloomobj+2,0.01
scale object bloomobj+2,101,101,0
It's almost the exact code used in the example for the shader.