first
This commit is contained in:
21
Maps/Spaceship/Objects/flicker_omni_light_3d.gd
Normal file
21
Maps/Spaceship/Objects/flicker_omni_light_3d.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
extends OmniLight3D
|
||||
class_name FlickerOmniLight3D
|
||||
|
||||
@export var noise: NoiseTexture2D = load("res://Maps/Spaceship/Objects/FlickerOmniLightNoise.tres")
|
||||
@export var strength: float = 1.0
|
||||
var timePassed: float = 0
|
||||
|
||||
func _ready() -> void:
|
||||
#self.light_color = Color(0.891, 1.0, 1.0)
|
||||
#shadow_enabled = true
|
||||
#Color(1.0, 0.75, 0.468) Orange
|
||||
pass
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
timePassed += delta
|
||||
|
||||
if !noise: return
|
||||
var sampledNoise = noise.noise.get_noise_1d(timePassed)
|
||||
sampledNoise = abs(sampledNoise)
|
||||
|
||||
light_energy = clampf(sampledNoise*strength, 0.25,10)
|
||||
Reference in New Issue
Block a user