2022-06-17 09:09:23 +02:00
|
|
|
extends OmniLight
|
|
|
|
|
|
|
|
|
2022-06-20 10:33:39 +02:00
|
|
|
# Declare member variables here.
|
2022-06-17 09:09:23 +02:00
|
|
|
var _noise = OpenSimplexNoise.new()
|
|
|
|
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
randomize()
|
|
|
|
# Configure the OpenSimplexNoise instance.
|
|
|
|
_noise.seed = randi()
|
|
|
|
_noise.octaves = 4
|
|
|
|
_noise.period = 20.0
|
|
|
|
_noise.persistence = 0.8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
2022-06-20 10:33:39 +02:00
|
|
|
func _process(_delta):
|
2022-06-17 09:09:23 +02:00
|
|
|
if(OS.get_ticks_msec()%100<10):
|
|
|
|
light_energy = 1 + _noise.get_noise_1d(OS.get_ticks_msec())
|
|
|
|
|