basil

package
v0.0.0-...-acbd27a Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HasPosition int = 1 << iota
	HasNormal
	HasTangent
	HasTexcoord0
	HasBlendWeight0
	HasWeightIndices0
	HasTexture0
	HasTexture1
	HasTexture2
	HasDoubleSided
	HasAlphaBlend
)

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src string, dst string) error

func Exists

func Exists(path string) bool

func IsDir

func IsDir(path string) bool

func MakeDir

func MakeDir(dir string) error

func WriteFile

func WriteFile(path string, data []byte) error

Types

type ArGLTF

type ArGLTF struct {
	Buffer  []*ArGLTFBuffer        `json:"buffer,omitempty"`
	Texture []*ArGLTFTexture       `json:"texture,omitempty"`
	Input   []*ArGLTFInput         `json:"input,omitempty"`
	Mesh    map[string]*ArGLTFMesh `json:"mesh,omitempty"`
}

type ArGLTFBuffer

type ArGLTFBuffer struct {
	Embed int `json:"embed,omitempty"`
}

type ArGLTFInput

type ArGLTFInput struct {
	Count int `json:"count"`
	Hint  int `json:"hint"`

	// Input
	VertexBuffer0 []int `json:"vb0,omitempty"` // [buffer, offset, size], slot: 0, shaderLocation: 0, format: float32x3 (position)
	VertexBuffer1 []int `json:"vb1,omitempty"` // [buffer, offset, size], slot: 1, shaderLocation: 1, format: float32x3 (normal)
	VertexBuffer2 []int `json:"vb2,omitempty"` // [buffer, offset, size], slot: 2, shaderLocation: 2
	VertexBuffer3 []int `json:"vb3,omitempty"` // [buffer, offset, size], slot: 3, shaderLocation: 3
	VertexBuffer4 []int `json:"vb4,omitempty"` // [buffer, offset, size], slot: 4, shaderLocation: 4
	VertexBuffer5 []int `json:"vb5,omitempty"` // [buffer, offset, size], slot: 5, shaderLocation: 5
	IndexBuffer   []int `json:"ib,omitempty"`  // [buffer, offset, size], format: uint16

	// Uniform
	Factor0  []float64 `json:"factor0,omitempty"`  // [Color.r, Color.g, Color.b, Color.a]
	Factor1  []float64 `json:"factor1,omitempty"`  // [Occlusion, Metallic, Roughness, unused]
	Factor2  []float64 `json:"factor2,omitempty"`  // [Emissive.r, Emissive.g, Emissive.b, unused]
	Texture0 int       `json:"texture0,omitempty"` // BaseColorTexture
	Texture1 int       `json:"texture1,omitempty"` // ParameterTexture(OcclusionMetallicRoughness)
	Texture2 int       `json:"texture2,omitempty"` // NormalTexture
}

type ArGLTFMesh

type ArGLTFMesh struct {
	Input []int `json:"input"`
}

type ArGLTFTexture

type ArGLTFTexture struct {
	Embed int `json:"embed,omitempty"`
}

type ArWGSL

type ArWGSL struct {
	Shader []*ArWGSLShader `json:"shader,omitempty"`
}

type ArWGSLShader

type ArWGSLShader struct {
	Embed int `json:"embed,omitempty"`
}

type Archive

type Archive struct {
	Embed []*string               `json:"embed"`
	JSON  map[string]*interface{} `json:"json"`
	WGSL  ArWGSL                  `json:"wgsl"`
	GLTF  ArGLTF                  `json:"gltf"`
}

type Basil

type Basil struct {
	// contains filtered or unexported fields
}

func (*Basil) AddFile

func (p *Basil) AddFile(path string, data []byte)

func (*Basil) AddScript

func (p *Basil) AddScript(src []byte)

func (*Basil) BaseDir

func (p *Basil) BaseDir() string

func (*Basil) Build

func (p *Basil) Build() error

func (*Basil) Clean

func (p *Basil) Clean() error

func (*Basil) ConfigJson

func (p *Basil) ConfigJson() string

func (*Basil) DistDir

func (p *Basil) DistDir() string

func (*Basil) Minify

func (p *Basil) Minify() bool

func (*Basil) Read

func (p *Basil) Read() error

func (*Basil) SetDir

func (p *Basil) SetDir(path string) error

type Config

type Config struct {
	Dist     *string  `json:"dist"`
	Title    string   `json:"title"`
	Script   []string `json:"script"`
	Minify   bool     `json:"minify"`
	CoreOnly bool     `json:"coreonly"`

	Use    []string `json:"use"`
	Extern []string `json:"extern"`
}

func (*Config) Read

func (p *Config) Read(path string) error

type File

type File struct {
	Name string
	Data []byte
}

func (*File) Write

func (f *File) Write(baseDir string) error

type Source

type Source struct {
	GLTF []*gltf.Document
	JSON map[string]*interface{}
}

Jump to

Keyboard shortcuts

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