Documentation
¶
Index ¶
- func BuildModelResource(gltfDoc *gltf.Document, forceCollision bool) (*mdl.Model, error)
- func CreateDigest(name string, params ...any) ([]byte, error)
- func Run(registry *asset.Registry, modelNames []string) error
- func StringDigest(digestable Digestable) (string, error)
- type ApplyFunc
- type DigestFunc
- type Digestable
- type GetFunc
- type Operation
- func AddBlob(blobProvider Provider[*mdl.Blob]) Operation
- func AddForwardPass(passProvider Provider[*mdl.MaterialPass]) Operation
- func AddFragment(fragmentProvider Provider[*mdl.Fragment]) Operation
- func AddGeometryPass(passProvider Provider[*mdl.MaterialPass]) Operation
- func AddNode(nodeProvider Provider[*mdl.Node]) Operation
- func AppendModel(modelProvider Provider[*mdl.Model]) Operation
- func BindProperty[T any](name string, valueProvider Provider[T]) Operation
- func BindSampler(name string, samplerProvider Provider[*mdl.Sampler]) Operation
- func Clear() Operation
- func EditMaterial(name string, opts ...Operation) Operation
- func ForceCollision() Operation
- func FuncOperation(apply ApplyFunc, digest DigestFunc) Operation
- func SetCastShadow(castShadowProvider Provider[bool]) Operation
- func SetCulling(modeProvider Provider[mdl.CullMode]) Operation
- func SetEmitAngleInner(angleProvider Provider[dprec.Angle]) Operation
- func SetEmitAngleOuter(angleProvider Provider[dprec.Angle]) Operation
- func SetEmitColor(colorProvider Provider[dprec.Vec4]) Operation
- func SetEmitDistance(distanceProvider Provider[float64]) Operation
- func SetFilterMode(filterModeProvider Provider[mdl.FilterMode]) Operation
- func SetFormat(formatProvider Provider[mdl.TextureFormat]) Operation
- func SetGenerateMipmaps(generateMipmapsProvider Provider[bool]) Operation
- func SetHeight(heightProvider Provider[float64]) Operation
- func SetLength(lengthProvider Provider[float64]) Operation
- func SetMipmapping(mipmappingProvider Provider[bool]) Operation
- func SetReflectionTexture(textureProvider Provider[*mdl.Texture]) Operation
- func SetRefractionTexture(textureProvider Provider[*mdl.Texture]) Operation
- func SetRotation(rotationProvider Provider[dprec.Quat]) Operation
- func SetSampleCount(countProvider Provider[int]) Operation
- func SetScale(scaleProvider Provider[dprec.Vec3]) Operation
- func SetShader(shaderProvider Provider[*mdl.Shader]) Operation
- func SetSource[T any](nodeSourceProvider Provider[T]) Operation
- func SetTarget[T any](nodeTargetProvider Provider[T]) Operation
- func SetTranslation(translationProvider Provider[dprec.Vec3]) Operation
- func SetVertexFormat(format mdl.VertexFormat) Operation
- func SetWidth(widthProvider Provider[float64]) Operation
- func SetWrapMode(wrapModeProvider Provider[mdl.WrapMode]) Operation
- type Provider
- func Const[T any](value T) Provider[T]
- func Create2DTexture(imageProvider Provider[*mdl.Image], opts ...Operation) Provider[*mdl.Texture]
- func CreateAmbientLight(opts ...Operation) Provider[*mdl.AmbientLight]
- func CreateColorSkyMaterial(colorProvider Provider[dprec.Vec4]) Provider[*mdl.Material]
- func CreateCubeMipmapTexture(cubeImagesProvider Provider[[]*mdl.CubeImage], opts ...Operation) Provider[*mdl.Texture]
- func CreateCubeTexture(cubeImageProvider Provider[*mdl.CubeImage], opts ...Operation) Provider[*mdl.Texture]
- func CreateDirectionalLight(opts ...Operation) Provider[*mdl.DirectionalLight]
- func CreateFragment(name string, topology mdl.Topology, opts ...Operation) Provider[*mdl.Fragment]
- func CreateGeometry(name string, opts ...Operation) Provider[*mdl.Geometry]
- func CreateMaterialPass(opts ...Operation) Provider[*mdl.MaterialPass]
- func CreateModel(name string, operations ...Operation) Provider[*mdl.Model]
- func CreateNode(name string, operations ...Operation) Provider[*mdl.Node]
- func CreatePointLight(opts ...Operation) Provider[*mdl.PointLight]
- func CreateSampler(textureProvider Provider[*mdl.Texture], operations ...Operation) Provider[*mdl.Sampler]
- func CreateShader(shaderType mdl.ShaderType, code string) Provider[*mdl.Shader]
- func CreateSky(materialProvider Provider[*mdl.Material], opts ...Operation) Provider[*mdl.Sky]
- func CreateSpotLight(opts ...Operation) Provider[*mdl.SpotLight]
- func CreateTextureSkyMaterial(samplerProvider Provider[*mdl.Sampler]) Provider[*mdl.Material]
- func CubeImageFromEquirectangular(imageProvider Provider[*mdl.Image]) Provider[*mdl.CubeImage]
- func DPVec4ToSPVec4(inputProvider Provider[dprec.Vec4]) Provider[sprec.Vec4]
- func Degrees(value float64) Provider[dprec.Angle]
- func FuncProvider[T any](get GetFunc[T], digest DigestFunc) Provider[T]
- func IrradianceCubeImage(imageProvider Provider[*mdl.CubeImage], opts ...Operation) Provider[*mdl.CubeImage]
- func OnceProvider[T any](delegate Provider[T]) Provider[T]
- func OpenBlob(name, path string) Provider[*mdl.Blob]
- func OpenGLTFModel(path string, opts ...Operation) Provider[*mdl.Model]
- func OpenImage(path string) Provider[*mdl.Image]
- func RGB(r, g, b float64) Provider[dprec.Vec4]
- func RGBA(r, g, b, a float64) Provider[dprec.Vec4]
- func ReflectionCubeImages(imageProvider Provider[*mdl.CubeImage], opts ...Operation) Provider[[]*mdl.CubeImage]
- func ResizedCubeImage(imageProvider Provider[*mdl.CubeImage], newSizeProvider Provider[int]) Provider[*mdl.CubeImage]
- func ResizedImage(imageProvider Provider[*mdl.Image], ...) Provider[*mdl.Image]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildModelResource ¶
func CreateDigest ¶
CreateDigest calculates the digest of the provided operation and supplementing parameters.
func Run ¶
Run runs the DSL algorithm on the provided registry. If modelNames is not empty, only the models with the provided names will be processed.
func StringDigest ¶
func StringDigest(digestable Digestable) (string, error)
StringDigest calculates the digest of the provided digestable and returns it as a hex-encoded string.
Types ¶
type DigestFunc ¶
DigestFunc is a function that calculates a digest.
type Digestable ¶
type Digestable interface {
// Digest calculates the digest of the object.
Digest() ([]byte, error)
}
Digestable represents an object that can be digested.
type Operation ¶
type Operation interface {
Digestable
Apply(target any) error
}
Operation is an operation that can be applied to a target.
func AddForwardPass ¶
func AddForwardPass(passProvider Provider[*mdl.MaterialPass]) Operation
AddForwardPass creates an operation that adds a new forward pass to the target.
func AddFragment ¶
AddFragment adds the specified fragment to the target geometry.
func AddGeometryPass ¶
func AddGeometryPass(passProvider Provider[*mdl.MaterialPass]) Operation
AddGeometryPass creates an operation that adds a new geometry pass to the target.
func AppendModel ¶
AppendModel creates an operation that appends the contents of the provided model to the target model.
func BindProperty ¶
BindProperty sets the specified property on the target property holder.
func BindSampler ¶
BindSampler sets the sampler of the target.
func Clear ¶
func Clear() Operation
Clear creates an operation that clears all data from the target.
func EditMaterial ¶
EditMaterial creates an operation that edits the material with the provided name in the target node holder.
func ForceCollision ¶
func ForceCollision() Operation
ForceCollision creates an operation that forces the target model to have a collision mesh.
func FuncOperation ¶
func FuncOperation(apply ApplyFunc, digest DigestFunc) Operation
FuncOperation creates an operation from an apply and a digest functions.
func SetCastShadow ¶ added in v0.20.0
SetCastShadow configures the cast shadow of the target.
func SetCulling ¶ added in v0.22.0
SetCulling creates an operation that sets the culling mode of the target.
func SetEmitAngleInner ¶
SetEmitAngleInner configures the inner emit angle of the target.
func SetEmitAngleOuter ¶
SetEmitAngleOuter configures the outer emit angle of the target.
func SetEmitColor ¶
SetEmitColor configures the emit color of the target.
func SetEmitDistance ¶
SetEmitDistance configures the emit distance of the target.
func SetFilterMode ¶
func SetFilterMode(filterModeProvider Provider[mdl.FilterMode]) Operation
SetFilterMode sets the filter mode of the target.
func SetFormat ¶
func SetFormat(formatProvider Provider[mdl.TextureFormat]) Operation
SetFormat configures the format of the target.
func SetGenerateMipmaps ¶
SetGenerateMipmaps configures the generate mipmaps flag of the target.
func SetMipmapping ¶
SetMipmapping sets the mipmapping of the target.
func SetReflectionTexture ¶
SetReflectionTexture configures the reflection texture of the target.
func SetRefractionTexture ¶
SetRefractionTexture configures the refraction texture of the target.
func SetRotation ¶
SetRotation sets the rotation of the target.
func SetSampleCount ¶
SetSampleCount configures the sample count of the target.
func SetTranslation ¶
SetTranslation sets the translation of the target.
func SetVertexFormat ¶
func SetVertexFormat(format mdl.VertexFormat) Operation
SetVertexFormat sets the vertex format of the target geometry.
type Provider ¶
type Provider[T any] interface { Digestable Get() (T, error) }
Provider is an interface that provides a value of a specific type.
func Create2DTexture ¶
Create2DTexture creates a new 2D texture with the specified format and source image.
func CreateAmbientLight ¶
func CreateAmbientLight(opts ...Operation) Provider[*mdl.AmbientLight]
CreateAmbientLight creates a new ambient light.
func CreateColorSkyMaterial ¶
CreateColorSkyMaterial creates a new color sky material.
func CreateCubeMipmapTexture ¶ added in v0.21.0
func CreateCubeMipmapTexture(cubeImagesProvider Provider[[]*mdl.CubeImage], opts ...Operation) Provider[*mdl.Texture]
CreateCubeMipmapTexture creates a new cube texture with the specified format and source mipmap images.
func CreateCubeTexture ¶
func CreateCubeTexture(cubeImageProvider Provider[*mdl.CubeImage], opts ...Operation) Provider[*mdl.Texture]
CreateCubeTexture creates a new cube texture with the specified format and source image.
func CreateDirectionalLight ¶
func CreateDirectionalLight(opts ...Operation) Provider[*mdl.DirectionalLight]
CreateDirectionalLight creates a new directional light.
func CreateFragment ¶
CreateFragment creates a new geometry fragment.
func CreateGeometry ¶
CreateGeometry creates a new geometry.
func CreateMaterialPass ¶
func CreateMaterialPass(opts ...Operation) Provider[*mdl.MaterialPass]
CreateMaterialPass creates a provider that will create a material pass with the specified options.
func CreateModel ¶
CreateModel creates a new model with the specified name and operations.
func CreateNode ¶
CreateNode creates a new node with the specified name and operations.
func CreatePointLight ¶
func CreatePointLight(opts ...Operation) Provider[*mdl.PointLight]
CreatePointLight creates a new point light.
func CreateSampler ¶
func CreateSampler(textureProvider Provider[*mdl.Texture], operations ...Operation) Provider[*mdl.Sampler]
CreateSampler creates a new sampler with the provided texture and operations.
func CreateShader ¶
CreateShader creates a provider that will create a shader with the specified type and source code.
func CreateSpotLight ¶
CreateSpotLight creates a new spot light.
func CreateTextureSkyMaterial ¶
CreateTextureSkyMaterial creates a new texture sky material.
func CubeImageFromEquirectangular ¶
CubeImageFromEquirectangular creates a cube image from an equirectangular image.
func DPVec4ToSPVec4 ¶
DPVec4ToSPVec4 converts the double precision vec4 to single precision vec4.
func FuncProvider ¶
func FuncProvider[T any](get GetFunc[T], digest DigestFunc) Provider[T]
FuncProvider creates a provider from a get and a digest function.
func IrradianceCubeImage ¶
func IrradianceCubeImage(imageProvider Provider[*mdl.CubeImage], opts ...Operation) Provider[*mdl.CubeImage]
IrradianceCubeImage creates an irradiance cube image from the provided HDR skybox cube image.
func OnceProvider ¶
OnceProvider creates a provider that caches the result of the delegate provider.
func OpenGLTFModel ¶
OpenGLTFModel creates a new model provider that loads a model from the specified path.
func ReflectionCubeImages ¶ added in v0.21.0
func ReflectionCubeImages(imageProvider Provider[*mdl.CubeImage], opts ...Operation) Provider[[]*mdl.CubeImage]
ReflectionCubeImages creates a reflection cube image mipmap set from the provided HDR skybox cube image.
Source Files
¶
- algorithm.go
- digest.go
- operation.go
- operation_geometry.go
- operation_image.go
- operation_light.go
- operation_material.go
- operation_model.go
- operation_node.go
- operation_property_holder.go
- operation_sampler.go
- operation_sampler_holder.go
- operation_texture.go
- operation_transform.go
- provider.go
- provider_blob.go
- provider_geometry.go
- provider_image.go
- provider_light.go
- provider_material.go
- provider_model.go
- provider_node.go
- provider_primitive.go
- provider_sampler.go
- provider_sky.go
- provider_texture.go