Hello guys,
I am trying to create the following thing: When i press the E key, I want the bloom shader to appear and after releasing the E key, to disappear. However, When I test the level with just a character and a plain object underneath for not falling, I press the E key sometimes it works but sometimes on certain camera angles, the object underneath which is included in the for loop (1 to sceneobject) disappears totally and re appears after I release the E key. So conclusion: The Bloom shader appears on certain camera angles(lol). Why it does that?
Here is the code:
WHEN THE E KEY IS PRESSED:
//BLOOM
//RESET VARIABLES
//SLOW MOTION
//APPLY EFFECT AND LOAD IT'S RESOURCES
stpslwmtneff = 0
if camera exist(1) = 0
make camera 1 : color backdrop 1,rgb(32,32,32)
set current camera 1
position camera 1, camera position x(0), camera position y(0), camera position z(0)
yrotate camera 1, camera angle y(0)
endif
if camera effect exist(1) = 0
load camera effect "Bloom.dbs",1,0 : set camera effect 1,1,1
endif
if object exist(5653) = 0
make object plain 5653,2,2,1
endif
if effect exist(2) = 0
load effect "quad.fx",2,0
set object effect 5653,2
null = make vector4(1)
set vector4 1,640,480,0,0
set effect constant vector 2,"ViewSize",1
null = delete vector4(1)
texture object 5653,0,1
endif
//HIDE / UNHIDE OBJECTS
if object exist(5653) = 1
hide object 5653
endif
for shwobjcts = 1 to sceneobject
if object exist(shwobjcts) = 1
show object shwobjcts
endif
next shwobjcts
if camera exist(1) = 1
sync camera 1
endif
if object exist(5653) = 1
show object 5653
endif
for hdobjcts = 1 to sceneobject
if object exist(hdobjcts) = 1
hide object hdobjcts
endif
next hdobjcts
//SYNC
if camera exist(1) = 1
sync mask %01
endif
WHEN THE E KEY IS RELEASED:
//DELETE EFFECT AND IT'S RESOURCES
stpslwmtneff = stpslwmtneff + 1
if stpslwmtneff = 2
if camera effect exist(1) = 1
delete camera effect 1
endif
if object exist(5653) = 1
delete object 5653
endif
if effect exist(2) = 1
delete effect 2
endif
set current camera 0
if camera exist(1) = 1
delete camera 1
endif
for objshw = 1 to sceneobject
if object exist(objshw) = 1
show object objshw
endif
next objshw
endif
PS: I have a set camera to follow command to follow the main character!
Thank you very much! I am in big trouble with this problem...
Alex Matei CEO
www.alexmatei.com