Animated texture particles in FTE
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
Animated texture particles in FTE
Hy guys! I'm trying to create some animated particles with textures. I think that the method should be
Technically, it should work like this
So you can decide to move a cell with cellsize on X axis with a celloffsetX value and on Y axis with a celloffsetY value in a slidetime time value.
But with no success. Everyone tried to do it?
Thanks in advance
PS:the FTE engine put in code a particle with a
- Generate an alpha channeled texture atlas with a grid of X for X cells. Every cell is for example 128 pixel - 4 cells horizontal x 4 cells vertical = 512x512 pixel texture size
- Create a particle
- Code: Select all
r_part blood
{
texture "textures/particles/bloodatlas.tga"
type decal
tcoords 0 0 0 128 128
die 2
scalefactor 20
scale 80 25
alpha 1 0.6
alphadelta -1.5
rgb 100 10 5
randomvel 400
spawnmode ball
spawnorg 0
count 8
gravity 100
blend normal
}
- Execute it from code
Technically, it should work like this
- Code: Select all
tcoords cellsize celloffsetX celloffsetY slidetime
So you can decide to move a cell with cellsize on X axis with a celloffsetX value and on Y axis with a celloffsetY value in a slidetime time value.
But with no success. Everyone tried to do it?
Thanks in advance
PS:the FTE engine put in code a particle with a
- Code: Select all
texture particles/fteparticlefont.tga
Meadow Fun!! - my first commercial game, made with FTEQW game engine
- toneddu2000
- Posts: 1352
- Joined: Tue Feb 24, 2009 4:39 pm
- Location: Italy
Re: Animated texture particles in FTE
its randomization, not animation.
tcoords left top right bottom texsize numimages sinc
texsize is pixels. use 1 if you want your texture coords to be specified as normalized (ie: 0-1) texture coords, otherwise make sure your image is square.
typically you'll want to pinch the texture coords in by a pixel, so they don't conflict with the atlased image stored in the neighbouring cells.
numimages must be >= 1 (or omitted). really if sinc is 0 then numimages could just as well be any positive integer you want...
if you want actual animations, you can embed shaders into your particle script (you can embed glsl into those shaders and adjust the texture coords based upon the vertex alpha), but this requires glsl-capable drivers.
(you can also use animmap, but you won't have any control over the starting frame that way).
tcoords left top right bottom texsize numimages sinc
texsize is pixels. use 1 if you want your texture coords to be specified as normalized (ie: 0-1) texture coords, otherwise make sure your image is square.
typically you'll want to pinch the texture coords in by a pixel, so they don't conflict with the atlased image stored in the neighbouring cells.
numimages must be >= 1 (or omitted). really if sinc is 0 then numimages could just as well be any positive integer you want...
if you want actual animations, you can embed shaders into your particle script (you can embed glsl into those shaders and adjust the texture coords based upon the vertex alpha), but this requires glsl-capable drivers.
(you can also use animmap, but you won't have any control over the starting frame that way).
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: Animated texture particles in FTE
Thanks Spike! What do you mean by randomization? That a random cell is picked? But, is it animated, right? Because, if it's like that, it could be ok for me
Anyway I tried
if I change
Now I can see every cell (every cell is a number) but still not animated.
For the glsl part now I'm quite experienced. I could create something. FTE doesn't have a prebuilt glsl shader for that, right?
Can you please explain which it's the syntax of animmap in shader tags?
Thanks again Spike!!
Anyway I tried
- Code: Select all
r_part numberseq
{
//model models/sprites/blood.spr32 0 0 6 0
texture "particles/numbers.tga"
tcoords 0 0 128 128 116 1
type decal
die 10
scale 80 80
alpha 1
}
if I change
- Code: Select all
r_part numberseq
{
//model models/sprites/blood.spr32 0 0 6 0
texture "particles/numbers.tga"
tcoords 0 0 128 128 128 16 1
type decal
die 10
scale 80 80
alpha 1
}
Now I can see every cell (every cell is a number) but still not animated.
For the glsl part now I'm quite experienced. I could create something. FTE doesn't have a prebuilt glsl shader for that, right?
Can you please explain which it's the syntax of animmap in shader tags?
Thanks again Spike!!
Meadow Fun!! - my first commercial game, made with FTEQW game engine
- toneddu2000
- Posts: 1352
- Joined: Tue Feb 24, 2009 4:39 pm
- Location: Italy
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest