Skip to content

Skinpaint Particles (Effects)

Eric Mor edited this page Sep 4, 2019 · 1 revision

This component is used to generate the skinpaint on a skinned body like creatures or plants. This component will "spray" multiple particles onto the creature body; those particles are just textures.

These particles have multiple properties like diffuse hue, saturation, size, transparency, sepcularity, etc. One of the key features of skinpaint particle components are modifiers: the variables can be modified depending on certain conditions such as the incoming angle, the limb position, the region of the body,...

This component shouldn't be used from an effect directly; instead, you must use it from a SPSkinPaintDistribute or from another skinpaint particles component.

Keyword: SPSkinPaintParticle

Attributes

brush <id...> -random -randomStart

The texture that is used for the skinpaint particles.


curve -random


chain <component>

Applies another SPSkinPaintParticle component after the execution of this one, chaining them.


align <enum or vector3> -bone -reverse

This attribute accepts either a vector3 or one of the following values:

  • inherit
  • move, dir
  • attract
  • aroundBone
  • alongBone
  • aroundSpine
  • alongSpine

If the direction is specified with a vector3 directly, the option -bone can be used.


initDir <enum or vector3> -bone -reverse

This attribute accepts either a vector3 or one of the following values:

  • inherit
  • attract
  • aroundBone
  • alongBone
  • aroundSpine
  • alongSpine

If the direction is specified with a vector3 directly, the option -bone can be used.


attract <enum or vector3> (<float>) -bone -reverse

This attribute accepts either a vector3 or one of the following values:

  • inherit
  • attract
  • aroundBone
  • alongBone
  • aroundSpine
  • alongSpine

If the direction is specified with a vector3 directly, the option -bone can be used.

The second argument is the attract force, in the [0.0, 1.0] range.


delay <float: min> <float: max>


life <float: min> <float: max>


diffuseColor <enum or colorRGB> -identity

The color that is used for this skinpaint. It can either be a fixed color, specified as an ArgScript Color, or one of the following values:

  • color1: The base creature color.
  • color2: The coat creature color.
  • color3: The detail creature color.
  • identity: The identity creature color. The identity color is that special color of the creature that is used as its civilization color.

If the -identity flag is used, this means that the color used in this skinpaint will be selected as the identity color of the creature.


inherit <enum...>

Specifies which modifier attributes are inherited from the previous skinpaint. The possible values are either diffuseColor or any of the Modifier channels listed further below in this page.


diffuseBlend <enum> specularBlend <enum> bumpBlend <enum>

How the diffuse color/specular/bump channel is blended with the existing color. One of the following values (srcColr refers to the existing color, dstColor to the color applied by this skinpaint):

  • alpha: The colors are blended depending on their transparency (i.e. srcColor*srcAlpha + dstColor*dstAlpha). This is the default one.

  • add: The color is added on top of the existing (i.e. srcColor + dstColor)

  • subtract: This skinpaint's color is subtracted to the existing color (i.e. srcColor - dstColor)

  • multiply: The colors are multiplied, acting as a tint (i.e srcColor*dstColor)

  • screen

  • inherit: The blending mode is inherited from the previous skinpaint.


compareNormal <vector3> <float> <float>

comparePosition <vector3> <vector3>


Variables

Skinpaints are mainly controlled by variables, which are multiple values that control the particles. One of the important features about these variables is that they can be modified depending on the region, incoming direction, etc (that is explained in the next section). These are all the supported variables:

  • size: The scale factor of the particles, with 1.0 being the default scale.
  • aspect: The aspect ratio of the particles, 1.0 is the default. This would be width/height, so an aspect ratio of 2.0 makes the particles be twice as wide than tall.
  • rotation, sometimes called rotate. The rotation of the particles, in degrees angles.
  • spacing
  • killswitch
  • hairRadius
  • alpha: The opacity of the particles: 1.0 is completely opaque and 0.0 is completely transparent.
  • diffuseHue, sometimes called varyHue
  • diffuseSat, sometimes called varySat
  • diffuseVal, sometimes called varyVal
  • diffuseAlpha
  • bumpScale
  • bumpAlpha
  • specularScale
  • specularAlpha
  • userVar1
  • userVar2
  • userVar3
  • userVar4

These variables can be used in two ways. This one allows multiple values and a variance to be specified, and is the more common. This multiplies on the existing value, except if the -add option is used:

<variable> <float...> -vary <float> -offset <float> (<float>) -add -scaleNorm -scalePos

The second way to use it is by making an operation on the existing value. The operations are -set, -add, -mult, -div and they take just 1 float parameter:

<variable> -set <float>

Modifiers

Modifiers are blocks (they contain attributes inside and are finished with the end keyword) that allow skinpaint variables to be modified on certain conditions, such as the torso position, the incoming particle angle, the region, etc

A modifier block is declared as:

modifier <enum: type> (<vector3>)
	<variable>
	<variable>
	...
end

Each of the variables receives an operation (set, multiply, divide, add) which is only applied depending on a range of values which depend on the modifier type.

The possible modifier types are:

  • age
  • random: The range is applied for a random number between 0 and 1.
  • worldAngle: Requires an additional vector3 argument, the axis of the angle. The range is applied for an angle around that axis, in degrees.
  • worldPos: Requires an additional vector3 argument.
  • worldDist: Requires an additional vector3 argument, the axis of the angle.
  • boneAngle: Requires an additional vector3 argument, the axis of the angle.
  • bonePos
  • boneOffset
  • torsoPos
  • limbPos: The range is applied for an a number between 0.0 (the start of the limb) and 1.0 (the end of the limb).
  • limbType
  • region
  • paintMask

You can also use any of the variable names as modifier type. In that case, you can add the -scale <float> option.

Inside a modifier block, variables follow this format:

<variable> -<op> <float> <float> -range <float> <float>

  • <variable> is one of the variable names listed before.
  • -<op> is any of the supported operations: -set, -add, -mult, -div. You specify two values: the real value will be selected randomly between those two values (so if both are the same, the same number will always be used).
  • -range is the range of values of the modifier for which this variable change applies.

Additionally, one of the following flags can be used:

  • -open
  • -clamp
  • -wrap
  • -mirror
  • -clamp2
  • -wrap2
  • -mirror2

This can be understood better with examples:

  • In this example, the applied skinpaint particles will be bigger when applied to the front part of the creature:
modifier worldAngle (0, 0, 1)
	size -mult 3.0 4.0 -range -30 30
end

This is looking at the angle around the Z axis (0, 0, 1). When the angle is between -30º and 30º (so around the front of the creature) the size is multiplied between 3 and 4 randomly.

  • In this example, the particles will fade when approaching at the end of a limb. The end of the limb will not have the skinpaint applied:
modifier limbPos
	alpha -set 1.0 0.4 -range 0.0 0.5
	alpha -set 0.4 0.1 -range 0.5 0.8
	alpha -set 0.0 0.0 -range 0.8 1.0
end

This means that in the first half of the limb (0.0 to 0.5) the opacity will be between 1.0 and 0.4. From the 50% to the 80% of the limb the opacity will be between 0.4 and 0.1. And in the last 20% of the limb the alpha will be 0.0.

Examples

SPSkinPaintParticle skinpaint_coat_backAndBelly_area_brush
   brush skn_brush_simpleCombo
   size .1 -vary 0.2

   life   0.1
   aspect 3

   alpha  1

   diffuseColor color2 -identity
   diffuseAlpha 0.5
   diffuseBlend alpha

   specularAlpha 0.1
   specularScale 0.1
   specularBlend alpha

   bumpAlpha 0.1
   bumpScale 0.1
   bumpBlend add

   modifier worldAngle (0, 0, 1)
     diffuseVal -mult 1 1.4 -range 45 180
     diffuseSat -mult 1 0.6 -range 45 180
     bumpScale -mult 1 0.5 -range 45 180
   end

   modifier region
     alpha -set 0 0 -range 1 1
     alpha -set 0 0 -range 2 2
   end
end

SPSkinPaintParticle skinpaint_base_walrus_tooth_particle
   brush skn_brush_walrus

   size .33 -vary 0.2

   align   dir

   alpha   1

   delay 0 1

   diffuseColor  color1
   diffuseAlpha 1 -vary 0.1
   diffuseBlend  alpha

   specularScale 0.6 -vary 0.2
   specularAlpha 0.025 -vary 0.2
   specularBlend alpha

   bumpScale 0.5 -vary 0.1
   bumpAlpha 1

   modifier worldPos (0, 0, 1)
     alpha -mult 0.33 1 -range 0 0.75 -clamp2
   end

   modifier worldAngle (0, 0, 1)
     diffuseSat -mult 1.1 1 -range 30 180 -clamp2
     diffuseVal -mult 0.9 1 -range 30 180 -clamp2
     bumpAlpha -mult 1 0.4 -range 90 180 -clamp2
   end

   modifier random
     diffuseVal -mult 0.95 1.05 -range 0 0.2 -wrap

     rotate -add -15 15 -range 0 0.1 -wrap
   end

   modifier limbPos
     size -mult 1 0.6 -range 0 1
     bumpAlpha -mult 1 0.4 -range 0 1
     diffuseVal -mult 1 1.1 -range 0 1
     diffuseSat -mult 1 0.8 -range 0 1
   end
end
Clone this wiki locally