Handgun material tweaks, shell casing smoke particles.

godot4-port
unfa 2020-09-27 17:39:05 +02:00
parent 013eaa6b94
commit 7714f274f6
7 changed files with 191 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
height="32"
viewBox="0 0 8.4666665 8.4666669"
version="1.1"
id="svg8"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="SubtleSmoke.svg"
inkscape:export-filename="/data/Projects/Games/Liblast/Assets/Effects/SubtleSmoke.png"
inkscape:export-xdpi="384"
inkscape:export-ydpi="384">
<defs
id="defs2">
<linearGradient
id="linearGradient862"
inkscape:collect="always">
<stop
id="stop858"
offset="0"
style="stop-color:#ffffff;stop-opacity:1;" />
<stop
id="stop860"
offset="1"
style="stop-color:#ffffff;stop-opacity:0;" />
</linearGradient>
<radialGradient
gradientTransform="matrix(1.0532953,0,0,1.0532953,-0.22561667,-0.22561667)"
gradientUnits="userSpaceOnUse"
r="3.9784811"
fy="4.2333331"
fx="4.2333331"
cy="4.2333331"
cx="4.2333331"
id="radialGradient864"
xlink:href="#linearGradient862"
inkscape:collect="always" />
<filter
inkscape:label="Lapping"
inkscape:menu="Distort"
inkscape:menu-tooltip="Something like a water noise"
height="1.3"
y="-0.15"
width="1.3"
x="-0.15"
style="color-interpolation-filters:sRGB;"
id="filter841">
<feTurbulence
numOctaves="5"
seed="0"
type="fractalNoise"
baseFrequency="0.1"
result="result1"
id="feTurbulence835" />
<feGaussianBlur
stdDeviation="2"
result="result2"
id="feGaussianBlur837" />
<feDisplacementMap
scale="0"
yChannelSelector="B"
xChannelSelector="R"
in="SourceGraphic"
in2="result2"
id="feDisplacementMap839" />
</filter>
<filter
inkscape:collect="always"
style="color-interpolation-filters:sRGB"
id="filter987"
x="-0.56735778"
width="2.1347156"
y="-0.56735778"
height="2.1347156">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.981268"
id="feGaussianBlur989" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#000000"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="11.2"
inkscape:cx="24.441285"
inkscape:cy="23.797249"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1051"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<circle
r="4.1905155"
cy="4.2333331"
cx="4.2333331"
id="path830"
style="fill:url(#radialGradient864);fill-opacity:1;stroke:none;stroke-width:0.0551915;stroke-linecap:round;paint-order:markers stroke fill;filter:url(#filter987);opacity:0.22423184"
transform="matrix(0.4712631,0,0,0.4712631,2.2383194,2.2383194)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -12,16 +12,16 @@ var collisions = 0
func _ready():
$CollisionCoarse.disabled = false
$CollisionFine.disabled = true
$Smoke.emitting = true
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _process(delta):
$Smoke.global_transform.basis = Transform.IDENTITY.basis # reset particle emmiter rotation
func _on_FreeTimer_timeout():
queue_free()
func _on_Casing_body_entered(body):
$AudioStreamPlayer3D.max_db = max(20 - (linear_velocity.length() * 10), 0)
@ -36,5 +36,5 @@ func _on_Casing_body_entered(body):
$CollisionCoarse.disabled = true
$CollisionFine.disabled = false
if collisions == 10:
queue_free()
#if collisions == 10:
# queue_free()

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=15 format=2]
[ext_resource path="res://Assets/Weapons/Handgun/Casing.material" type="Material" id=1]
[ext_resource path="res://Assets/Weapons/Handgun/Casing.gd" type="Script" id=2]
[ext_resource path="res://Assets/SFX/Collision-ShellCasing.wav" type="AudioStream" id=3]
[ext_resource path="res://Assets/Effects/SubtleSmoke.png" type="Texture" id=4]
[sub_resource type="CylinderShape" id=1]
radius = 0.024889
@ -26,6 +27,45 @@ surfaces/0 = {
"vertex_count": 2292
}
[sub_resource type="Gradient" id=4]
offsets = PoolRealArray( 0, 0.0311111, 0.528889, 1 )
colors = PoolColorArray( 0.623529, 0.623529, 0.623529, 0, 0.866667, 0.866667, 0.866667, 1, 0.729412, 0.729412, 0.729412, 0.356863, 0.597656, 0.597656, 0.597656, 0 )
[sub_resource type="GradientTexture" id=5]
gradient = SubResource( 4 )
[sub_resource type="Curve" id=6]
_data = [ Vector2( 0, 0.0818182 ), 0.0, 0.717355, 0, 0, Vector2( 1, 1 ), 1.47236, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=7]
curve = SubResource( 6 )
[sub_resource type="ParticlesMaterial" id=8]
direction = Vector3( 0, 0, 1 )
spread = 1.36
gravity = Vector3( 0, 0.5, 0 )
initial_velocity = 0.1
initial_velocity_random = 0.3
damping = 0.5
scale = 5.0
scale_curve = SubResource( 7 )
color_ramp = SubResource( 5 )
[sub_resource type="SpatialMaterial" id=9]
flags_transparent = true
vertex_color_use_as_albedo = true
params_specular_mode = 4
params_billboard_mode = 3
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
albedo_color = Color( 1, 1, 1, 0.0784314 )
albedo_texture = ExtResource( 4 )
[sub_resource type="QuadMesh" id=10]
material = SubResource( 9 )
size = Vector2( 0.15, 0.15 )
[node name="Casing" type="RigidBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 8.58307e-05, 0, 0.000259399 )
mass = 0.27
@ -55,5 +95,16 @@ autostart = true
stream = ExtResource( 3 )
max_db = -10.0
attenuation_filter_cutoff_hz = 20000.0
[node name="Smoke" type="Particles" parent="."]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.0305352, 0, 4.07454e-10 )
emitting = false
amount = 64
lifetime = 4.0
one_shot = true
explosiveness = 0.85
local_coords = false
process_material = SubResource( 8 )
draw_pass_1 = SubResource( 10 )
[connection signal="body_entered" from="." to="." method="_on_Casing_body_entered"]
[connection signal="timeout" from="FreeTimer" to="." method="_on_FreeTimer_timeout"]

View File

@ -68,9 +68,6 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.331868, 0.125291, 0 )
[node name="Ejector" parent="Handgun" index="1"]
transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, -0.0373496, 0.126382, -0.00737098 )
[node name="Shell" parent="Handgun" index="3"]
visible = false
[node name="SoundShoot" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource( 3 )

View File

@ -34,9 +34,7 @@ sync func show_muzzle_flash():
$SoundShoot.play()
$MuzzleFlash.emitting = true
yield(get_tree().create_timer(0.07),"timeout")
$MuzzleFlash.emitting = false
sync func show_tracer():