Documentation
¶
Index ¶
- type Atlas
- type Colour2D
- type Cubemap
- type ITexture
- type Lightmap
- type Texture2D
- func (tex *Texture2D) EvictFromMainMemory()
- func (tex *Texture2D) FilePath() string
- func (tex *Texture2D) Format() uint32
- func (tex *Texture2D) Height() int
- func (tex *Texture2D) PixelDataForFrame(frame int) []byte
- func (tex *Texture2D) Reload() error
- func (tex *Texture2D) Thumbnail() []byte
- func (tex *Texture2D) Width() int
- type TextureLazy2D
- func (tex *TextureLazy2D) EvictFromMainMemory()
- func (tex *TextureLazy2D) FilePath() string
- func (tex *TextureLazy2D) Format() uint32
- func (tex *TextureLazy2D) Height() int
- func (tex *TextureLazy2D) PixelDataForFrame(frame int) []byte
- func (tex *TextureLazy2D) Reload() error
- func (tex *TextureLazy2D) Thumbnail() []byte
- func (tex *TextureLazy2D) Width() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Atlas ¶
type Atlas struct {
Colour2D
}
Atlas A texture atlas implementation.
type Colour2D ¶
type Colour2D struct {
Texture2D
// contains filtered or unexported fields
}
Colour2D is a material defined by raw/computed colour data, rather than loaded vtf data
func (*Colour2D) PixelDataForFrame ¶
PixelDataForFrame returns raw colour data for specific animation frame
type Cubemap ¶
Cubemap is a 6-sided edgeless texture that can be mapped to a cube, Used mainly for pre-computed reflections
func NewCubemap ¶
NewCubemap returns a new cubemap material
type ITexture ¶
type ITexture interface {
Width() int
Height() int
Format() uint32
PixelDataForFrame(int) []byte
FilePath() string
Thumbnail() []byte
EvictFromMainMemory()
Reload() error
}
ITexture Interface for a GPU texture
type Lightmap ¶
type Lightmap struct {
Colour2D
}
Lightmap is a material used for lighting a face
func LightmapFromColorRGBExp32 ¶
func LightmapFromColorRGBExp32(width int, height int, colorMaps []common.ColorRGBExponent32) *Lightmap
LightmapFromColorRGBExp32 creates a lightmap from BSP stored colour data
type Texture2D ¶
type Texture2D struct {
// contains filtered or unexported fields
}
Texture2D is a generic GPU material struct
func NewTexture2D ¶
NewTexture2D returns a new texture from Vtf
func (*Texture2D) EvictFromMainMemory ¶
func (tex *Texture2D) EvictFromMainMemory()
func (*Texture2D) PixelDataForFrame ¶
PixelDataForFrame get raw colour data for this frame
type TextureLazy2D ¶
type TextureLazy2D struct {
// contains filtered or unexported fields
}
func NewLazyTexture ¶
func NewLazyTexture(filePath string, fs filesystem.IFileSystem, width int, height int) *TextureLazy2D
NewTexture2D returns a new texture from Vtf
func (*TextureLazy2D) EvictFromMainMemory ¶
func (tex *TextureLazy2D) EvictFromMainMemory()
func (*TextureLazy2D) FilePath ¶
func (tex *TextureLazy2D) FilePath() string
FilePath Get the filepath this data was loaded from
func (*TextureLazy2D) Format ¶
func (tex *TextureLazy2D) Format() uint32
Format returns this materials colour format
func (*TextureLazy2D) Height ¶
func (tex *TextureLazy2D) Height() int
Height returns materials height
func (*TextureLazy2D) PixelDataForFrame ¶
func (tex *TextureLazy2D) PixelDataForFrame(frame int) []byte
PixelDataForFrame get raw colour data for this frame
func (*TextureLazy2D) Reload ¶
func (tex *TextureLazy2D) Reload() error
func (*TextureLazy2D) Thumbnail ¶
func (tex *TextureLazy2D) Thumbnail() []byte
Thumbnail returns a small thumbnail image of a material