Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Bloom for the whole level

Author
Message
The Real Abaddon
16
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 11th Mar 2009 12:38
I don't get it, i do not know how to make a bloom effect to work for the whole level and all objects(1000+).
Until now i got bloom for 1 object or not for all, anyone can help with an example ?

I`m using Bloom from Evolved but if you have an example with another shader i`l switch.
Murloc
15
Years of Service
User Offline
Joined: 28th Dec 2008
Location: Utena,Lithuania
Posted: 11th Mar 2009 13:03
My suggestion would be using for loop to loop through all the objects and apply the shader. But it is kinda stupid.

Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 11th Mar 2009 14:56
there should be shader effect commands for WHOLE screen in DarkShader
The Real Abaddon
16
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 11th Mar 2009 17:58
I can't use DarkShader, conflicts with other libraries i have.
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 12th Mar 2009 00:13 Edited at: 12th Mar 2009 00:13
make a plain shove it in front of the camera then grab the contents of the screen and texture the plain with it. Then put shader on it. Then hide plain and do it at again

Lion Jin
18
Years of Service
User Offline
Joined: 24th Sep 2006
Location:
Posted: 12th Mar 2009 03:25
I have used it with the whole level already ,below is a screenshot from my works. you must make sure the "plane" is in front of your camera when your camera moved .and you should call dbSyncMask(0x00000001) before sync ,otherwise ,I found if D3D rest ,the program will crash. also ,you need to hide and show your all objects one by one.


http://www.thegamecreators.com/?m=gallery_view&i=1098&p=0
Lion Jin
18
Years of Service
User Offline
Joined: 24th Sep 2006
Location:
Posted: 12th Mar 2009 03:28
GDK's Bloom is effcient ,its not cause my program slow obviously.I am very happy with that.
The Real Abaddon
16
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 12th Mar 2009 21:07 Edited at: 12th Mar 2009 22:26
without I sounding like an ass who doesn't want to work but Lion Jin can you show me your bloom code ? Thanks

P.S The picture is awesome
Lion Jin
18
Years of Service
User Offline
Joined: 24th Sep 2006
Location:
Posted: 13th Mar 2009 03:26
Here I copied some of my codes about bloom.

Here load the effects and make the camera

int camerafxImage=tkGetImageID();
if ( UserShader){
dbLoadCameraEffect("fx\\bloom.fx",FX_BLOOM,0);
dbLoadEffect("fx\\Quad.fx",FX_QUAD,0);
}

const int vec=1;
if ( UserShader){
dbMakeVector4(vec);
dbSetVector4(vec,dbScreenWidth(),dbScreenHeight(),0,0);
dbSetEffectConstantVector( FX_QUAD,"ViewSize",vec);
dbDeleteVector4(vec);
}

//make cam
dbSetCameraRange (0,5,20000 );
if ( UserShader ){
dbMakeCamera(1);
dbColorBackdrop(1,dbRGB(0,128,0));
dbSetCameraRange (1,5,20000 );
dbSetCameraEffect(1,FX_BLOOM,camerafxImage);
}

Here hide and show all the objects

if ( UserShader ){
dbHideObject(plane);
dbShowObject(box);
dbSyncCamera(1);
player->HideObject();
level->Hide();
dbHideObject(box);
dbShowObject(plane);

dbSyncMask(0x00000001);
dbSync ();
}

here update the plane and camera position

if ( UserShader){
dbPositionCamera(1,dbCameraPositionX(),dbCameraPositionY(),dbCameraPositionZ());
dbRotateCamera(1,dbCameraAngleX(0),dbCameraAngleY(0),dbCameraAngleZ(0));
}

if ( UserShader){
if ( dbObjectExist( plane) ){
dbPositionObject(plane,dbCameraPositionX(0)+dbSin(dbCameraAngleY(0))*500,dbCameraPositionY(0)-dbSin(dbCameraAngleX(1))*500,
dbCameraPositionZ(0)+dbCos(dbCameraAngleY(0))*500 );
dbRotateObject(plane,dbCameraAngleX(0),dbCameraAngleY(0),dbCameraAngleZ(0));
}
The Real Abaddon
16
Years of Service
User Offline
Joined: 26th Jun 2008
Location:
Posted: 13th Mar 2009 08:01
Thanks for the code Lion Jin.

Login to post a reply

Server time is: 2024-11-25 18:03:11
Your offset time is: 2024-11-25 18:03:11