Documentation
¶
Index ¶
- type Attribute
- type BGFXShader
- type BlendMode
- type CompiledMaterialDefinition
- type CustomTypeInfo
- type EncryptionVariant
- type InterpolationConstraint
- type NamedPass
- type NamedPropertyField
- type NamedSamplerDefinition
- type NamedShaderInput
- type Pass
- type PlatformShaderCode
- type PlatformShaderStage
- type PrecisionConstraint
- type PropertyField
- type PropertyType
- type SamplerAccess
- type SamplerDefinition
- type SamplerState
- type SamplerType
- type ShaderCode
- type ShaderCodePlatform
- type ShaderInput
- type ShaderInputType
- type ShaderStage
- type StringPair
- type Uniform
- type Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute uint8
const ( AttributePosition Attribute = iota AttributeNormal AttributeTangent AttributeBitangent AttributeColor0 AttributeColor1 AttributeColor2 AttributeColor3 AttributeIndices AttributeWeights AttributeTexCoord0 AttributeTexCoord1 AttributeTexCoord2 AttributeTexCoord3 AttributeTexCoord4 AttributeTexCoord5 AttributeTexCoord6 AttributeTexCoord7 AttributeTexCoord8 AttributeFrontFacing )
type BGFXShader ¶
type BGFXShader struct {
Magic uint32
Hash uint32
Uniforms []Uniform
Code []byte
Attributes []uint16
Size *uint16
}
func ParseBGFXShader ¶
func ParseBGFXShader(data []byte, materialFileVersion uint64) (*BGFXShader, error)
func (*BGFXShader) MarshalBinary ¶
func (b *BGFXShader) MarshalBinary(materialFileVersion uint64) ([]byte, error)
type CompiledMaterialDefinition ¶
type CompiledMaterialDefinition struct {
Version uint64
EncryptionVariant EncryptionVariant
Name string
ParentName *string
SamplerDefinitions []NamedSamplerDefinition
PropertyFields []NamedPropertyField
UniformOverrides *[]StringPair
Passes []NamedPass
}
func Parse ¶
func Parse(data []byte, materialFileVersion uint64) (*CompiledMaterialDefinition, error)
func (*CompiledMaterialDefinition) MarshalBinary ¶
func (c *CompiledMaterialDefinition) MarshalBinary(materialFileVersion uint64) ([]byte, error)
type CustomTypeInfo ¶
type EncryptionVariant ¶
type EncryptionVariant uint32
const ( EncryptionVariantNone EncryptionVariant = 0x4E4F4E45 EncryptionVariantSimplePassphrase EncryptionVariant = 0x534D504C EncryptionVariantKeyPair EncryptionVariant = 0x4B595052 )
func (EncryptionVariant) IsEncrypted ¶
func (e EncryptionVariant) IsEncrypted() bool
type InterpolationConstraint ¶
type InterpolationConstraint uint8
const ( InterpolationConstraintFlat InterpolationConstraint = iota InterpolationConstraintSmooth InterpolationConstraintNoPerspective InterpolationConstraintCentroid )
type NamedPropertyField ¶
type NamedPropertyField struct {
Name string
PropertyField PropertyField
}
type NamedSamplerDefinition ¶
type NamedSamplerDefinition struct {
Name string
SamplerDefinition SamplerDefinition
}
type NamedShaderInput ¶
type NamedShaderInput struct {
Name string
Input ShaderInput
}
type PlatformShaderCode ¶
type PlatformShaderCode struct {
Stage PlatformShaderStage
Code ShaderCode
}
type PlatformShaderStage ¶
type PlatformShaderStage struct {
StageName string
PlatformName string
Stage ShaderStage
Platform ShaderCodePlatform
}
type PrecisionConstraint ¶
type PrecisionConstraint uint8
const ( PrecisionConstraintLow PrecisionConstraint = iota PrecisionConstraintMedium PrecisionConstraintHigh )
type PropertyField ¶
type PropertyField struct {
FieldType PropertyType
Num uint32
VectorData []byte
MatrixData []byte
}
type PropertyType ¶
type PropertyType uint16
const ( PropertyTypeVec4 PropertyType = 2 PropertyTypeMat3 PropertyType = 3 PropertyTypeMat4 PropertyType = 4 PropertyTypeExternal PropertyType = 5 )
type SamplerAccess ¶
type SamplerAccess uint8
const ( SamplerAccessNone SamplerAccess = iota SamplerAccessRead SamplerAccessWrite SamplerAccessReadWrite )
type SamplerDefinition ¶
type SamplerDefinition struct {
RegisterSlot uint16
BindingSlot uint8
Size uint32
Access SamplerAccess
Precision PrecisionConstraint
AllowUnorderedAccess uint8
SamplerType SamplerType
TextureFormat string
SamplerState *SamplerState
DefaultTexture *string
TextureURI *string
CustomTypeInfo *CustomTypeInfo
}
type SamplerState ¶
type SamplerState uint8
const ( SamplerStateClampPoint SamplerState = iota SamplerStateClampLinear SamplerStateWrapPoint SamplerStateWrapLinear )
type SamplerType ¶
type SamplerType uint8
const ( SamplerType2D SamplerType = iota SamplerType2DArray SamplerType2DExternal SamplerType3D SamplerTypeCube SamplerTypeSamplerCubeArray SamplerTypeStructuredBuffer SamplerTypeRawBuffer SamplerTypeAccelerationStructure SamplerType2DShadow SamplerType2DArrayShadow )
type ShaderCode ¶
type ShaderCode struct {
ShaderInputs []NamedShaderInput
SourceHash uint64
BgfxShaderData []byte
}
type ShaderCodePlatform ¶
type ShaderCodePlatform uint8
const ( ShaderCodePlatformDirect3DSm40 ShaderCodePlatform = iota ShaderCodePlatformDirect3DSm50 ShaderCodePlatformDirect3DSm60 ShaderCodePlatformDirect3DSm65 ShaderCodePlatformDirect3DXB1 ShaderCodePlatformDirect3DXBX ShaderCodePlatformGlsl120 ShaderCodePlatformGlsl430 ShaderCodePlatformEssl100 ShaderCodePlatformEssl300 ShaderCodePlatformEssl310 ShaderCodePlatformMetal ShaderCodePlatformVulkan ShaderCodePlatformNvn ShaderCodePlatformPssl )
func (ShaderCodePlatform) String ¶
func (p ShaderCodePlatform) String() string
type ShaderInput ¶
type ShaderInput struct {
InputType ShaderInputType
Attribute Attribute
IsPerInstance bool
PrecisionConstraint *PrecisionConstraint
InterpolationConstraint *InterpolationConstraint
}
type ShaderInputType ¶
type ShaderInputType uint8
const ( ShaderInputTypeFloat ShaderInputType = iota ShaderInputTypeVec2 ShaderInputTypeVec3 ShaderInputTypeVec4 ShaderInputTypeInt ShaderInputTypeInt2 ShaderInputTypeInt3 ShaderInputTypeInt4 ShaderInputTypeUInt ShaderInputTypeUInt2 ShaderInputTypeUInt3 ShaderInputTypeUInt4 ShaderInputTypeMat4 )
type ShaderStage ¶
type ShaderStage uint8
const ( ShaderStageVertex ShaderStage = iota ShaderStageFragment ShaderStageCompute ShaderStageUnknown )
type StringPair ¶
type Variant ¶
type Variant struct {
IsSupported bool
Flags []StringPair
ShaderCodes []PlatformShaderCode
}
Click to show internal directories.
Click to hide internal directories.