Source 2 Viewer

Browse VPK archives, view, export, and decompile Source 2 assets, including maps, models, materials, textures, sounds.

Fully open-source and reverse-engineered.

Source 2 Viewer showing Counter-Strike 2, Deadlock and Half-Life: Alyx maps in tabs
Source 2 Viewer showing Counter-Strike 2, Deadlock and Half-Life: Alyx maps in tabs

One tool for every Source 2 asset

Render, inspect, extract, and decompile files from CS2, Dota 2, Deadlock, Half-Life: Alyx, and every other Source 2 game.

Maps & playable entities. Walk through maps with Counter-Strike movement while doors, buttons, and triggers work as in the game.

A subway train crossing the canal bridge on Overpass after a relay starts it

Models & animation. Step through and slow down animations, and show skeletons, hitboxes, and physics shapes.

The Deadlock hero Mina running while the camera circles her, with her skeleton and then her hitboxes drawn over the model

Particles. Preview sprites, trails, and ropes with lighting and scene collisions.

The C4 explosion particle system playing on Dust II

VPK explorer & editor. Browse, search, and edit VPK archives from any Source 1 or Source 2 game, and extract files or folders.

Deadlock item icons shown as a thumbnail grid inside a VPK
Deadlock item icons shown as a thumbnail grid inside a VPK

Decompile. Turn maps, models, and materials back into source files for Hammer and ModelDoc.

A Combine soldier switching body groups next to its decompiled model file
A Combine soldier switching body groups next to its decompiled model file

Blender export. Export maps, models, and animations as glTF for Blender, Unity, and Unreal Engine.

A Counter-Strike 2 agent running with a knife in Blender after a glTF export
A Counter-Strike 2 agent running with a knife in Blender after a glTF export

Map debug views. Switch render modes, and show collision, tool brushes, and the navigation mesh.

Dust II cycling through debug render modes

Graphs. View animation graphs, Pulse graphs, and map entity I/O.

The animation graph of a Deadlock character drawn as connected nodes
The animation graph of a Deadlock character drawn as connected nodes

Textures & materials. View textures per channel, cubemap face, and mip, and edit material parameters live.

The Hyper Beast weapon finish from Counter-Strike 2 stepping through its colour channels

Shader packages. Browse compiled shaders by program and combo, and decompile them to HLSL or GLSL.

Full feature list

3D Renderer

Map Viewer

  • Click any entity to inspect its properties
  • Walk around with Counter-Strike movement
  • First-person CS2 weapon in walk mode
  • Doors, buttons, and triggers work as in the game

Models & Animation

  • Animation playback with scrubbing and slow motion
  • Show skeletons, hitboxes, and physics shapes
  • Switch LODs, mesh groups, and material skins
  • Facial flexes and morph targets

VPK Viewer & Extractor

  • Open VPK files from any Source 1 or Source 2 game
  • Browse files as a grid of thumbnails
  • Search by name, regex, or file contents
  • Export files, build VPKs, and recover deleted files

Source 2 Decompiler

glTF Export

  • Maps, models, physics, and animations as glTF 2.0
  • Skinned meshes, morph targets, and material skins
  • Opens in Blender, Unity, and Unreal Engine
  • Batch export whole folders

Texture Viewer

  • View textures, images, and SVGs per color channel
  • Save textures as PNG, JPG, or EXR
  • Mip levels, cubemap faces, and depth slices
  • Animated sprite sheet playback

Particles & Materials

  • Particle systems with sprites, trails, and ropes
  • Particle lighting and scene collisions
  • Live material editing
  • Preview materials on different meshes

Shader Packages

Node Graph Viewers

  • Animation graphs with expandable state machines
  • Pulse graphs rebuilt from compiled bytecode
  • Entity I/O graph for maps, linked to the 3D view
  • Search, auto layout, and export as images

Audio

  • Audio player with waveform, seeking, and looping
  • Play Source 2 sounds, WAV, and MP3
  • Sound events play in the map and model viewers
  • 3D sound with soundscapes in maps

Source 2 Resource Files

Libraries and command line

Use the same .NET libraries as Source 2 Viewer in your own projects, or export files from scripts with the command line tool.

Command line utility. Export and decompile Source 2 resources from the command line on Windows, Linux, and macOS.

Source2Viewer-CLI
$ Source2Viewer-CLI -i pak01_dir.vpk --vpk_list -f maps/
  maps/ar_baggage.vjs_c CRC:0067601afc size:12230
  ...

$ Source2Viewer-CLI -i pak01_dir.vpk -f maps/ar_baggage.vjs_c -o -
  --- maps/ar_baggage.js
  import { Instance } from "cs_script/point_script";
  ...

$ Source2Viewer-CLI -i pak01_dir.vpk -f maps/ -d -o out --quiet
  --- Wrote 28 files

$ Source2Viewer-CLI -i pak01_dir.vpk --vpk_search ammo -e vdata_c
  scripts/weapons.vdata_c

$ Source2Viewer-CLI -i pak01_dir.vpk -f models/chicken/ \
      -o gltf --gltf_export_format glb --quiet
  --- Wrote 13 files

ValveResourceFormat. The library that powers Source 2 Viewer (S2V), also known as VRF. Use it to open and extract Source 2 resource files programmatically.

// Open package and read a file
using var package = new Package();
package.Read("pak01_dir.vpk");

var packageEntry = package.FindEntry("textures/debug.vtex_c");
package.ReadEntry(packageEntry, out var rawFile);

// Read file as a resource
using var ms = new MemoryStream(rawFile);
using var resource = new Resource();
resource.Read(ms);

Debug.Assert(resource.ResourceType == ResourceType.Texture);

// Get a png from the texture
var texture = (Texture)resource.DataBlock;
using var bitmap = texture.GenerateBitmap();
var png = TextureExtract.ToPngImage(bitmap);

File.WriteAllBytes("image.png", png);

ValveResourceFormat.Renderer

OpenGL-based rendering engine for Source 2 assets. Standalone rendering of models, maps, particles, animations, lighting, and materials with physically-based rendering (PBR).

ValvePak

Reads Valve Pak (VPK) archives, the uncompressed archives used to package game content, and extracts files out of them.

ValveKeyValue

Reads and writes files in Valve key value format. Aims to be fully compatible with Valve's various implementations of KeyValues format parsing.

xPawkristikerw1tcherrrPerryvwkrotter0Angel-foxxoPoggicekMarlaminPurrspctivSinZ163lewa-jrobert-hoffdr3ftymoofMonkeymovexigdirtkiller23BogdanuqnecukLionDogemdillerH7perusyaakov-hAveYoin0finitevermadasArenovasmircokroonKashimuraBakaAnsimistMattFileriwasinminedreamNeoExperiencesdanggui1995TianQiBuTiantimkurversThomasK33r2d2rigoihatecsvDatGuy1Artemon121aoisensiKampfkarrenzndxcvbnifpCDitrisalong0900snowyukittytgrgdsttrebuchonuser8738423YuRaNnNzZZSamboyCodingSTL1teRocksnStuffpjoeIOExceptionalgarrynewmanEgezennogniK5377aquaismissingLonswaya