Skip to main content

ValveResourceFormat

Valve’s Source 2 resource file format parser, decompiler, and exporter. ValveResourceFormat (VRF) is a powerful C# library that enables you to work with Source 2 game assets programmatically.

Installation

Get started with NuGet package installation

Quick Start

Parse your first Source 2 resource in minutes

API Reference

Explore the complete API documentation

GitHub

View source code and contribute

Key Features

Comprehensive Format Support

Parse 50+ Source 2 resource types including models, textures, materials, maps, particles, animations, and more

VPK Package Reading

Extract and read files from Valve’s VPK archives using the integrated ValvePak library

Asset Export

Export textures to PNG/EXR, models to glTF, and materials to standard formats

Modern C# API

Built with .NET 10.0 featuring nullable reference types, AOT compatibility, and modern patterns

Supported Resource Types

ValveResourceFormat supports a wide range of Source 2 compiled resource files (files ending with _c):
  • vmdl - Model files with geometry and materials
  • vmesh - Mesh data
  • vanim - Animation data
  • vanmgrph - Animation graphs
  • vagrp - Animation groups
  • vmorf - Morph sets
  • vphys - Physics collision meshes
  • vtex - Compiled textures with multiple format support
  • vmat - Material definitions
  • vcompmat - Composite materials
  • vmap - Map files
  • vwrld - World files
  • vwnod - World nodes
  • vents - Entity lumps
  • vvis - World visibility data
  • vpcf - Particle systems
  • vpsf/vsnap - Particle snapshots
  • vpost - Post-processing settings
  • vsnd - Compiled sounds
  • vsndevts - Sound event scripts
  • vsndstck - Sound stack scripts
  • vmix - Audio mixing data
  • vxml - Panorama layouts
  • vcss - Panorama styles
  • vjs - Panorama scripts
  • vts - Panorama TypeScript
  • vsvg - Panorama vector graphics
  • vpdi - Panorama dynamic images
  • vdata - Generic data files
  • vsmart - Smart props
  • vcd/vcdlist - Choreo scenes
  • vrr - Response rules
  • vpulse - Pulse graph definitions
  • vcs - Compiled shaders
  • vpk - Package files (via ValvePak)

Supported Games

ValveResourceFormat works with assets from all Source 2 games:
  • Half-Life: Alyx
  • Dota 2
  • Counter-Strike 2
  • Artifact
  • Dota Underlords
  • The Lab
  • Destinations
  • SteamVR Home
  • And any other Source 2 game or mod
Source 2 resource files typically end with _c suffix (e.g., weapon.vmdl_c, texture.vtex_c). This indicates they are compiled binary formats, not the original source assets.

Binary Format Support

The library handles various binary formats and encodings:
MagicDescription
0x4B563301-05Binary KeyValues3 (versions 1-5)
0x03564B56VKV\x03 - Binary KV3 with compression
0x564B4256VBKV - Binary KeyValues1
0x55AA1234VPK - Valve packages
0x44434356VCCD - Closed captions
0x32736376vcs2 - Compiled shaders
0xC4CCACE8/9Tools asset info
0x414D5A4CLZMA compression
0xFEEDFACENavigation meshes
VFONT1Encrypted font files

Source 2 Viewer Application

This library powers the Source 2 Viewer desktop application, which provides a GUI for browsing and exporting Source 2 assets.

Download Source 2 Viewer

Get the free desktop application for Windows, macOS, and Linux

Requirements

  • .NET 10.0 or later
  • Works on Windows, macOS, and Linux
  • Native AOT compatible
Breaking Changes Notice: This library is primarily designed for Source 2 Viewer. Updates may contain breaking API changes. Source 2 file formats can also change with game updates, requiring library updates to maintain compatibility.

Next Steps

1

Install the Package

Add ValveResourceFormat to your project via NuGet
dotnet add package ValveResourceFormat
2

Read Your First Resource

Parse a Source 2 texture file and export it as PNG
using var resource = new Resource();
resource.Read("textures/debug.vtex_c");

var texture = (Texture)resource.DataBlock;
using var bitmap = texture.GenerateBitmap();
var png = TextureExtract.ToPngImage(bitmap);
3

Explore More

Check out the Quick Start guide and Guides for complete examples

Build docs developers (and LLMs) love