normals

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillImage added in v0.35.0

func FillImage(img draw.Image)

func RasterizeNormalmap added in v0.35.0

func RasterizeNormalmap(normals NormalMap) image.Image

Types

type Direction

type Direction int
const (
	Additive Direction = iota
	Subtractive
)

type DrawLineNode added in v0.35.0

type DrawLineNode struct {
	Thicknesses nodes.Output[float64]
	Start       nodes.Output[vector2.Float64]
	End         nodes.Output[vector2.Float64]
	Subtract    nodes.Output[bool]
	Texture     nodes.Output[NormalMap] `description:"texture to draw on"`
}

func (DrawLineNode) NormalMap added in v0.35.0

func (n DrawLineNode) NormalMap(out *nodes.StructOutput[NormalMap])

type DrawLinesNode added in v0.35.0

type DrawLinesNode struct {
	Thicknesses nodes.Output[[]float64]
	Lines       nodes.Output[[]geometry.Line2D]
	Texture     nodes.Output[NormalMap] `description:"texture to draw on"`
}

func (DrawLinesNode) NormalMap added in v0.35.0

func (n DrawLinesNode) NormalMap(out *nodes.StructOutput[NormalMap])

type DrawSphereNode added in v0.35.0

type DrawSphereNode struct {
	Radius      nodes.Output[float64]
	Position    nodes.Output[vector2.Float64]
	Subtract    nodes.Output[bool]
	StartRadius nodes.Output[float64]
	EndRadius   nodes.Output[float64]
	Texture     nodes.Output[NormalMap] `description:"texture to draw on"`
}

func (DrawSphereNode) NormalMap added in v0.35.0

func (n DrawSphereNode) NormalMap(out *nodes.StructOutput[NormalMap])

type DrawSpheresNode added in v0.35.0

type DrawSpheresNode struct {
	Radii     nodes.Output[[]float64]
	Positions nodes.Output[[]vector2.Float64]
	Subtract  nodes.Output[bool]
	Texture   nodes.Output[NormalMap] `description:"texture to draw on"`
}

func (DrawSpheresNode) NormalMap added in v0.35.0

func (n DrawSpheresNode) NormalMap(out *nodes.StructOutput[NormalMap])

type FromHeightMapNode added in v0.35.0

type FromHeightMapNode struct {
	In    nodes.Output[HeightMap]
	Scale nodes.Output[float64]
}

func (FromHeightMapNode) NormalMap added in v0.35.0

func (n FromHeightMapNode) NormalMap(out *nodes.StructOutput[NormalMap])

func (FromHeightMapNode) NormalMapImage added in v0.35.0

func (n FromHeightMapNode) NormalMapImage(out *nodes.StructOutput[image.Image])

type FromImageNode added in v0.35.0

type FromImageNode struct {
	In    nodes.Output[image.Image]
	Scale nodes.Output[float64]
}

func (FromImageNode) Heightmap added in v0.35.0

func (n FromImageNode) Heightmap(out *nodes.StructOutput[HeightMap])

func (FromImageNode) NormalMapImage added in v0.35.0

func (n FromImageNode) NormalMapImage(out *nodes.StructOutput[image.Image])

func (FromImageNode) Normalmap added in v0.35.0

func (n FromImageNode) Normalmap(out *nodes.StructOutput[NormalMap])

type FromNormalMapNode added in v0.35.0

type FromNormalMapNode struct {
	Normals nodes.Output[NormalMap]
}

func (FromNormalMapNode) Image added in v0.35.0

type HeightMap added in v0.35.0

type HeightMap = texturing.Texture[float64]

func ImageToHeightmap added in v0.35.0

func ImageToHeightmap(img image.Image, scale float64) HeightMap

type Line

type Line struct {
	Start           vector2.Float64
	End             vector2.Float64
	Width           float64
	NormalDirection Direction
}

func (Line) Dir

func (l Line) Dir() vector2.Float64

Dir is end point - starting point

func (Line) Round

func (l Line) Round(src NormalMap)

type NewNode added in v0.35.0

type NewNode struct {
	Dimensions nodes.Output[vector2.Int]
}

func (NewNode) NormalMap added in v0.35.0

func (n NewNode) NormalMap(out *nodes.StructOutput[NormalMap])

type Sphere

type Sphere struct {
	Center    vector2.Float64
	Radius    float64
	Direction Direction

	Start *float64
	End   *float64
}

func (Sphere) Draw

func (s Sphere) Draw(src NormalMap)

Jump to

Keyboard shortcuts

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