cg76
07-03-2009 09:29:22
Hi all,
For a ship simulator type of game, how do I create realistic ship trails?
Regards,
Cg
For a ship simulator type of game, how do I create realistic ship trails?
Regards,
Cg
cg76
07-03-2009 09:29:22
xadh00m
08-03-2009 22:58:31
cg76
10-03-2009 08:10:47
Maybe this nice hack is what you are looking for: http://www.ogre3d.org/forums/viewtopic.php?f=1&t=47645
xad
particle_system Water/Wake
{
quota 220
material Water/Wake
particle_width 1.5
particle_height 1.5
cull_each true
renderer billboard
billboard_type point
emitter Box
{
angle 0
colour 1 1 1 1
colour_range_start 1 1 1 1
colour_range_end 1 1 1 0
direction 0 1 0
emission_rate 10
position 0 0.2 0
velocity_min 0.0
velocity_max 0.4
time_to_live_min 5
time_to_live_max 7
duration 0
duration_min 0
duration_max 0
repeat_delay 0
repeat_delay_min 0
repeat_delay_max 0
width 2
height 2
depth 1
}
affector Scaler
{
rate 0.6
}
affector ColourFader2
{
red1 0
green1 0
blue1 0
alpha1 0
red2 0
green2 0
blue2 0
alpha2 -1
state_change 1
}
}
material Water/Wake
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off
texture_unit
{
texture wake.png
}
}
}
}
dudeabot
10-03-2009 17:12:14
al2950
11-03-2009 16:28:56
Xavyiy
11-03-2009 23:54:55
cg76
12-03-2009 06:06:25
Maybe render Ship trails with decals can be a little slow, because each decal needs a new pass in the Hydrax material, so.. if with a good particle system script you're able to get a realistic ship trail, it'll be fine!
Xavi
P.D.: Decals are useful to render needed things over the water, because with 20/30 on the water the frame frop could be 10/15fps, and it's not very good..., so I suggets avoid decals to details, and use them only if they are really needed!
mHydrax->getMaterialManager()->addDepthTechnique(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Water/Wake"))->createTechnique());
material Water/Wake
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off
texture_unit
{
texture smoke.png
}
}
}
}
particle_system Water/Wake
{
quota 500
material Water/Wake
particle_width 30
particle_height 30
cull_each false
renderer billboard
billboard_type perpendicular_common
common_direction 0 1 0
common_up_vector 0 0 1
emitter Point
{
angle 0
colour 1 1 1 1
direction -1 0 0
emission_rate 10
position 0 0 0
velocity_min 0.0
velocity_max 1
time_to_live_min 4
time_to_live_max 4
duration 0
duration_min 0
duration_max 0
repeat_delay 0
repeat_delay_min 0
repeat_delay_max 0
width 10
height 20
//depth 10
}
affector Scaler
{
rate 0.6
}
affector ColourFader2
{
red1 0
green1 0
blue1 0
alpha1 0
red2 0
green2 0
blue2 0
alpha2 -1
state_change 1
}
}
Xavyiy
12-03-2009 12:06:10
material Water/Wake
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off
texture_unit
{
texture smoke.png
}
}
technique
{
lighting off
scene_blend alpha_blend
scheme_name HydraxDepth
texture_unit{
texture FullTransparentTexture.png
}
}
}
}
cg76
13-03-2009 05:32:46
I think the best way is to use a custom Hydrax depth technique, just add in your particle material a new technique with "HydraxDepth" scheme name and a transparent colour pass, so the particles won't be visible for the Depth RTT, and you'll get the effect you want.
So.. something like this:
material Water/Wake
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off
texture_unit
{
texture smoke.png
}
}
technique
{
lighting off
scene_blend alpha_blend
scheme_name HydraxDepth
texture_unit{
texture FullTransparentTexture.png
}
}
}
}
must work!
Remember that if you use your custom Hydrax depth technique you shouldn't call Hydrax::MaterialManager::addDepth...
Post results
Xavi
Xavyiy
13-03-2009 09:51:57