KF2 Cosmetic item Material Tutorial
Overview
The cosmetic item material in Killing Floor 2 is the parent material for all cosmetic items. It has several material effects that you can take advantage of when creating your material. These effects are driven by individual channels of a mask texture.
You must make a material instance constant of this parent material Material'Item_Mat_Lib.CHR_Item_PM'. Items submitted with their own material or a different parent material will not be accepted.
The individual Red (R), Green (G), Blue (B) and Alpha (A) channels of the mask texture each control a specific effect in the accessory material.
Color
Your color or "diffuse" map is essentially the texture that controls what your material looks like when in light. It is the main "color" of your material. This texture should be saved as a 24-bit tga before imported into the engine. See the example below:
Specular
Your specular map controls how "shiny" your material is. It does this per pixel. A darker pixel will appear less shiny while a brighter pixel will appear more shiny. In addition to this specular map, you can also multiply the specular effect by tweaking the scalar parameter "Scalar_Spec": a value of 1 will be the same as your authored spec. Values above 1 will exaggerate the specular highlights.
Your specular map should contain an alpha channel (32-bit tga) that defines how glossy your material is.
Gloss (Specular Alpha Channel)
The alpha channel of your specular map controls the gloss (also knows as specular exponent). The gloss map focuses the tightness of the specular highlight. A brighter value will yield a tighter highlight whereas a darker value will yield a very broad highlight. The gloss is per pixel so you can easily separate different gloss areas on your item.
Mask Texture
The mask texture defines several material effects. Each texture is a greyscale map that is authored and put into an individual color channel of a single 32-bit texture. If you are not using the glow effect it can be a 24-bit texture. Details about each color channel are outlined below in this section. If you are not using the effect you can simply leave that color channel black. Most items will only use 1 or 2 of the effects, while some may use all 4.
Mask Texture R Channel: Reflection Intensity
The red channel of your mask texture defines how reflective your material is. This channel is only used if you check the static switch in the material instance "StaticSwitch_HasReflection". When checked, the material will use the red channel of the mask texture to define the reflection intensity on a per pixel basis. The pixels define how much of a cube environment map is blended with your diffuse map. It is a seperate effect from your specular highlight. You would use this on metal, glass, or other reflective surfaces.
This effect can also be amplified with the scalar parameter "Scalar_ReflectionIntensity" A value of 1 will yield exactly what is in your map, a value higher then one will amplify this effect.
Mask Texture G Channel: Lens Effect
The green channel of your mask texture defines a "lens effect". This is useful if you are creating a gasmask, goggles, or other face masks that might have lenses. It is a displaced, reflective distortion effect. Essentially it is just a black texture and you paint white where your lenses are. This channel is only used if you have the static switch "StaticSwitch_HasMaskLenses" checked. If it is not checked this color channel will be ignored.
This effect is particularly noticeable when the character is moving due to the glass displacement.
Mask Texture B Channel: Sub Surface Effect
The blue channel of your mask texture defines "sub surface scattering" (SSS). White pixels on this map tell the shader that it should have the sub surface scattering effect, while black pixels tell the shader to have no sub surface effect. This is either on or off - grey pixels will not work. This effect is useful if your item has wax, skin, or marble on it.
This channel is only used if you have the static switch "StaticSwitch_SSS" checked. If it is not checked this color channel will be ignored.
Note: This effect will only be seen if your graphic character settings are set to "Ultra"
Note: This effect is currently not used on any of our cosmetics so I used a character head as an example. This effect is available to use if you find a creative use for it in your item.
Mask Texture A Channel: Glow Effect
The green channel of your mask texture defines a "glow effect". This channel is only used if you have the static switch "StaticSwitch_HasGlow" checked. If it is not checked this color channel will be ignored. After checking this static switch a new vector parameter will appear called "Vector_Glow_Color". This will define the color of your glow.
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.Related articles
Filter by label
There are no items with the selected labels at this time.