Skip to content

Commit

Permalink
v1.2
Browse files Browse the repository at this point in the history
- Added a starburst effect on top of the flares.
- Added a distortion quality setting to the lens flare.
- Added a flare blur setting to the lens flare. This doesn't actually blur the effect, but rather selects a different lod of the screen texture, which means that the flare bias should be reduced when this increases.
- Changed the camera controls in the demo to the WASD keys.
- Updated to Godot 3.1.1 where the screen texture is not clamped at brightness 1.
  • Loading branch information
SIsilicon committed Sep 30, 2019
1 parent 11715d1 commit 29ddffd
Show file tree
Hide file tree
Showing 13 changed files with 328 additions and 647 deletions.
25 changes: 16 additions & 9 deletions CamControl.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
extends Camera

const UP = Vector3(0, 1, 0)
const camera_speed = 0.5
export var camera_speed = 0.5

var temp_translation;

func _ready():
temp_translation = translation

func _physics_process(delta):

Expand All @@ -10,13 +15,15 @@ func _physics_process(delta):
var xform = get_transform()
var upangle = acos(-xform.basis[2].dot(UP))

if Input.is_key_pressed(KEY_LEFT):
translation += xform.basis[0] * speed * sin(upangle)
if Input.is_key_pressed(KEY_RIGHT):
translation -= xform.basis[0] * speed * sin(upangle)
if Input.is_key_pressed(KEY_DOWN):
translation += xform.basis[1] * speed
if Input.is_key_pressed(KEY_UP):
translation -= xform.basis[1] * speed
if Input.is_key_pressed(KEY_A):
temp_translation += xform.basis[0] * speed * sin(upangle)
if Input.is_key_pressed(KEY_D):
temp_translation -= xform.basis[0] * speed * sin(upangle)
if Input.is_key_pressed(KEY_S):
temp_translation += xform.basis[1] * speed
if Input.is_key_pressed(KEY_W):
temp_translation -= xform.basis[1] * speed

translation = translation.linear_interpolate(temp_translation, 0.3)

look_at(Vector3(), UP)
44 changes: 23 additions & 21 deletions FlareEditor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@ extends Panel

onready var lens_flare = $"../LensFlare"

func _process(delta):
for i in $Settings.get_children():
match i.name:
"FlareStrength":
lens_flare.flareStrength = \
$Settings/FlareStrength/HSlider.value
"FlareBias":
lens_flare.flareBias = \
$Settings/FlareBias/HSlider.value
"Distortion":
lens_flare.distortion = \
$Settings/Distortion/HSlider.value
"GhostCount":
lens_flare.ghostCount = \
$Settings/GhostCount/HSlider.value
"GhostSpacing":
lens_flare.ghostSpacing = \
$Settings/GhostSpacing/HSlider.value
"HaloWidth":
lens_flare.haloWidth = \
$Settings/HaloWidth/HSlider.value
func _on_FlareStrength_value_changed(value):
lens_flare.flareStrength = value

func _on_FlareBias_value_changed(value):
lens_flare.flareBias = value

func _on_FlareBlur_value_changed(value):
lens_flare.flareBlur = value

func _on_Distortion_value_changed(value):
lens_flare.distortion = value

func _on_GhostCount_value_changed(value):
lens_flare.ghostCount = value

func _on_GhostSpacing_value_changed(value):
lens_flare.ghostSpacing = value

func _on_HaloWidth_value_changed(value):
lens_flare.haloWidth = value

func _on_DistortQuality_item_selected(ID):
lens_flare.distortionQuality = ID
Loading

0 comments on commit 29ddffd

Please sign in to comment.