Here's the whole code for using bloom in one wdl
view PP_Cam{layer = -1;}
entity PP_Quad
{
type = <PPE_Quad.tga>;
layer = 1;
view = camera;
x = 878;
y = 0;
z = 0;
scale_x = 1.0;
scale_y = 1.0;
}
//Bloom
material Bloom_mat
{
effect = "Bloom.fx";
}
function Bloom_set_Value(Strength,Brightness)
{
Bloom_mat.skill1 = floatv(Strength); //should be at around 1 or 2 or even higher
Bloom_mat.skill2 = floatv(Brightness); //use a small value here (between 0 and 0.5)
}
function PP_Init_startup()
{
PP_Cam.bmap = bmap_for_entity(PP_Quad,0);
}
function PP_Init_Effect()
{
PP_Quad.material = Bloom_mat; //Change this to the material you wish<---------------------------
Bloom_set_Value(2,0.3); //Call here the function to set the materials values<-------------
}
function PP_Toggle_OnOff()
{
if(PP_Quad.visible == on)
{
PP_Cam.visible = off;
PP_Quad.visible = off;
}else
{
PP_Cam.visible = on;
PP_Quad.visible = on;
while(PP_Quad.visible == on)
{
vec_set(PP_Cam.x,camera.x);
vec_set(PP_Cam.pan,camera.pan);
wait(1);
}
}
}
on_t = PP_Toggle_OnOff;
and call this where you want to start the effect (main script to start when game starts)
PP_Init_Effect();//Init the effect
Also , make sure you copy the PPE_Quad.tga and the Bloom.fx files to your project folder.
Btw , t will also toggle on and off the effect , you can also change this to any key by modifying the on_t = PP_Toggle_OnOff;
or just remove it if you don't need it , but it's great for testing purposes.Good luck.