diff --git a/scenes/Entities/Rosa.tscn b/scenes/Entities/Rosa.tscn index e625d0c..8dd2daa 100644 --- a/scenes/Entities/Rosa.tscn +++ b/scenes/Entities/Rosa.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://yhtpoum3eek7"] +[gd_scene load_steps=8 format=3 uid="uid://yhtpoum3eek7"] [ext_resource type="Script" uid="uid://ixwikdguyhf0" path="res://scripts/Entities/RosaController.gd" id="1_3g383"] [ext_resource type="Script" uid="uid://jd50n00bo05y" path="res://scripts/Entities/RosaCamera.gd" id="2_tr66j"] [ext_resource type="Shader" uid="uid://7h2axb2tsh17" path="res://shaders/NPC Shader.gdshader" id="3_j5vis"] +[ext_resource type="Texture2D" uid="uid://cofrgefp8e617" path="res://textures/human.png" id="4_rvn3n"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ls7r8"] radius = 0.331611 @@ -13,7 +14,8 @@ height = 0.804274 [sub_resource type="ShaderMaterial" id="ShaderMaterial_fegux"] render_priority = 0 shader = ExtResource("3_j5vis") -shader_parameter/color = Color(0.931725, 0.000206962, 0.803019, 1) +shader_parameter/npcTexture = ExtResource("4_rvn3n") +shader_parameter/color = Color(1, 1, 1, 1) shader_parameter/frame = 0 shader_parameter/direction = 1 diff --git a/scenes/Entities/TestNPC.tscn b/scenes/Entities/TestNPC.tscn index 8904785..be3adb8 100644 --- a/scenes/Entities/TestNPC.tscn +++ b/scenes/Entities/TestNPC.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://dr4b2pmsknuhc"] +[gd_scene load_steps=8 format=3 uid="uid://dr4b2pmsknuhc"] [ext_resource type="Script" uid="uid://d23qg1ovkbxst" path="res://scripts/Entities/BasicNPCEntity.gd" id="1_1muh7"] [ext_resource type="Shader" uid="uid://7h2axb2tsh17" path="res://shaders/NPC Shader.gdshader" id="1_xgcv1"] [ext_resource type="Script" uid="uid://btxgv85qst1jy" path="res://scripts/Cutscene/TestCutscene.gd" id="2_jwvuu"] +[ext_resource type="Texture2D" uid="uid://cofrgefp8e617" path="res://textures/human.png" id="4_vo0ku"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dw1sy"] radius = 0.331611 @@ -13,6 +14,7 @@ height = 0.804274 [sub_resource type="ShaderMaterial" id="ShaderMaterial_l4utx"] render_priority = 0 shader = ExtResource("1_xgcv1") +shader_parameter/npcTexture = ExtResource("4_vo0ku") shader_parameter/color = Color(0, 0.563816, 0, 1) shader_parameter/frame = 0 shader_parameter/direction = 1 diff --git a/scripts/Entities/OverworldEntity.gd b/scripts/Entities/OverworldEntity.gd index b2a30cc..ba8463b 100644 --- a/scripts/Entities/OverworldEntity.gd +++ b/scripts/Entities/OverworldEntity.gd @@ -1,10 +1,10 @@ class_name OverworldEntity extends CharacterBody3D enum Direction { - NORTH, - EAST, SOUTH, WEST, + NORTH, + EAST, } var speed:float = 150; diff --git a/shaders/NPC Shader.gdshader b/shaders/NPC Shader.gdshader index 1998bb3..208cbff 100644 --- a/shaders/NPC Shader.gdshader +++ b/shaders/NPC Shader.gdshader @@ -6,12 +6,15 @@ uniform vec4 color : source_color; uniform int frame; uniform int direction; -const int FRAMES = 3; +const int FRAMES = 1; const int DIRECTIONS = 4; void vertex() { - vec2 tileSize = vec2(1.0 / float(FRAMES), 1.0 / float(DIRECTIONS)); - vec2 topLeft = tileSize * vec2(float(frame % FRAMES), float(direction % DIRECTIONS)); + vec2 tileSize = vec2(1.0 / float(DIRECTIONS), 1.0 / float(FRAMES)); + vec2 topLeft = tileSize * vec2( + float(direction % DIRECTIONS), + float(frame % FRAMES) + ); vec2 bottomRight = topLeft + tileSize; if(VERTEX_ID == 3) { @@ -27,6 +30,9 @@ void vertex() { void fragment() { vec4 npcColor = texture(npcTexture, UV); + + if(npcColor.a == 0.0) + discard; // Remove PINK background if(npcColor.r == 1.0 && npcColor.g == 0.0 && npcColor.b == 1.0) diff --git a/textures/human.png b/textures/human.png new file mode 100644 index 0000000..fd25354 Binary files /dev/null and b/textures/human.png differ diff --git a/textures/human.png.import b/textures/human.png.import new file mode 100644 index 0000000..27ffefd --- /dev/null +++ b/textures/human.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cofrgefp8e617" +path.s3tc="res://.godot/imported/human.png-1880dba459540c27ee8035fcec96bd0b.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://textures/human.png" +dest_files=["res://.godot/imported/human.png-1880dba459540c27ee8035fcec96bd0b.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0