[SOLVED MYSELF] "useArmyColor"... Is this a bug?

Discussion in 'Mod Discussions' started by killerkiwijuice, January 18, 2015.

  1. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    With this code in one of the effects: (there's a string effect in the .pfx but that's excluded from this)
    Code:
            {
                "spec": {
                    "shader": "particle_add_ramp",
                    "size": [
                        [
                            0,
                            1
                        ],
                        [
                            1,
                            0.2
                        ]
                    ],
                    "cameraPush": 0.5,
                    "baseTexture": "/pa/effects/textures/particles/softdot.papa",
                    "rampTexture": "/pa/effects/textures/particles/uncompressed/flicker_ramp.papa"
                },
                "offsetAllowNegZ": false,
                "useRadialVelocityDir": true,
                "useWorldSpace": true,
                "velocity": 1.5,
                "drag": 0.99,
                "gravity": -2,
                "alpha": 1,
                "offsetX": 0.25,
                "offsetY": 0.25,
                "offsetZ": 0.25,
                "offsetRangeX": 1,
                "offsetRangeY": 1,
                "offsetRangeZ": 1,
                "sizeX": 0.8,
                "sizeRangeX": 0.5,
                "rampV": 0.5,
                "rampRangeV": 0.5,
                "lifetime": 3,
                "lifetimeRange": 0.25,
                "emissionRate": 60,
                "emitterLifetime": 1,
                "bLoop": true,
                "endDistance": 1700,
                "useArmyColor": 2
            }
    The trail behind air units does not want to go team colored, it just stays white. The dots are the particles supposed to be red, but they aren't.
    [​IMG]

    I can't see what's wrong with the code? The secondary color was supposed to be red in that picture.
  2. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    I figured it out once again.

    I had to add the line
    Code:
    "dataChannelFormat": "PositionAndColor"
    to the .pfx

    I'm not sure what this actually did but it solved the problem :D
  3. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    oooooooooeh looks shiny . I sure hope those particle in the tail are a bit sparkly. :)
  4. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    There are different data formats for particles, this changes how the particles are sent to the GPU. The main reason for the different formats is to reduce the amount of data being sent. Less data == faster particles!

    By default particles are "PositionAndAlpha", so they can change their opacity. In general the data format is fairly smart about automatically selecting the correct data format, like if the particles have a color other than white they'll automatically be set to "PositionAndColor". However, it's only smart about the stuff inside of "spec". Anything outside of that it doesn't know about, so setting a color in the emitter, or the system, or using the army color, it won't be smart about setting the data format.
    wondible, cdrkf, Remy561 and 3 others like this.
  5. dom314

    dom314 Post Master General

    Messages:
    896
    Likes Received:
    1,196
  6. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    I have not. I'll try to see what it does through process of elimination when i get home.
  7. bgolus

    bgolus Uber Alumni

    Messages:
    1,481
    Likes Received:
    2,299
    "rampV" is used for ramp materials and string particles. For ramp materials it controls the V of the ramp texture's UV (U is particle lifetime fraction). For string particles it controls the texture repeat scale.
    dom314, wondible and killerkiwijuice like this.

Share This Page