Forum

Animated texture particles in FTE

Discuss the creation of various model formats for Quake engines, and related matters to modeling.

Moderator: InsideQC Admins

Animated texture particles in FTE

Postby toneddu2000 » Tue May 19, 2015 4:20 pm

Hy guys! I'm trying to create some animated particles with textures. I think that the method should be
  1. 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
  2. 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
    }
  3. Execute it from code
The problem is tcoords command. I can't find anywhere a documentation for it. I also took a look at p_script.c in FTEQW engine but I can't understand how arguments work.
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
But I couldn't find it anywhere on Google. Did anyone use it before?
toneddu2000
 
Posts: 1280
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: Animated texture particles in FTE

Postby Spike » Tue May 19, 2015 4:52 pm

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).
Spike
 
Posts: 2874
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Animated texture particles in FTE

Postby toneddu2000 » Tue May 19, 2015 5:27 pm

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
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
}
But image is like a very thin reticular grid image
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!!
toneddu2000
 
Posts: 1280
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy


Return to Modeling

Who is online

Users browsing this forum: No registered users and 1 guest