Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | aXu_AP |
I wonder if it’s possible to have NoiseTexture use a custom-defined noise instead of OpenSimplexNoise. I tried inheriting OpenSimplexNoise and overriding get_image and get_seamless_image:
tool
extends OpenSimplexNoise
class_name CustomNoise
export var brightness := 1.0
func get_seamless_image(size : int) -> Image:
var img = Image.new()
img.create(size, size, false, Image.FORMAT_L8)
img.lock()
for x in size:
for y in size:
img.set_pixel(x, y, Color(brightness, brightness, brightness))
img.unlock()
return img
And it works, kind of, but not actually. I can choose it in editor as a noise source for NoiseTexture and even see the added export value. However, the function calls aren’t overridden, resulting in original noise.
I know I could just make a script which creates images runtime, but I’d appreciate the possibility to preview it in the editor. In addition to that, NoiseTexture offers normal map creation, another feature I’d use.