frame_capture
Records the next frame the game draws, as Direct3D 9 was handed it: each draw call with its vertex and pixel shaders (by id, a hash of the bytecode, the same in every run), their constants by name with the values the device held (of each register as many floats or ints as the constant’s type uses, a float1 one, a float4x4 sixteen; a bool each), the textures each sampler had (the .dds file), the primitive counts and the render states asked. What the engine was drawing: material (its .mao, no extension) for a draw a material makes, and for a mesh’s or cloth’s also model, mesh (the node’s name in the model) and object and node, addresses that group one object’s draws in the frame; none for the interface, full-screen passes and most effects. shaders lists each listed draw’s shaders once, with their constant tables. A frame has some 2,000 draws, so the answer lists most (20) of those matching texture (part of a .dds name), shader (the start of an id), material and model (part of the name), after skip; constants keeps only the values named. file writes every draw of the frame, unfiltered, for a diff with another engine’s. The game must be drawing: a fullscreen game minimised draws nothing. Recording slows that one frame a little.
Read-only: it changes nothing in the game.
Arguments
| Name | Type | Required | What |
|---|---|---|---|
states | array | Render states to read at each draw, by name (ZENABLE, ALPHABLENDENABLE, or D3DRS_ZENABLE) or number. Default: depth, blending, alpha test, cull mode, colour writes, sRGB writes and stencil. | |
texture | string | List only draws sampling a .dds whose name has this. | |
shader | string | List only draws whose vertex or pixel shader id begins with this. | |
material | string | List only draws whose material’s name has this. | |
model | string | List only draws whose model’s name has this. | |
constants | array | List only these constants’ values, by name. Default: all. | |
skip | integer | Matching draws to pass over first. Default 0. | |
most | integer | Matching draws to list at most, 0 to 100000. Default 20. | |
file | string | A path to write the whole frame to as JSON, every draw and its values. | |
timeout | integer | Milliseconds to wait for the frame, 100 to 30000. Default 5000. |
Call it as frame_capture over MCP, or POST /api/tool/frame_capture with the arguments as JSON.