SDP Files

Revision as of 16:49, 26 July 2009 by imported>Adderek (New page: Bethesda Shader Package .sdp files are located under data/shaders. Multiple packages can be found. Higher numbers contain more shaders and require higher shader model support, however it i...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Bethesda Shader Package .sdp files are located under data/shaders. Multiple packages can be found. Higher numbers contain more shaders and require higher shader model support, however it is not just simple "higher=better".

Header contain 3 DWORD's: 1. 0x64 - (description needed) 2. number of the shaders in that package 3. Size of the data (file size minus 3*4 bytes)

After the header array of shaders blocks is located. Every shader block contains: - shader's name (always 256 bytes long filled with 0's), - DWORD with size of the shader - shader data block

Shader data block is the output of D3DXCompileShader(...). In general it contains shader's token, CTAB comment block and shader compiled code.

CTAB comment block contains header with constant details and array of constant names with some extra data. It ends with compiler version information and some extra data.

CTAB comment block is used by the game engine but it might be lost after calling D3DXAssembleShader(...) since (according to MSDN) CTAB block is created by D3DXCompileShader(...) only.

Generic shader package content

0x00000064 // Unknown header
0x******** // number of shaders included in the package
0x000***** // shader data size (filesize-12)
{shader(s)}

shader(s):

{256 bytes with shader's name filled with 0's}
0x******** // shader's size
0x****F*FF // vertex/pixel shader code, version **.**
0xFEFF**00 // CTAB token and its size in DWORD's
{CTAB data}{Compiler version}{something}
{shader code}

D3DXAssembleShader returns by default vertex/pixel shader code and version (1*DWORD) and the shader's code without CTAB. It can be optionally assembled with debug flag which adds DBUG table.