NoiseTexture

Inherits: Texture < Resource < Reference < Object

OpenSimplexNoise filled texture.

Description

Uses an OpenSimplexNoise to fill the texture data. You can specify the texture size but keep in mind that larger textures will take longer to generate and seamless noise only works with square sized textures.

NoiseTexture can also generate normalmap textures.

The class uses Threads to generate the texture data internally, so Texture.get_data 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 data:

var texture = preload("res://noise.tres")
yield(texture, "changed")
var image = texture.get_data()

Properties

bool

as_normalmap

false

float

bump_strength

8.0

int

flags

7 (overrides Texture)

int

height

512

OpenSimplexNoise

noise

Vector2

noise_offset

Vector2( 0, 0 )

bool

seamless

false

int

width

512


Property Descriptions

bool as_normalmap = false

  • void set_as_normalmap ( bool value )

  • bool is_normalmap ( )

If true, the resulting texture contains a normal map created from the original noise interpreted as a bump map.


float bump_strength = 8.0

  • void set_bump_strength ( float value )

  • float get_bump_strength ( )

Strength of the bump maps used in this texture. A higher value will make the bump maps appear larger while a lower value will make them appear softer.


int height = 512

  • void set_height ( int value )

  • int get_height ( )

Height of the generated texture.


OpenSimplexNoise noise

The OpenSimplexNoise instance used to generate the noise.


Vector2 noise_offset = Vector2( 0, 0 )

  • void set_noise_offset ( Vector2 value )

  • Vector2 get_noise_offset ( )

An offset used to specify the noise space coordinate of the top left corner of the generated noise. This value is ignored if seamless is enabled.


bool seamless = false

  • void set_seamless ( bool value )

  • bool get_seamless ( )

Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate.

Note: Seamless noise has a lower contrast compared to non-seamless noise. This is due to the way noise uses higher dimensions for generating seamless noise.


int width = 512

  • void set_width ( int value )

  • int get_width ( )

Width of the generated texture.