update
This commit is contained in:
3
.import/sky2.jpg-bf80cb1dda623823975e8be3440606f5.md5
Normal file
3
.import/sky2.jpg-bf80cb1dda623823975e8be3440606f5.md5
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
source_md5="9fa407d9977812173983453120ee812e"
|
||||||
|
dest_md5="0595521ab1661cf3d800c40f50cf8655"
|
||||||
|
|
||||||
BIN
.import/sky2.jpg-bf80cb1dda623823975e8be3440606f5.stex
Normal file
BIN
.import/sky2.jpg-bf80cb1dda623823975e8be3440606f5.stex
Normal file
Binary file not shown.
3
.import/sky2.jpg-dc6eca33f2484285b9b7bb36d0d1c5e6.md5
Normal file
3
.import/sky2.jpg-dc6eca33f2484285b9b7bb36d0d1c5e6.md5
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
source_md5="9fa407d9977812173983453120ee812e"
|
||||||
|
dest_md5="0595521ab1661cf3d800c40f50cf8655"
|
||||||
|
|
||||||
BIN
.import/sky2.jpg-dc6eca33f2484285b9b7bb36d0d1c5e6.stex
Normal file
BIN
.import/sky2.jpg-dc6eca33f2484285b9b7bb36d0d1c5e6.stex
Normal file
Binary file not shown.
3
.import/sky2e.jpg-fcd27e7be5dc9c60995c31aa32b89cfb.md5
Normal file
3
.import/sky2e.jpg-fcd27e7be5dc9c60995c31aa32b89cfb.md5
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
source_md5="6f03573776abdfd807ae378ffbc16dde"
|
||||||
|
dest_md5="44a55859fe121110799b7e5d45cc011a"
|
||||||
|
|
||||||
BIN
.import/sky2e.jpg-fcd27e7be5dc9c60995c31aa32b89cfb.stex
Normal file
BIN
.import/sky2e.jpg-fcd27e7be5dc9c60995c31aa32b89cfb.stex
Normal file
Binary file not shown.
19
default_bus_layout.tres
Normal file
19
default_bus_layout.tres
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[gd_resource type="AudioBusLayout" load_steps=3 format=2]
|
||||||
|
|
||||||
|
[sub_resource type="AudioEffectCapture" id=1]
|
||||||
|
resource_name = "Capture"
|
||||||
|
|
||||||
|
[sub_resource type="AudioEffectSpectrumAnalyzer" id=2]
|
||||||
|
resource_name = "SpectrumAnalyzer"
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
bus/1/name = "Input"
|
||||||
|
bus/1/solo = false
|
||||||
|
bus/1/mute = true
|
||||||
|
bus/1/bypass_fx = false
|
||||||
|
bus/1/volume_db = 0.0
|
||||||
|
bus/1/send = "Master"
|
||||||
|
bus/1/effect/0/effect = SubResource( 1 )
|
||||||
|
bus/1/effect/0/enabled = true
|
||||||
|
bus/1/effect/1/effect = SubResource( 2 )
|
||||||
|
bus/1/effect/1/enabled = true
|
||||||
@@ -1,8 +1,13 @@
|
|||||||
[gd_resource type="Environment" load_steps=2 format=2]
|
[gd_resource type="Environment" load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://textures/sky2e.jpg" type="Texture" id=1]
|
||||||
|
|
||||||
[sub_resource type="PanoramaSky" id=1]
|
[sub_resource type="PanoramaSky" id=1]
|
||||||
|
panorama = ExtResource( 1 )
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
background_mode = 2
|
background_mode = 2
|
||||||
background_sky = SubResource( 1 )
|
background_sky = SubResource( 1 )
|
||||||
|
background_sky_custom_fov = 72.0
|
||||||
ambient_light_sky_contribution = 0.49
|
ambient_light_sky_contribution = 0.49
|
||||||
|
fog_color = Color( 0.27451, 0.643137, 0.741176, 1 )
|
||||||
|
|||||||
@@ -12,6 +12,17 @@ var lights
|
|||||||
|
|
||||||
var texsize = 128
|
var texsize = 128
|
||||||
|
|
||||||
|
var abusi
|
||||||
|
var abusc
|
||||||
|
var abuss
|
||||||
|
|
||||||
|
var bval2 = 0.0
|
||||||
|
var lbval2 = 0.0
|
||||||
|
var dbval2 = 0.0
|
||||||
|
var rms = 0.0
|
||||||
|
var arms = 0.0
|
||||||
|
var rpeak = 0.0
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
#for i in len(textureset):
|
#for i in len(textureset):
|
||||||
# textureset[i] = load("res://textures/kobolds/%s.png" % textureset[i])
|
# textureset[i] = load("res://textures/kobolds/%s.png" % textureset[i])
|
||||||
@@ -27,6 +38,10 @@ func _ready():
|
|||||||
add_child(kobold)
|
add_child(kobold)
|
||||||
kobolds.append([Vector3(rand_range(-2,2),2,rand_range(-3,3)),Vector3.ZERO,kobold])
|
kobolds.append([Vector3(rand_range(-2,2),2,rand_range(-3,3)),Vector3.ZERO,kobold])
|
||||||
lights = get_parent().lights
|
lights = get_parent().lights
|
||||||
|
abusi = AudioServer.get_bus_index("Input")
|
||||||
|
abusc = AudioServer.get_bus_effect(abusi,0)
|
||||||
|
abuss = AudioServer.get_bus_effect_instance(abusi,1)
|
||||||
|
abusc.buffer_length = 0.1
|
||||||
|
|
||||||
const bouncemin = 1
|
const bouncemin = 1
|
||||||
const bouncemax = 2
|
const bouncemax = 2
|
||||||
@@ -37,6 +52,18 @@ var bounceboost = 2
|
|||||||
var velocity = Vector3.ZERO
|
var velocity = Vector3.ZERO
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
|
rms = 0
|
||||||
|
var adata = abusc.get_buffer(int(AudioServer.get_mix_rate()*delta)+1)
|
||||||
|
for v in adata:
|
||||||
|
rms += pow(v.x+v.y,2)
|
||||||
|
arms = arms*0.9 + rms*0.1
|
||||||
|
rpeak = clamp(rms/max(arms*2,1)-0.5,0,1)
|
||||||
|
#lbval2 = bval2
|
||||||
|
#bval2 = abuss.get_magnitude_for_frequency_range(18000,20000).length()*100
|
||||||
|
#dbval2 = (bval2-lbval2)*delta*1000
|
||||||
|
bounceboost = 1 + rpeak + clamp(rms/250,0,1)
|
||||||
|
$"/root/Spatial/DebugText".text = "%0.4f\n%0.4f\n%0.4f\n%d\n%d" % [rms,arms,rpeak,abusc.get_buffer_length_frames(),abusc.get_frames_available()]
|
||||||
|
#print(rms)
|
||||||
for i in range(sc,kobcount,skip):
|
for i in range(sc,kobcount,skip):
|
||||||
var kobold = kobolds[i]
|
var kobold = kobolds[i]
|
||||||
kobold[1].y -= 9.81*delta*skip
|
kobold[1].y -= 9.81*delta*skip
|
||||||
|
|||||||
28
lights.gd
28
lights.gd
@@ -2,6 +2,10 @@ extends MeshInstance
|
|||||||
|
|
||||||
var t = 0.0
|
var t = 0.0
|
||||||
var mat
|
var mat
|
||||||
|
var peakt = 0.0
|
||||||
|
var peako = false
|
||||||
|
|
||||||
|
const dim = 0.2
|
||||||
|
|
||||||
var lights = [
|
var lights = [
|
||||||
[Vector3(6,-4.5,-2.25),Vector3.ZERO],
|
[Vector3(6,-4.5,-2.25),Vector3.ZERO],
|
||||||
@@ -10,18 +14,34 @@ var lights = [
|
|||||||
[Vector3(10,-4.5,-8),Vector3.ZERO]
|
[Vector3(10,-4.5,-8),Vector3.ZERO]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
func rcv3():
|
||||||
|
var tcol = Color.from_hsv(randf(),rand_range(0.85,1),1.0)
|
||||||
|
return Vector3(tcol.r,tcol.g,tcol.b)
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
for light in lights:
|
for light in lights:
|
||||||
light[0] = to_global(light[0])
|
light[0] = to_global(light[0])
|
||||||
mat = get_surface_material(1)
|
mat = get_surface_material(1)
|
||||||
|
for light in lights:
|
||||||
|
light[1] = rcv3()*dim
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
t += delta
|
t += delta
|
||||||
lights[0][1] = Vector3(1,0,0)*(sin(t*4)/2+0.5)
|
if !peako and $kobolds.rpeak >= 0.5 and peakt >= 0.2:
|
||||||
lights[1][1] = Vector3(0,1,0)*(sin(t*5.123)/2+0.5)
|
peako = true
|
||||||
lights[2][1] = Vector3(0,0,1)*(sin(t*6.7)/2+0.5)
|
lights[randi()%len(lights)][1] = rcv3()
|
||||||
lights[3][1] = Vector3(1,0.5,0)*(sin(t*3.141)/2+0.5)
|
if peako and $kobolds.rpeak <= 0.3:
|
||||||
|
peako = false
|
||||||
|
peakt = 0.0
|
||||||
|
#lights[0][1] = Vector3(1,0,0)*float(cycle==0) #(sin(t*4)/2+0.5)
|
||||||
|
#lights[1][1] = Vector3(0,1,0)*float(cycle==1) #(sin(t*5.123)/2+0.5)
|
||||||
|
#lights[2][1] = Vector3(0,0,1)*float(cycle==2) #(sin(t*6.7)/2+0.5)
|
||||||
|
#lights[3][1] = Vector3(1,0.5,0)*float(cycle==3) #(sin(t*3.141)/2+0.5)
|
||||||
mat.set_shader_param("col1",lights[0][1])
|
mat.set_shader_param("col1",lights[0][1])
|
||||||
mat.set_shader_param("col2",lights[1][1])
|
mat.set_shader_param("col2",lights[1][1])
|
||||||
mat.set_shader_param("col3",lights[2][1])
|
mat.set_shader_param("col3",lights[2][1])
|
||||||
mat.set_shader_param("col4",lights[3][1])
|
mat.set_shader_param("col4",lights[3][1])
|
||||||
|
for light in lights:
|
||||||
|
if Color(light[1].x,light[1].y,light[1].z).v > 0.2:
|
||||||
|
light[1] *= 0.9
|
||||||
|
peakt += delta
|
||||||
|
|||||||
14
main.tscn
14
main.tscn
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=12 format=2]
|
[gd_scene load_steps=13 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://speen.gd" type="Script" id=1]
|
[ext_resource path="res://speen.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://beach.obj" type="ArrayMesh" id=2]
|
[ext_resource path="res://beach.obj" type="ArrayMesh" id=2]
|
||||||
@@ -18,6 +18,8 @@ _data = {
|
|||||||
"tilts": PoolRealArray( 0, 0, 0, 0, 0, 0 )
|
"tilts": PoolRealArray( 0, 0, 0, 0, 0, 0 )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AudioStreamMicrophone" id=2]
|
||||||
|
|
||||||
[node name="Spatial" type="Spatial"]
|
[node name="Spatial" type="Spatial"]
|
||||||
|
|
||||||
[node name="island" type="MeshInstance" parent="."]
|
[node name="island" type="MeshInstance" parent="."]
|
||||||
@@ -70,3 +72,13 @@ anchor_right = 1.0
|
|||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
color = Color( 0, 0, 0, 1 )
|
color = Color( 0, 0, 0, 1 )
|
||||||
script = ExtResource( 9 )
|
script = ExtResource( 9 )
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = SubResource( 2 )
|
||||||
|
autoplay = true
|
||||||
|
bus = "Input"
|
||||||
|
|
||||||
|
[node name="DebugText" type="Label" parent="."]
|
||||||
|
visible = false
|
||||||
|
margin_right = 40.0
|
||||||
|
margin_bottom = 14.0
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ config/icon="res://icon.png"
|
|||||||
|
|
||||||
[audio]
|
[audio]
|
||||||
|
|
||||||
|
driver=""
|
||||||
enable_audio_input=true
|
enable_audio_input=true
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|||||||
BIN
sources/theduck.blend
Normal file
BIN
sources/theduck.blend
Normal file
Binary file not shown.
BIN
sources/theduck.blend1
Normal file
BIN
sources/theduck.blend1
Normal file
Binary file not shown.
BIN
textures/sky2.jpg
Normal file
BIN
textures/sky2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
35
textures/sky2.jpg.import
Normal file
35
textures/sky2.jpg.import
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/sky2.jpg-dc6eca33f2484285b9b7bb36d0d1c5e6.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://textures/sky2.jpg"
|
||||||
|
dest_files=[ "res://.import/sky2.jpg-dc6eca33f2484285b9b7bb36d0d1c5e6.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
||||||
BIN
textures/sky2e.jpg
Normal file
BIN
textures/sky2e.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
35
textures/sky2e.jpg.import
Normal file
35
textures/sky2e.jpg.import
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/sky2e.jpg-fcd27e7be5dc9c60995c31aa32b89cfb.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://textures/sky2e.jpg"
|
||||||
|
dest_files=[ "res://.import/sky2e.jpg-fcd27e7be5dc9c60995c31aa32b89cfb.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
||||||
9
textures/testsky.tres
Normal file
9
textures/testsky.tres
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[gd_resource type="GradientTexture2D" load_steps=2 format=2]
|
||||||
|
|
||||||
|
[sub_resource type="Gradient" id=2]
|
||||||
|
colors = PoolColorArray( 0.3476, 0.59092, 0.79, 1, 0.550781, 0.7789, 1, 1 )
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
gradient = SubResource( 2 )
|
||||||
|
fill_from = Vector2( 0.7, 0.5 )
|
||||||
|
fill_to = Vector2( 0.7, 0.4 )
|
||||||
Reference in New Issue
Block a user