NoiseTexture3D

package
v0.0.0-...-357ca8a Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Uses the FastNoiseLite library or other noise generators to fill the texture data of your desired size.

The class uses Threads to generate the texture data internally, so Texture3D.GetData may return null if the generation process has not completed yet. In that case, you need to wait for the texture to be generated before accessing the image:

package main

import (
	"graphics.gd/classdb/FastNoiseLite"
	"graphics.gd/classdb/NoiseTexture3D"
)

func ExampleNoiseTexture3D() {
	var texture = NoiseTexture3D.New()
	texture.SetNoise(FastNoiseLite.New().AsNoise())
	texture.AsResource().OnChanged(func() {
		var data = texture.AsTexture3D().GetData()
		_ = data
	})
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsNoiseTexture3D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsNoiseTexture3D

func (self *Extension[T]) AsNoiseTexture3D() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

func (*Extension[T]) AsTexture

func (self *Extension[T]) AsTexture() Texture.Instance

func (*Extension[T]) AsTexture3D

func (self *Extension[T]) AsTexture3D() Texture3D.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.NoiseTexture3D

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsNoiseTexture3D

func (self Instance) AsNoiseTexture3D() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsTexture

func (self Instance) AsTexture() Texture.Instance

func (Instance) AsTexture3D

func (self Instance) AsTexture3D() Texture3D.Instance

func (Instance) ColorRamp

func (self Instance) ColorRamp() Gradient.Instance

A Gradient which is used to map the luminance of each pixel to a color value.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Invert

func (self Instance) Invert() bool

If true, inverts the noise texture. White becomes black, black becomes white.

func (Instance) Noise

func (self Instance) Noise() Noise.Instance

The instance of the Noise object.

func (Instance) Normalize

func (self Instance) Normalize() bool

If true, the noise image coming from the noise generator is normalized to the range 0.0 to 1.0.

Turning normalization off can affect the contrast and allows you to generate non repeating tileable noise textures.

func (Instance) Seamless

func (self Instance) Seamless() bool

If true, a seamless texture is requested from the Noise resource.

Note: Seamless noise textures may take longer to generate and/or can have a lower contrast compared to non-seamless noise depending on the used Noise resource. This is because some implementations use higher dimensions for generating seamless noise.

Note: The default FastNoiseLite implementation uses the fallback path for seamless generation. If using a Width, Height or Depth lower than the default, you may need to increase SeamlessBlendSkirt to make seamless blending more effective.

func (Instance) SeamlessBlendSkirt

func (self Instance) SeamlessBlendSkirt() Float.X

Used for the default/fallback implementation of the seamless texture generation. It determines the distance over which the seams are blended. High values may result in less details and contrast. See Noise for further details.

Note: If using a Width, Height or Depth lower than the default, you may need to increase SeamlessBlendSkirt to make seamless blending more effective.

func (Instance) SetColorRamp

func (self Instance) SetColorRamp(value Gradient.Instance)

SetColorRamp sets the property returned by [GetColorRamp].

func (Instance) SetDepth

func (self Instance) SetDepth(value int)

Depth of the generated texture (in pixels).

func (Instance) SetHeight

func (self Instance) SetHeight(value int)

Height of the generated texture (in pixels).

func (Instance) SetInvert

func (self Instance) SetInvert(value bool)

SetInvert sets the property returned by [GetInvert].

func (Instance) SetNoise

func (self Instance) SetNoise(value Noise.Instance)

SetNoise sets the property returned by [GetNoise].

func (Instance) SetNormalize

func (self Instance) SetNormalize(value bool)

SetNormalize sets the property returned by [IsNormalized].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetSeamless

func (self Instance) SetSeamless(value bool)

SetSeamless sets the property returned by [GetSeamless].

func (Instance) SetSeamlessBlendSkirt

func (self Instance) SetSeamlessBlendSkirt(value Float.X)

SetSeamlessBlendSkirt sets the property returned by [GetSeamlessBlendSkirt].

func (Instance) SetWidth

func (self Instance) SetWidth(value int)

Width of the generated texture (in pixels).

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

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