material

package
v0.0.0-...-e791307 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamReflectance   = "reflectance"
	ParamSpecularity   = "specularity"
	ParamTransmittance = "transmittance"
	ParamRadiance      = "radiance"
	ParamIntIOR        = "intIOR"
	ParamExtIOR        = "extIOR"
	ParamScale         = "scale"
	ParamRoughness     = "roughness"
)

Variables

View Source
var (
	DefaultRoughness      float32 = 0.1
	DefaultReflectance            = types.Vec4{0.2, 0.2, 0.2, 0.0}
	DefaultSpecularity            = types.Vec4{1.0, 1.0, 1.0, 0.0}
	DefaultTransmittance          = types.Vec4{1.0, 1.0, 1.0, 0.0}
	DefaultRadiance               = types.Vec4{1.0, 1.0, 1.0, 0.0}
	DefaultRadianceScaler float32 = 1.0
	DefaultIntIOR                 = KnownIORs["Glass"]
	DefaultExtIOR                 = KnownIORs["Air"]
)
View Source
var (
	KnownIORs = map[string]float32{}/* 245 elements not displayed */

)

Built-in list of known material IORs. Sourced from: http://forums.cgsociety.org/archive/index.php?t-513458.html

Functions

func IOR

func IOR(name MaterialNameNode) (float32, error)

func IsBxdfType

func IsBxdfType(t uint32) bool

Helper function to check if a value represents a bxdf type.

func IsOpType

func IsOpType(t uint32) bool

Helper function to check if a value represents an op type.

Types

type BumpMapNode

type BumpMapNode struct {
	Expression ExprNode
	Texture    TextureNode
}

func (BumpMapNode) Validate

func (n BumpMapNode) Validate() error

type BxdfNode

type BxdfNode struct {
	Type       BxdfType
	Parameters BxdfParameterList
}

func (BxdfNode) Validate

func (n BxdfNode) Validate() error

type BxdfParamNode

type BxdfParamNode struct {
	Name  string
	Value ExprNode
}

func (BxdfParamNode) Validate

func (n BxdfParamNode) Validate() error

type BxdfParameterList

type BxdfParameterList []BxdfParamNode

func (BxdfParameterList) Validate

func (n BxdfParameterList) Validate() error

type BxdfType

type BxdfType uint32

BxdfType represents the surface types supported by the renderer.

const (

	//
	BxdfEmissive BxdfType
	BxdfDiffuse
	BxdfConductor
	BxdfRoughtConductor
	BxdfDielectric
	BxdfRoughDielectric
)

func (BxdfType) String

func (t BxdfType) String() string

type DisperseNode

type DisperseNode struct {
	Expression ExprNode
	IntIOR     Vec3Node
	ExtIOR     Vec3Node
}

func (DisperseNode) Validate

func (n DisperseNode) Validate() error

type ExprNode

type ExprNode interface {
	Validate() error
}

func ParseExpression

func ParseExpression(input string) (ExprNode, error)

Parser interface.

type FloatNode

type FloatNode float32

func (FloatNode) Validate

func (n FloatNode) Validate() error

type MaterialNameNode

type MaterialNameNode string

func (MaterialNameNode) Validate

func (n MaterialNameNode) Validate() error

type MaterialRefNode

type MaterialRefNode string

func (MaterialRefNode) Validate

func (n MaterialRefNode) Validate() error

type MixMapNode

type MixMapNode struct {
	Expressions [2]ExprNode
	Texture     TextureNode
}

func (MixMapNode) Validate

func (n MixMapNode) Validate() error

type MixNode

type MixNode struct {
	Expressions [2]ExprNode
	Weight      float32
}

func (MixNode) Validate

func (n MixNode) Validate() error

type NormalMapNode

type NormalMapNode struct {
	Expression ExprNode
	Texture    TextureNode
}

func (NormalMapNode) Validate

func (n NormalMapNode) Validate() error

type OpType

type OpType uint32

OpType represents a blend or modification operator that is applies to one or more bxdf expressions.

const (

	//
	OpMix OpType
	OpMixMap
	OpBumpMap
	OpNormalMap
	OpDisperse
)

type TextureNode

type TextureNode string

func (TextureNode) Validate

func (n TextureNode) Validate() error

type Vec3Node

type Vec3Node types.Vec3

func (Vec3Node) Validate

func (n Vec3Node) Validate() error

Jump to

Keyboard shortcuts

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