Shader

From Burnout Wiki
Revision as of 09:27, 27 September 2023 by Burninrubber0 (talk | contribs) (Add some field descriptions.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Shader
aka {{{othernames}}}
No Example
Resource names Unknown
Type ID 0x32
Category Generic
Memory
distribution
Main Memory only
Imports Shader Program Buffer
(Remastered only)
Imported by Material
Editor
available?
No

The Shader resource type is the primary shader type in Burnout Paradise. It is effectively a wrapper for a heavily modified Shader Technique resource. It is used in conjunction with the Shader Program Buffer type, which holds precompiled shaders.

In the original PC game, no program buffers are imported. Instead, the game compiles the shaders at runtime using included source code and caches them for later use.

Structures

Header

PC

Offset Length Type Name Description Comments
0x0 0x4 ShaderTechnique* ? Shader techniques
0x4 0x1 uint8_t ? Number of techniques
0x5 0x1 uint8_t ? Flags? Always 0x44
0x6 0x2 uint16_t ? Pointer to uninitialized or null data
0x8 0x4 char* mpacName Shader name
0xC 0x4 int8_t* ? Constant indices
0x10 0x4 uint8_t* ? Constant sizes
0x14 0x4 uint32_t* mppaConstantsInstanceData Instance data Actually float[4]
0x18 0x4 uint32_t* mpauNamesHash Constant hashes
0x1C 0x1 uint8_t ? Number of constants
0x1D 0x1 uint8_t ? Number of constants with instance data
0x1E 0x2 ? ? Padding? Always null
0x20 0x4 char** ? Constant names
0x24 0x4 char* ? HLSL source code
0x28 0x4 ?* ? Always nullptr
0x2C 0x4 ?* ? Always nullptr
0x30 0x4 ?* ? Always nullptr

PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x4 ShaderTechnique* ? Shader techniques
0x4 0x1 uint8_t ? Number of techniques
0x5 0x1 uint8_t ? Flags? Always 3
0x6 0x2 uint16_t ? Pointer to uninitialized or null data
0x8 0x4 char* mpacName Shader name
0xC 0x4 int8_t* ? Constant indices
0x10 0x4 uint8_t* ? Constant sizes
0x14 0x4 uint32_t* mppaConstantsInstanceData Instance data Actually float[4]
0x18 0x4 uint32_t* mpauNamesHash Constant hashes
0x1C 0x1 uint8_t ? Number of constants
0x1D 0x1 uint8_t ? Number of constants with instance data
0x1E 0x2 ? ? Padding? Always null
0x20 0x4 char** ? Constant names
0x24 0x4 ?* ? Always nullptr
0x28 0x4 ?* ? Always nullptr
0x2C 0x4 ?* ? Always nullptr

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x8 ShaderTechnique* ? Shader techniques
0x8 0x1 uint8_t ? Number of techniques
0x9 0x1 uint8_t ? Flags? Always 3
0xA 0x2 uint16_t ? Pointer to uninitialized or null data
0xC 0x4 Padding
0x10 0x8 char* mpacName Shader name
0x18 0x8 int8_t* ? Constant indices
0x20 0x8 uint8_t* ? Constant sizes
0x28 0x8 uint32_t* mppaConstantsInstanceData Instance data Actually float[4]
0x30 0x8 uint32_t* mpauNamesHash Constant hashes
0x38 0x1 uint8_t ? Number of constants
0x39 0x1 uint8_t ? Number of constants with instance data
0x3A 0x2 ? ? Padding? Always null
0x3C 0x4 Padding
0x40 0x8 char** ? Constant names
0x48 0x8 ?* ? Always nullptr
0x50 0x8 ?* ? Always nullptr
0x58 0x8 ?* ? Always nullptr

CgsGraphics::ShaderTechnique

PC

Offset Length Type Name Description Comments
0x0 0x4 ProgramBuffer* mpVertexProgramBuffer Imported vertex shader resource
0x4 0x4 ProgramBuffer* mpPixelProgramBuffer Imported pixel shader resource
0x8 0x4 uint8_t* ? Indices 1
0xC 0x4 uint8_t* ? Indices 2
0x10 0x4 ?* ? Points to uninitialized data
0x14 0x4 ?* ? Points to uninitialized data
0x18 0x4 ?* ? Points to uninitialized data
0x1C 0x4 ?* ? Points to uninitialized data
0x20 0x1 uint8_t ? Number of indices 0(1)? Combine to get indices 1 count
0x21 0x1 uint8_t ? Number of indices 0(2)
0x22 0x1 uint8_t ? Number of indices 0(3)
0x23 0x1 uint8_t ? Number of indices 1(1) Combine to get indices 2 count
0x24 0x1 uint8_t ? Number of indices 1(2)
0x25 0x1 uint8_t ? Number of indices 1(3)
0x26 0x2 Padding
0x28 0x4 ?* ? Always nullptr
0x2C 0x4 ShaderSampler* mpaSamplers Samplers
0x30 0x1 int8_t miNumSamplers Number of samplers
0x31 0x3 Padding
0x34 0x4 ? ? Always null
0x38 0x4 char* mpacName Name
0x3C 0x4 char* ? Vertex shader name
0x40 0x4 char* ? Pixel shader name

PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x4 ProgramBuffer* mpVertexProgramBuffer Imported vertex shader resource
0x4 0x4 ProgramBuffer* mpPixelProgramBuffer Imported pixel shader resource
0x8 0x4 uint8_t* ? Indices 1
0xC 0x4 uint8_t* ? Indices 2
0x10 0x4 ?* ? Points to uninitialized data
0x14 0x4 ?* ? Points to uninitialized data
0x18 0x4 ?* ? Points to uninitialized data
0x1C 0x4 ?* ? Points to uninitialized data
0x20 0x1 uint8_t ? Number of indices 0(1)? Combine to get indices 1 count
0x21 0x1 uint8_t ? Number of indices 0(2)
0x22 0x1 uint8_t ? Number of indices 0(3)
0x23 0x1 uint8_t ? Number of indices 1(1) Combine to get indices 2 count
0x24 0x1 uint8_t ? Number of indices 1(2)
0x25 0x1 uint8_t ? Number of indices 1(3)
0x26 0x2 Padding
0x28 0x4 ?* ? Always nullptr
0x2C 0x4 ShaderSampler* mpaSamplers Samplers
0x30 0x1 int8_t miNumSamplers Number of samplers
0x31 0x3 Padding
0x34 0x4 ? ? Always null
0x38 0x4 char* mpacName Name

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x8 ProgramBuffer* mpVertexProgramBuffer Imported vertex shader resource
0x8 0x8 ProgramBuffer* mpPixelProgramBuffer Imported pixel shader resource
0x10 0x8 uint8_t* ? Indices 1
0x18 0x8 uint8_t* ? Indices 2
0x20 0x8 ?* ? Points to uninitialized data
0x28 0x8 ?* ? Points to uninitialized data
0x30 0x8 ?* ? Points to uninitialized data
0x38 0x8 ?* ? Points to uninitialized data
0x40 0x1 uint8_t ? Number of indices 0(1)? Combine to get indices 1 count
0x41 0x1 uint8_t ? Number of indices 0(2)
0x42 0x1 uint8_t ? Number of indices 0(3)
0x43 0x1 uint8_t ? Number of indices 1(1) Combine to get indices 2 count
0x44 0x1 uint8_t ? Number of indices 1(2)
0x45 0x1 uint8_t ? Number of indices 1(3)
0x46 0x2 Padding
0x48 0x8 ?* ? Always nullptr
0x50 0x8 ShaderSampler* mpaSamplers Samplers
0x58 0x1 int8_t miNumSamplers Number of samplers
0x59 0x3 Padding
0x5C 0x4 ? ? Always null
0x60 0x8 char* mpacName Name

CgsGraphics::ShaderSampler

32-bit

Offset Length Type Name Description Comments
0x0 0x4 char* mpacName Sampler name
0x4 0x2 int16_t miChannel Channel
0x6 0x2 Padding

64-bit

Offset Length Type Name Description Comments
0x0 0x8 char* mpacName Sampler name
0x8 0x2 int16_t miChannel Channel
0xA 0x6 Padding