material

package
v0.7.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConstantBufferMetadata added in v0.7.16

type ConstantBufferMetadata struct {
	UnkInt1 uint32
	Size    uint32
	Index   uint32
	UnkInt2 uint32
}

type GPUHeader added in v0.7.16

type GPUHeader struct {
	UnkInt uint32
	Name   stingray.ThinHash
	Size   uint32
}
type Header struct {
	Unk00           [12]uint8
	SectionMainSize uint32   // == size of ins[DataMain] - 0x18
	SectionGPUSize  uint32   // == size of ins[DataGPU]
	Unk01           [4]uint8 // seems to always == 0x18
	BaseMaterial    stingray.Hash
	Unk02           [32]uint8
	NumTextures     uint32
	Unk03           [36]uint8
	NumSettings     uint32
	Unk04           [28]uint8
}

type Material

type Material struct {
	BaseMaterial stingray.Hash
	Textures     map[stingray.ThinHash]stingray.Hash
	Settings     map[stingray.ThinHash][]float32
}

func LoadMain added in v0.7.16

func LoadMain(r io.ReadSeeker) (*Material, error)

type MaterialGPU added in v0.7.16

type MaterialGPU struct {
	GPUHeader
	UnkOffset1     uint32
	UnkInt1        uint32
	ShaderPrograms *ShaderProgramList
	UnkOffset2     uint32
	UnkInt2        uint32
	UnkInt3        uint32
	UnkInt4        uint32
	UnkOffset3     uint32
	UnkArray       []UnkArrayEntry
}

func LoadGPU added in v0.7.16

func LoadGPU(r io.ReadSeeker) (*MaterialGPU, error)

type ProgramCountItem added in v0.7.16

type ProgramCountItem struct {
	Count uint32
	// contains filtered or unexported fields
}

type SamplerAttributes added in v0.7.16

type SamplerAttributes struct {
	Attributes [][2]uint64
}

type SamplerMetadata added in v0.7.16

type SamplerMetadata struct {
	Name      stingray.ThinHash
	Register  uint32
	Bindcount uint32
}

type SettingDefinition added in v0.5.26

type SettingDefinition struct {
	Type   SettingsType
	Count  uint32
	Usage  stingray.ThinHash
	Offset uint32
	Stride uint32
}

type SettingsType added in v0.5.26

type SettingsType uint32
const (
	SettingTypeScalar  SettingsType = 0
	SettingTypeVector2 SettingsType = 1
	SettingTypeVector3 SettingsType = 2
	SettingTypeVector4 SettingsType = 3
	SettingTypeOther   SettingsType = 12
)

type Shader added in v0.7.16

type Shader struct {
	*d3d.DXBC
	Name            stingray.ThinHash
	CBufferMetadata []ConstantBufferMetadata
	TexMetadata     []TextureMetadata
	SampMetadata    []SamplerMetadata
}

type ShaderProgram added in v0.7.16

type ShaderProgram struct {
	UnkCount              uint32
	UnkArray              []uint32
	UnkAttrs              []UnknownAttributes
	TextureAttrs          []TextureAttributes
	SamplerAttrs          []SamplerAttributes
	VertexShader          *Shader
	UnknownShader1        *Shader
	InstancedVertexShader *Shader
	DomainShader          *Shader
	HullShader            *Shader
	UnknownShader2        *Shader
	PixelShader           *Shader
}

type ShaderProgramBlock added in v0.7.16

type ShaderProgramBlock struct {
	Headers  []ShaderProgramHeader
	Programs []ShaderProgram
}

type ShaderProgramHeader added in v0.7.16

type ShaderProgramHeader struct {
	StageMask    ShaderStageMask
	TextureCount uint32
	Stages       []StageMetadata
}

type ShaderProgramList added in v0.7.16

type ShaderProgramList struct {
	NumPrograms   uint32
	ProgramCounts []ProgramCountItem
	ProgramBlocks []ShaderProgramBlock
}

type ShaderStageMask added in v0.7.16

type ShaderStageMask uint8
const (
	ShaderStage_None            ShaderStageMask = 0x00
	ShaderStage_Vertex          ShaderStageMask = 0x01
	ShaderStage_Unknown1        ShaderStageMask = 0x02
	ShaderStage_InstancedVertex ShaderStageMask = 0x04
	ShaderStage_Tessellation    ShaderStageMask = 0x08
	ShaderStage_Unknown2        ShaderStageMask = 0x10
	ShaderStage_Pixel           ShaderStageMask = 0x20
	ShaderStage_Unknown3        ShaderStageMask = 0x40
)

func (ShaderStageMask) StageIdx added in v0.7.16

func (s ShaderStageMask) StageIdx() int

func (ShaderStageMask) Suffix added in v0.7.16

func (s ShaderStageMask) Suffix() ([]string, error)

type StageMetadata added in v0.7.16

type StageMetadata struct {
	DXBCSize uint32
	DXBCName stingray.ThinHash // This might just be an ID rather than a thin hash

	UnkInt1 uint32

	UnkInt2 uint32
	// contains filtered or unexported fields
}

type TextureAttributes added in v0.7.16

type TextureAttributes struct {
	SamplerParamCount uint64
	TextureHash       stingray.ThinHash
	// contains filtered or unexported fields
}

type TextureMetadata added in v0.7.16

type TextureMetadata struct {
	Name      stingray.ThinHash
	UnkInt1   uint32
	Register  uint32
	Bindcount uint32
}

type UnkArrayEntry added in v0.7.16

type UnkArrayEntry struct {
	Name    stingray.ThinHash
	UnkInt1 uint32

	UnkInt2 uint32

	UnkInt3 uint32

	UnkInt4 uint32

	UnkInt5 uint32

	UnkInt6 uint32
	// contains filtered or unexported fields
}

type UnknownAttributes added in v0.7.16

type UnknownAttributes struct {
	Value int32

	Key uint64
	// contains filtered or unexported fields
}

Directories

Path Synopsis
d3d

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL