|
About particle system ?
#401088
05/13/12 12:28
05/13/12 12:28
|
Joined: May 2010
Posts: 37
AMIR_REZAs
OP
Newbie
|
OP
Newbie
Joined: May 2010
Posts: 37
|
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/
|
|
|
Re: About particle system ?
[Re: AMIR_REZAs]
#401089
05/13/12 12:51
05/13/12 12:51
|
Joined: Dec 2003
Posts: 988 Germany, Magdeburg
JoGa
User
|
User
Joined: Dec 2003
Posts: 988
Germany, Magdeburg
|
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
Last edited by JoGa; 05/13/12 12:52.
|
|
|
Re: About particle system ?
[Re: JoGa]
#401124
05/14/12 01:53
05/14/12 01:53
|
Joined: Dec 2009
Posts: 128 China
frankjiang
Member
|
Member
Joined: Dec 2009
Posts: 128
China
|
well ,i think maybe it render likes shader effect,maybe create by model.
development 3d game is interesting!
|
|
|
Re: About particle system ?
[Re: sivan]
#401132
05/14/12 09:33
05/14/12 09:33
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
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. main.c
#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
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!
|
|
|
|