aaaaaaaaaa

This commit is contained in:
Spencer Killen 2023-11-11 18:48:23 -07:00
parent 7417ff9a11
commit 0bac49d257
Signed by: sjkillen
GPG Key ID: 3AF3117BA6FBB75B
7 changed files with 24 additions and 15 deletions

View File

@ -45,7 +45,7 @@ func release():
%ChargeReleaseSound.volume_db = get_charge() * 12 %ChargeReleaseSound.volume_db = get_charge() * 12
%ChargeReleaseSound.play() %ChargeReleaseSound.play()
var billiard := target.get_billiard() var billiard := target.get_billiard()
billiard.hit((target.global_position - %camera_spot.global_position).normalized()) billiard.hit((target.global_position - %camera_spot.global_position).normalized(), get_charge())
%radial_ui.set_charge(0.0) %radial_ui.set_charge(0.0)
%ChargeSound.stop() %ChargeSound.stop()
if charge_tween != null: if charge_tween != null:

View File

@ -6,8 +6,6 @@ uniform float grow;
uniform sampler2D colors : source_color, repeat_disable; uniform sampler2D colors : source_color, repeat_disable;
uniform float charge = 1.0; uniform float charge = 1.0;
#include "res://shaders/noise.gdshaderinc"
void vertex() { void vertex() {
// Billboarding // Billboarding
MODELVIEW_MATRIX = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0], INV_VIEW_MATRIX[1], INV_VIEW_MATRIX[2], MODEL_MATRIX[3]); MODELVIEW_MATRIX = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0], INV_VIEW_MATRIX[1], INV_VIEW_MATRIX[2], MODEL_MATRIX[3]);
@ -21,6 +19,7 @@ void vertex() {
VERTEX.y += dy; VERTEX.y += dy;
VERTEX.x += dx; VERTEX.x += dx;
} }
uniform sampler2D alpha_falloff : repeat_disable;
void fragment() { void fragment() {
float where = distance(UV, vec2(0.5))*2.0; float where = distance(UV, vec2(0.5))*2.0;
@ -31,9 +30,8 @@ void fragment() {
int bx = int(buv.x); int bx = int(buv.x);
int by = int(buv.y); int by = int(buv.y);
int amount = 2; int amount = 2;
if ((bx % amount == 0) || (by % amount == 0)) {
discard; ALPHA = texture(alpha_falloff, vec2(where/charge)).r;
}
ALBEDO = texture(colors, vec2(where)).rgb; ALBEDO = texture(colors, vec2(where)).rgb;
} }

View File

@ -1,7 +1,15 @@
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://cybyibjbyyok1"] [gd_resource type="ShaderMaterial" load_steps=6 format=3 uid="uid://cybyibjbyyok1"]
[ext_resource type="Shader" path="res://control_scheme/radial_ui.gdshader" id="1_hmfvm"] [ext_resource type="Shader" path="res://control_scheme/radial_ui.gdshader" id="1_hmfvm"]
[sub_resource type="Curve" id="Curve_p1ydf"]
_data = [Vector2(0, 0.831579), 0.0, 0.0, 0, 0, Vector2(0.830986, 0.757895), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_6n3v0"]
texture_mode = 1
curve = SubResource("Curve_p1ydf")
[sub_resource type="Gradient" id="Gradient_l7u12"] [sub_resource type="Gradient" id="Gradient_l7u12"]
interpolation_mode = 1 interpolation_mode = 1
offsets = PackedFloat32Array(0.00328947, 0.347039, 0.506579, 0.694079, 0.848684) offsets = PackedFloat32Array(0.00328947, 0.347039, 0.506579, 0.694079, 0.848684)
@ -16,3 +24,4 @@ shader = ExtResource("1_hmfvm")
shader_parameter/grow = 0.01 shader_parameter/grow = 0.01
shader_parameter/charge = 0.0 shader_parameter/charge = 0.0
shader_parameter/colors = SubResource("GradientTexture1D_8vk7x") shader_parameter/colors = SubResource("GradientTexture1D_8vk7x")
shader_parameter/alpha_falloff = SubResource("CurveTexture_6n3v0")

View File

@ -1,7 +1,10 @@
extends RigidBody3D extends RigidBody3D
class_name Billiard class_name Billiard
@export var power_min := 0.01
@export var power_max := 5.0
var can_hit = true var can_hit = true
func hit(impulse: Vector3): func hit(impulse: Vector3, power: float):
apply_central_impulse(impulse) apply_central_impulse(impulse * lerp(power_min, power_max, power))

View File

@ -5,6 +5,7 @@
[ext_resource type="PackedScene" uid="uid://bjhii55pagkb5" path="res://TAS_system/is_TASable.tscn" id="3_oj26f"] [ext_resource type="PackedScene" uid="uid://bjhii55pagkb5" path="res://TAS_system/is_TASable.tscn" id="3_oj26f"]
[node name="billiard" type="RigidBody3D"] [node name="billiard" type="RigidBody3D"]
continuous_cd = true
script = ExtResource("1_a0fke") script = ExtResource("1_a0fke")
[node name="is_targetable" parent="." instance=ExtResource("2_yrk4o")] [node name="is_targetable" parent="." instance=ExtResource("2_yrk4o")]

View File

@ -1,9 +1,5 @@
[gd_scene load_steps=3 format=3 uid="uid://c43pr474qofhl"] [gd_scene load_steps=2 format=3 uid="uid://c43pr474qofhl"]
[ext_resource type="PackedScene" uid="uid://bsge8trc5uwb0" path="res://grape.glb" id="1_jlfas"] [ext_resource type="PackedScene" uid="uid://bsge8trc5uwb0" path="res://grape.glb" id="1_jlfas"]
[ext_resource type="PackedScene" uid="uid://bjhii55pagkb5" path="res://TAS_system/is_TASable.tscn" id="2_qxcjc"]
[node name="grape" instance=ExtResource("1_jlfas")] [node name="grape" instance=ExtResource("1_jlfas")]
[node name="is_TASable" parent="." index="3" node_paths=PackedStringArray("_assignedRigidBody3D") instance=ExtResource("2_qxcjc")]
_assignedRigidBody3D = NodePath("..")

View File

@ -32,7 +32,9 @@ _subresources={
"nodes": { "nodes": {
"PATH:room": { "PATH:room": {
"generate/physics": true, "generate/physics": true,
"physics/shape_type": 2 "physics/shape_type": 2,
"primitive/position": Vector3(0, 0.5, 0),
"primitive/size": Vector3(2, 1, 2)
}, },
"PATH:table": { "PATH:table": {
"generate/physics": true, "generate/physics": true,