This article relates to the game "Counter-Strike 2". Click here for more information.
This article relates to the software/tool "Counter-Strike 2 Workshop Tools". Click here for more information.
This article's documentation is for Source 2. Click here for more information.

Counter-Strike 2 Workshop Tools/Weapon Finishes

From Valve Developer Community
Jump to navigation Jump to search
Note.pngNote:Main Introduction to Weapon Finishes: https://www.counter-strike.net/workshop/workshop

This article is about the technical things for Weapon Finishes.

All the basics for Weapon Finishes, including the Style Guide, can be found in the page above.


The Weapon Mesh .obj

From https://www.counter-strike.net/workshop/workshopresources one can find CS2 .obj Weapon Mesh files, that you can import into Photoshop, Substance Painter or many more applications.

By default, the Faces and Vertices of those Meshes are split / separated from eachother. If you import one of those weapon models in Substance Painter however. When exporting the mesh out from Substance Painter the vertices actually get merged by Distance. If you utilize the Projection Tool's "Mesh Fill" selection tool, it is capable of selecting the entire mesh, just how Blender can do "Select Linked"


The Normals of those merged vertices don't get affected visually, only the metadata. If this causes any other side-effect is not documented. When the faces get split back however, the Normals return to their previous value.

It should be possible to create mesh groups for each .obj in Blender using "Merge by Distance" to import them into Substance Painter to hide meshes, in order to visualize areas that would be visually unreachable, such as the magazine capsule.

Warning.pngWarning:The Legacy .obj file import in Blender will ruin the Normals when merging the Vertices by Distance

Debugging

Albedo

Todo: Is this to validate the PBR range? And why, the map even blinks and pre-existing weapon finishes as well?

1. In the VConsole click on ConVar Helper

VConsole ConVar.png

2. These options show up on the side when selecting cs2workshop.

VConsole ConVar Options CS2.png

3. When clicking Albedo you get put into a mat_fullbright mode.

  • Any too light color will blink Red.
  • Any too dark color will blink Blue.

Patterns

Todo: 
Icon-silk-question.png Question: How patterns work in the different given texture files?


Texture Placement

Seed

Texture Files

Base Color

The Base Color texture painting of a weapon finish, which can be combined with the paintkit templates where you can "paint by numbers".

Wearness Mask

The Wearness Mask is a greyscale map with values from 0 to 255 defined by black and white. This mask can overwrite the "Wear" behaviour of paintkits. The wearness is defined in a ```.tga``` of the Base Color texture in the Alpha Channel.

The behaviour of that mask has yet to be documented here. If you set an entire surface with the same greyscale color, the wearness won't immediately take away all of the paint, but it will scatter across that masked area.

Values around 196 in the alpha channel subtract from the refinishable areas

This could refer that values close to that number will immediately remove the paint even if on Factory New.


Values below 128 in the alpha channel increase the durability of the finish. The darker the value, the more durable the paint.

Pearlescent

This does something with color shifting. The scale value could be defining how much it should offset the colors in Hue from HSV.

Todo: How does it actually work?

Pearlescent Mask

The Pearlescent Mask defines what can be affected by the Pearlescent effect when it's scale value is higher than 0. Where the value 0 (Black) won't make it get affected by Pearlescent. But the value 255 (White) will. Anything inbetween defines how strong it should be.


Roughness

Roughness Mask

Can be in a separate file. According to the documentation some can be included in the Alpha Channel for certain Pattern templates.

Normal Map

Tip.pngTip:If in Substance Painter. To combine the Height Map with the Normal map, OpenGL has to be selected when creating an export preset, this will put the Height Map information into the Normal Map.

Ambient Occlusion

Todo: I am not sure if this is only for areas when they're not lit