Remove possibly AI background, use shader for BG instead. Remove placeholder Rare Sword, fix missing Avarice name

This commit is contained in:
2024-09-09 10:43:50 -07:00
parent 2ac4660d1b
commit ca9ba8c81f
8 changed files with 195 additions and 115 deletions

View File

@@ -0,0 +1,99 @@
shader_type canvas_item;
#define iTime TIME
#define iResolution 1.0/SCREEN_PIXEL_SIZE
uniform vec3 color1 = vec3(0.5, 0.5, 0.5);
uniform vec3 color2 = vec3(0.5, 0.5, 0.5);
uniform vec3 color3 = vec3(1., 1., 1.);
uniform vec3 color4 = vec3(0., 0.1, 0.2);
uniform float grandient : hint_range(0.01, 2.0, 0.01) = 0.04;
uniform float zoom : hint_range(0, 2., 0.1) = 1.0;
uniform vec2 disp = vec2(0.0);
uniform vec2 rot_angle = vec2(1.0);
uniform float wiggle : hint_range(0.0, 5.0, 0.1) = 0.35;
uniform float speed1 : hint_range(0.0, 10.0, 0.1) = 0.2;
uniform float speed2 : hint_range(0.0, 10.0, 0.1) = 0.2;
uniform float speed3 : hint_range(0.0, 5.0, 0.1) = 0.4;
// Box sdf function
float sdBox ( vec3 p, vec3 b ) {
vec3 q = abs(p) - b;
return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);
}
//Octahedron
float sdOctahedron( vec3 p, float s) {
p = abs(p);
return (p.x+p.y+p.z-s)*0.57735027;
}
float map(vec3 p) {
p.z += iTime * speed3; // Move effect
// Space Repetition
p.xy = (fract(p.xy) - .5); // Spacing by 1
p.z = mod(p.z, .25) - 0.125; // Spacing by .25
float box = sdOctahedron(p, .15); // SDF
return box;
}
// Coloring
vec3 palette(float t) {
vec3 a = color1;
vec3 b = color2;
vec3 c = color3;
vec3 d = color4;
return a + b * cos(6.28318 * (c * t + d));
}
// 2D Rotation
mat2 rot2D(float angle) {
float s = sin(angle * rot_angle.x);
float c = cos(angle * rot_angle.y);
return mat2(vec2(c, -s), vec2(s, c));
}
void fragment() {
vec2 uv = UV * 2.0 - 1.0;
//vec2 m = (iMouse.xy * 2. - iResolution.xy) / iResolution.y;
vec2 m = uv;
// Initialization
vec3 ro = vec3(disp.x, disp.y, -0); // Ray origin
vec3 rd = normalize(vec3(uv, 1)) * zoom; // Ray zoom
vec3 col = vec3(0);
float t = 0.0; // Total distance travelled
// Default circular motion if mouse is not clicked
m = vec2(cos(iTime * speed1), sin(iTime * speed2));
// Raymarching
int i;
for (int i = 0; i < 80; i++) {
vec3 p = ro + rd * t; // Posiiton along the ray
p.xy *= rot2D(t * 0.2 * m.x); // Rotate ray around z-axis
p.y += sin(t * (m.y + 1.) * 0.5) * wiggle; // Wiggle
float d = map(p); // Current distance to the scene
t += d; // March the rays
col = vec3(float(i)) / 80.;
if (d < .001 || t > 100.) break; // Early Stop
}
// Coloring
col = palette(t * grandient + float(i) * 0.005); // Lower the float value to see further away
COLOR = vec4(col, 1);
}

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=19 format=3 uid="uid://dlj8qdg1c5048"]
[gd_scene load_steps=21 format=3 uid="uid://dlj8qdg1c5048"]
[ext_resource type="Script" path="res://src/inventory_menu/InventoryMenu.cs" id="1_l64wl"]
[ext_resource type="Texture2D" uid="uid://c8tnq16qgjurc" path="res://src/ui/textures/INVENTORY-BACKGROUND.png" id="2_plijd"]
[ext_resource type="Shader" path="res://src/inventory_menu/InventoryMenu.gdshader" id="2_0fvsh"]
[ext_resource type="FontFile" uid="uid://cm8j5vcdop5x0" path="res://src/ui/fonts/Mrs-Eaves-OT-Roman_31443.ttf" id="3_lm4o1"]
[ext_resource type="FontFile" uid="uid://cb41qqmxqurj8" path="res://src/ui/fonts/FT88-Bold.ttf" id="4_rg5yb"]
[ext_resource type="FontFile" uid="uid://dit3vylt7hmmx" path="res://src/ui/fonts/FT88-Regular.ttf" id="5_2qnnx"]
@@ -9,6 +9,23 @@
[ext_resource type="LabelSettings" uid="uid://c4wbba5mo7qcp" path="res://src/ui/label_settings/MainTextFontItalicized.tres" id="6_q3oua"]
[ext_resource type="LabelSettings" uid="uid://ca1q6yu8blwxf" path="res://src/ui/label_settings/InventoryMainTextBold.tres" id="6_tmdno"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_i55tv"]
shader = ExtResource("2_0fvsh")
shader_parameter/color1 = Vector3(-1.635, -0.665, 0.005)
shader_parameter/color2 = Vector3(-0.275, 0.91, 1.005)
shader_parameter/color3 = Vector3(1, 1, 1)
shader_parameter/color4 = Vector3(0, 0.1, 0.2)
shader_parameter/grandient = 0.01
shader_parameter/zoom = 2.0
shader_parameter/disp = Vector2(0, 0)
shader_parameter/rot_angle = Vector2(1, 1)
shader_parameter/wiggle = 0.35
shader_parameter/speed1 = 0.1
shader_parameter/speed2 = 0.1
shader_parameter/speed3 = 0.1
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_3ynpe"]
[sub_resource type="LabelSettings" id="LabelSettings_q0afw"]
font = ExtResource("3_lm4o1")
font_size = 48
@@ -71,13 +88,16 @@ size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_l64wl")
[node name="TextureRect" type="TextureRect" parent="."]
[node name="BG" type="TextureRect" parent="."]
material = SubResource("ShaderMaterial_i55tv")
layout_mode = 1
anchors_preset = 10
anchors_preset = 15
anchor_right = 1.0
offset_bottom = 1536.0
anchor_bottom = 1.0
grow_horizontal = 2
texture = ExtResource("2_plijd")
grow_vertical = 2
texture = SubResource("PlaceholderTexture2D_3ynpe")
expand_mode = 2
[node name="InventoryInfo" type="MarginContainer" parent="."]
layout_mode = 1