About particle system ?

Posted By: AMIR_REZAs

About particle system ? - 05/13/12 12:28

Hello

I want to have a particle system around my character , like it



I tested the "manual gamestudio example" but it didn't work.
Already in c-script I could do it but in LiteC I can't.
plz help me...
thanks/
Posted By: JoGa

Re: About particle system ? - 05/13/12 12:51

i don't think that this effect is created with particles, it looks like they used models.
Try it this way: The figure creates some model-copies of itself on its position.
Every copy is a bit larger than the previous one (scale_z), but the scale_x and scale_y is smaller because the effect is not visible at front.
Then use a blue skin and TRANSLUCENT and BRIGHT - flags for the models.
Set the models passable and set their position every frame to the creator-position; also they have to be animated, too.
I think this way is used at your screenshot, because you see a gradation of the blue transparent.
In addition you can use particles, which are created at the entity-vertices and are rising.

I don't know which "manual gamestudio example" you mean, but maybe my idea from above can help you to create your effect laugh
Posted By: frankjiang

Re: About particle system ? - 05/14/12 01:53


well ,i think maybe it render likes shader effect,maybe create by model.


Posted By: GameScore

Re: About particle system ? - 05/14/12 07:50

looks a bit like a glow shader

glow shader
Posted By: sivan

Re: About particle system ? - 05/14/12 08:17

no, it's the Force itself grin
Posted By: txesmi

Re: About particle system ? - 05/14/12 09:33

Hi!

I achieved a similar effect some time ago and adapted it to your desires, but it is totally tricky and it just can be used at very particular cases.

It mixes two cameras, one for the background and one for the model, and makes the effect with the model cameras render targets alpha channel.

Click to reveal..

main.c
Code:
#include <acknex.h>

VECTOR vtemp;

MATERIAL *MAT_Camera =
{
	effect = "mixer.fx";
}

function main ()
{
	video_mode = 10;
	
	wait(2);
	level_load ( "level.wmb" );
	wait(3);
	
	BMAP *IMG_Model = bmap_createblack ( screen_size.x, screen_size.y, 32 );
	VIEW *CAM_Model = view_create ( -1 );
	CAM_Model.bmap = IMG_Model;
	set ( CAM_Model, SHOW | NOWORLD );
	
	BMAP *IMG_World = bmap_createblack ( screen_size.x, screen_size.y, 32 );
	VIEW *CAM_World = view_create ( -1 );
	CAM_World.bmap = IMG_World;
	set ( CAM_World, SHOW | NOENT );

	camera.flags |= PROCESS_TARGET;
	camera.material = MAT_Camera;
	MAT_Camera.skin1 = IMG_Model;
	MAT_Camera.skin2 = IMG_World;
	
	while ( !key_esc )
	{
		camera.pan += mouse_force.x;
		camera.tilt = clamp ( camera.tilt + mouse_force.y, -60, 5 );
		vec_set ( vtemp, vector ( -40, 0, 0 ) );
		vec_rotate ( vtemp, camera.pan );
		vec_set ( camera.x, vtemp );
		
		vec_set ( CAM_Model.x, camera.x );
		vec_set ( CAM_Model.pan, camera.pan );
		vec_set ( CAM_World.x, camera.x );
		vec_set ( CAM_World.pan, camera.pan );
		
		wait(1);
	}
	
	sys_exit ( NULL );
}



mixer.fx
Code:
texture mtlSkin1;
texture mtlSkin2;

sampler2D ModelSampler = sampler_state
{
   Texture = <mtlSkin1>;
   MipFilter = Linear;   
   AddressU  = clamp;
   AddressV  = clamp;
};
	
sampler2D WorldSampler = sampler_state
{
   Texture = <mtlSkin2>;
   MipFilter = Linear;   
   AddressU  = clamp;
   AddressV  = clamp;
};
	
float4 PS ( in float2 ScreenCoor: TEXCOORD0 ) : COLOR0
{
	float3 GlowColor = float3 ( 1.0f, 0.5f, 0.5f );
	float CoorYInv = 1.0f - ScreenCoor.y;
	float CoorXMid = ScreenCoor.x - 0.5f;
	float2 Coor = ScreenCoor;
	
	float4 BG = tex2D ( WorldSampler, Coor );
	float4 Model = tex2D ( ModelSampler, Coor );
	
	Coor.x = ( CoorXMid * ( 1.0f - ( 0.1 * CoorYInv ) ) ) + 0.5f;
	Coor.y += 0.01 * CoorYInv;
	float4 Glow1 = tex2D ( ModelSampler, Coor );
	
	Coor.x = ( CoorXMid * ( 1.0f - ( 0.2 * CoorYInv ) ) ) + 0.5f;
	Coor.y += 0.015 * CoorYInv;
	float4 Glow2 = tex2D ( ModelSampler, Coor );
	
	Coor.x = ( CoorXMid * ( 1.0f - ( 0.4 * CoorYInv ) ) ) + 0.5f;
	Coor.y += 0.02 * CoorYInv;
	float4 Glow3 = tex2D ( ModelSampler, Coor );
	
	float4 FinalColor;
	FinalColor.a = max ( (Glow1.a+Glow2.a+Glow3.a)*0.2, Model.a );
	FinalColor.rgb = ( ( Model.rgb * Model.a ) + ( CoorYInv * ( 1.0f - Model.a ) ) ) * FinalColor.a;
	FinalColor.rgb += BG.rgb * ( 1.0f - FinalColor.a ); 
	return FinalColor;
}

technique PostProcess
{
	pass p0
	{
		VertexShader = NULL;
		PixelShader  = compile ps_2_0 PS();
	}
}






Salud!

Posted By: AMIR_REZAs

Re: About particle system ? - 05/15/12 09:37

Thanks alot but I'm using Free version and I can't use shaders...
I thought that it want a simple particle but....
Can u give me a simple particle code that is similar to that picture??
© 2024 lite-C Forums