problem with wiki bloom

Posted By: not_me

problem with wiki bloom - 11/11/08 06:16

so im trying to figure out the bloom from the wiki. im using a6 comm with r2t plugin. the demo for r2t works fine...but when i try to use bloom from the wiki i get nothing. no change in appearance of the game or anything...
Posted By: not_me

Re: problem with wiki bloom - 11/22/08 07:24

*bump* anyone?
Posted By: Why_Do_I_Die

Re: problem with wiki bloom - 12/04/08 16:50

it's a bit weird , but you have to change the code frmo the wiki to be the same as the code from the post processing collection.

Basically , mak sure the view is set to camera in PPQuad
entity PP_Quad
{
type = <PPE_Quad.tga>;
layer = 1;
view = camera; //////the wiki code is set to ppcam i think

and include this function

function PP_Init_startup()
{
PP_Cam.bmap = bmap_for_entity(PP_Quad,0);
}


I would sujest searching for the postprocessing collection by sin in the user contributions , downloading it , then anylizing the scripts, it's only a couple of them and they are short, it'll be easier to do , since I had trouble with it till I used the PP_Main.wdl as base rather than the wiki's.

edit: and make sure you have PPE_Quad.tga image in your folder
Posted By: Why_Do_I_Die

Re: problem with wiki bloom - 12/04/08 17:05

Here's the whole code for using bloom in one wdl
Code:
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.
© 2023 lite-C Forums