Announcement

Collapse
No announcement yet.

Problems with FTE particle tcoords

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with FTE particle tcoords

    hello guys.
    Long time no see, i don't even know if you are still around or alive. Been buisy with this really annoying thing called real life for 3 months. However, i worked a little bit on my gore mod here and there and succesfully merged MP 1 & 2 with Qore and the main game. I's a mountain of ugly code now, but it works without bugs.
    A few days back i started to rewrite the particle textfile for FTE and that's where i ran into problems.

    I have problems with the tcoord line, which i don't fully understand. Neither i was able to secced by the trial & error method.
    In a helpful textfile

    Code:
    tcoords <s1> <t1> <s2> <t2> [tscale] [rsmax] [rsstep]
            0.125 0.125 0.25 0    1       1         0.125
        specifies to use a subsection of the image.
    - I understand what tscale is for, also i (think) i understand the functions of rsmax and rsstep. But when it comes to <s1> <t1> <s2> <t2> my brain melts. I tried to set them to 0 and only use tscale, rsmax and rsstep, but it didn't work.

    Example:
    I have a pixelfont with the size of 1024x1024, so tscale is 256 rsmax 8 and rsstep 256. It does not work. That means i don't understand something important. Then i tried to use a single image "texture particles/blood1.tga". It also didn't work.

    The only thing that got displayed are the tiny white dots that FTe places instead of the blood images that i want to see. i also tried to convert the darkplaces particle.txt file with FTE, to use it as a base. On some effects it works, on others not. I had a look at the file and all tcoords lines use the values 0.125 0.375 0.25 0.25 1 2 0.125

    So my Question is:
    What do <s1> <t1> <s2> <t2> mean? How do i use these 4 digits correctly?

    btw,
    it's nice to be back an running :-)
    I once was a Ranger like you. But then i took a rocket to the knee.
    My little gore mod : http://quakeone.com/forum/quake-mod-...76473-gore-mod

  • #2
    opengl refers to texture coords as the s and t values (aka U+V in d3d).
    s1 to the left, s2 is the right, t1 is the top, t2 is the bottom.

    the tscale argument is there to make your life easier - the engine just uses it as a divisor for the s+t values (and is then forgotten about, hence why any generated output always uses 1). So if you have a 16*16 grid in your particle atlas, you should just tscale to 16.
    then s1=0 is the left-most column, s1=1 is second column, s1=2 is the third, etc. Same with t1, except rows obviously.
    s2 should normally be s1+1, and t2 should be t1+1. That said, if the twos are lower than the ones, then the image is flipped, which might be desirable or not.
    Sometimes you'll have higher-res images within your atlas or so, in which case you'd use s2=s1+2 instead.

    rsmax is number of images that should be picked from randomly.
    rsstep is the randomized s-coord step per image. Note that this means that randomized images ONLY work when they're contiguous on the same horizontal row (a bigger rsmax will result in it wrapping onto the left of the same row). This wrap behaviour is different from DP - DP uses indexes into a separate file, while FTE just directly embeds all coords into the effect itself.
    additionally it looks like I forgot to divide rsstep by tscale, so you'll normally need to calculate 1/tscale for it.

    So:
    tcoords FIRSTCOLUMN ROW FIRSTCOLUMN+1 ROW+1 ATLASSIZE [ NUMBEROFIMAGES 1/ATLASSIZE ]
    (if you've a double-sized image, you can change the 1s in that formula to 2s)
    (actual pixel counts are completely irrelevant)
    Some Game Thing

    Comment


    • #3
      Thank you Spike , that makes it a whole lot clearer for me to comprehend the parameters :-)
      I will now go and edit the file.
      I once was a Ranger like you. But then i took a rocket to the knee.
      My little gore mod : http://quakeone.com/forum/quake-mod-...76473-gore-mod

      Comment

      Working...
      X