Files
net-gunner/templates/pawn_pick_portrait.tscn

120 lines
3.1 KiB
Plaintext

[gd_scene load_steps=9 format=3 uid="uid://vteg7bvq0i0v"]
[ext_resource type="Script" uid="uid://dqpoa5x8u3r3h" path="res://scripts/pawn_pick_portrait.gd" id="1_xribi"]
[ext_resource type="Texture2D" uid="uid://dri0a20l6kpbj" path="res://visuals/images/icon.svg" id="2_gb3se"]
[sub_resource type="Shader" id="Shader_fa52j"]
code = "shader_type canvas_item;
uniform sampler2D main_texture;
uniform float granularity : hint_range(5, 30) = 15.0;
uniform float opacity_limit;
float random (vec2 uv) {
return fract(sin(dot(uv.xy,
vec2(12.9898,78.233))) * 43758.5453123);
}
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
// Called for every pixel the material is visible on.
vec2 uv = UV;
float g = ( pow(granularity, 2));
uv = round((uv * g)) / g;
uv.y = TIME * uv.y + TIME * .05;
uv.x = 10.0 * TIME * uv.x + TIME * 1.0;
float val = random(uv);
float op = random(-uv) / val;
float alpha = 1.0;
if(op < opacity_limit){
alpha = 0.0;
}
vec4 color = vec4(val, val, val, alpha * COLOR.a);
COLOR = color;
}
//void light() {
// // Called for every pixel for every light affecting the CanvasItem.
// // Uncomment to replace the default light processing function with this one.
//}
"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_5wdeo"]
shader = SubResource("Shader_fa52j")
shader_parameter/granularity = 10.0000002375
shader_parameter/opacity_limit = 0.86
[sub_resource type="Gradient" id="Gradient_ak2if"]
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_fa52j"]
gradient = SubResource("Gradient_ak2if")
width = 1
[sub_resource type="Gradient" id="Gradient_w1hxv"]
offsets = PackedFloat32Array(1)
colors = PackedColorArray(1, 1, 1, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_bqp8h"]
gradient = SubResource("Gradient_w1hxv")
width = 1
[node name="PawnPickPortrait" type="Panel"]
custom_minimum_size = Vector2(150, 150)
script = ExtResource("1_xribi")
[node name="Portrait" type="TextureRect" parent="."]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_gb3se")
expand_mode = 1
[node name="Cover" type="Control" parent="."]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Static" type="TextureRect" parent="Cover"]
material = SubResource("ShaderMaterial_5wdeo")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_fa52j")
expand_mode = 1
[node name="Green Tint" type="TextureRect" parent="Cover"]
modulate = Color(0, 0.6039216, 0, 0.42745098)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_bqp8h")
expand_mode = 1
[node name="NinePatchRect" type="NinePatchRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2