diff --git a/Assets/Materials/UIMat.shmat b/Assets/Materials/UIMat.shmat index 36c2f66c..b56d1bcb 100644 --- a/Assets/Materials/UIMat.shmat +++ b/Assets/Materials/UIMat.shmat @@ -4,5 +4,5 @@ Properties: data.color: {x: 1, y: 1, z: 1, w: 1} data.textureIndex: 51995224 - data.alpha: 0 + data.alpha: 1 data.beta: {x: 1, y: 1, z: 1} \ No newline at end of file diff --git a/Assets/Materials/UIMat_MainMenu.shmat b/Assets/Materials/UIMat_MainMenu.shmat index 0ca4c7a1..ba2069e9 100644 --- a/Assets/Materials/UIMat_MainMenu.shmat +++ b/Assets/Materials/UIMat_MainMenu.shmat @@ -4,5 +4,5 @@ Properties: data.color: {x: 1, y: 1, z: 1, w: 1} data.textureIndex: 54429632 - data.alpha: 0 + data.alpha: 1 data.beta: {x: 1, y: 1, z: 1} \ No newline at end of file diff --git a/Assets/Scenes/MainGame.shade b/Assets/Scenes/MainGame.shade index 837e0e78..dfe74af9 100644 --- a/Assets/Scenes/MainGame.shade +++ b/Assets/Scenes/MainGame.shade @@ -8540,6 +8540,7 @@ currCategory: 1 density: 1 dontReturn: false + soundDistance: 10 - EID: 157 Name: Mesh_Meat IsActive: true @@ -8587,6 +8588,7 @@ currCategory: 1 density: 1 dontReturn: false + soundDistance: 10 - EID: 156 Name: Mesh_Meat IsActive: true @@ -8634,6 +8636,7 @@ currCategory: 1 density: 1 dontReturn: false + soundDistance: 10 - EID: 155 Name: Mesh_Cheese IsActive: true @@ -8681,6 +8684,7 @@ currCategory: 2 density: 1 dontReturn: false + soundDistance: 10 - EID: 154 Name: Mesh_Cheese IsActive: true @@ -8728,6 +8732,7 @@ currCategory: 2 density: 1 dontReturn: false + soundDistance: 10 - EID: 153 Name: Mesh_Cheese IsActive: true @@ -8775,6 +8780,7 @@ currCategory: 2 density: 1 dontReturn: false + soundDistance: 10 - EID: 65778 Name: Mesh_Apple IsActive: true @@ -8822,6 +8828,7 @@ currCategory: 0 density: 1 dontReturn: false + soundDistance: 10 - EID: 152 Name: Mesh_Apple IsActive: true @@ -8869,6 +8876,7 @@ currCategory: 0 density: 1 dontReturn: false + soundDistance: 10 - EID: 151 Name: Mesh_Apple IsActive: true @@ -8916,6 +8924,7 @@ currCategory: 0 density: 1 dontReturn: false + soundDistance: 10 - EID: 65686 Name: Watermelon IsActive: true @@ -8967,6 +8976,7 @@ currCategory: 2 density: 1 dontReturn: false + soundDistance: 10 - EID: 131220 Name: Piece1 IsActive: true @@ -9014,6 +9024,7 @@ currCategory: 1 density: 3 dontReturn: false + soundDistance: 10 - EID: 131219 Name: Piece2 IsActive: true @@ -9061,6 +9072,7 @@ currCategory: 1 density: 3 dontReturn: false + soundDistance: 10 - EID: 131221 Name: Piece3 IsActive: true @@ -9108,6 +9120,7 @@ currCategory: 0 density: 3 dontReturn: false + soundDistance: 10 - EID: 145 Name: Piece4 IsActive: true @@ -9155,6 +9168,7 @@ currCategory: 0 density: 3 dontReturn: false + soundDistance: 10 - EID: 196754 Name: Piece5 IsActive: true @@ -9202,6 +9216,7 @@ currCategory: 0 density: 3 dontReturn: false + soundDistance: 10 - EID: 144 Name: Egg IsActive: true @@ -9253,6 +9268,7 @@ currCategory: 0 density: 2 dontReturn: false + soundDistance: 10 - EID: 143 Name: Piece1 IsActive: true @@ -9662,7 +9678,7 @@ Components: Transform Component: Translate: {x: 2.35245037, y: 0.38365531, z: 7.10571432} - Rotate: {x: -0, y: 0, z: -0} + Rotate: {x: 0, y: 0.326376587, z: 0.0698131472} Scale: {x: 0.999999881, y: 1, z: 0.999999881} IsActive: true Renderable Component: @@ -9740,7 +9756,7 @@ Components: Transform Component: Translate: {x: 0, y: -5.96046448e-08, z: 0} - Rotate: {x: 0, y: 6.28318548, z: 2.23517329e-08} + Rotate: {x: 0, y: 5.95680904, z: -0.0698131248} Scale: {x: 1, y: 1, z: 1} IsActive: true Camera Component: @@ -9748,8 +9764,8 @@ Pitch: 0 Yaw: 360 Roll: 1.28065994e-06 - Width: 2560 - Height: 1369 + Width: 1055 + Height: 604 Near: 0.00999999978 Far: 10000 Perspective: true @@ -10521,14 +10537,14 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 2.70000005, y: 0.100000001, z: -2} + Translate: {x: 0, y: 0, z: -2.64324665} Rotate: {x: -0, y: 0, z: -0} Scale: {x: 1, y: 1, z: 1} - IsActive: false + IsActive: true Renderable Component: Mesh: 140697366 Material: 129495479 - IsActive: false + IsActive: true RigidBody Component: Type: Dynamic Drag: 0.00999999978 @@ -10542,7 +10558,7 @@ Freeze Rotation X: true Freeze Rotation Y: false Freeze Rotation Z: true - IsActive: false + IsActive: true Collider Component: Colliders: - Is Trigger: false @@ -10554,7 +10570,7 @@ Density: 1 Position Offset: {x: 0, y: 0.899999976, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} - IsActive: false + IsActive: true Scripts: - Type: Homeowner1 Enabled: true @@ -10614,6 +10630,7 @@ currCategory: 1 density: 1 dontReturn: false + soundDistance: 10 - EID: 16 Name: JumpPad IsActive: false @@ -10641,13 +10658,13 @@ Enabled: true - EID: 10 Name: Canvas - IsActive: false + IsActive: true NumberOfChildren: 3 Components: Canvas Component: Canvas Width: 1920 Canvas Height: 1080 - IsActive: false + IsActive: true Scripts: ~ - EID: 8 Name: ResumeButton diff --git a/Assets/Scenes/MainMenu.shade b/Assets/Scenes/MainMenu.shade index 15df64f4..8d1bbcf3 100644 --- a/Assets/Scenes/MainMenu.shade +++ b/Assets/Scenes/MainMenu.shade @@ -15,7 +15,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: 0, z: 0} + Translate: {x: 0, y: 0, z: 0.5} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 1920, y: 1080, z: 1} IsActive: true @@ -35,7 +35,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: 75, z: 0} + Translate: {x: 0, y: 75, z: 0.400000006} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 400, y: 200, z: 1} IsActive: true @@ -63,7 +63,7 @@ NumberOfChildren: 0 Components: Transform Component: - Translate: {x: 0, y: -200, z: 0} + Translate: {x: 0, y: -200, z: 0.400000006} Rotate: {x: 0, y: 0, z: 0} Scale: {x: 400, y: 200, z: 1} IsActive: true @@ -128,4 +128,5 @@ Scripts: - Type: MainMenu Enabled: true - sceneID: 96668835 \ No newline at end of file + sceneID: 96668835 + obj: 1 \ No newline at end of file diff --git a/Assets/Scenes/WinScene.shade b/Assets/Scenes/WinScene.shade index 3edd223b..0727860e 100644 --- a/Assets/Scenes/WinScene.shade +++ b/Assets/Scenes/WinScene.shade @@ -111,6 +111,7 @@ Near: 0.00999999978 Far: 10000 Perspective: true + FOV: 90 IsActive: true Scripts: ~ - EID: 4 diff --git a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs index 84c7c485..e37aab36 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/Implemented/Homeowner1.cs @@ -74,6 +74,9 @@ public partial class Homeowner1 : BehaviourTree private float footstepSFXIntervalMultiplier; private float footstepTimeRemaining; + + //singleton for AI + public static Homeowner1 aiInstance { get; private set; } } //AI tree @@ -111,6 +114,11 @@ public partial class Homeowner1 : BehaviourTree AudioHandler.audioClipHandlers["SFXFootstep"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_footsteps"); AudioHandler.audioClipHandlers["SFXDetectAh"] = Audio.CreateAudioClip("event:/Homeowner/homeowner_detect_raccoon"); AudioHandler.audioClipHandlers["SFXDetectSting"] = Audio.CreateAudioClip("event:/Music/stingers/player_detected"); + + if (aiInstance != null && aiInstance != this) + RemoveScript(); + else + aiInstance = this; } //Called every tick @@ -182,4 +190,10 @@ public partial class Homeowner1 : BehaviourTree //Debug.Log("Tree Created"); return root; } + + protected override void onDestroy() + { + if (aiInstance == this) + aiInstance = null; + } } \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/Item/SC_Item.cs b/Assets/Scripts/Gameplay/Item/SC_Item.cs index 1109f8f3..e4c264be 100644 --- a/Assets/Scripts/Gameplay/Item/SC_Item.cs +++ b/Assets/Scripts/Gameplay/Item/SC_Item.cs @@ -22,6 +22,10 @@ public class Item : Script private Collider collider; public float density = 1.0f; public bool dontReturn = false; + + + private bool checkSound = false; + public float soundDistance = 10; protected override void awake() @@ -55,10 +59,25 @@ public class Item : Script returnBack = false; } + + + if (checkSound) + { +/* //need to wait for collisionEnter Fix + Vector3 itemPos = transform.LocalPosition; + Vector3 len = Homeowner1.aiInstance.GetComponent().LocalPosition - itemPos; + Debug.Log($"distance: {len.GetSqrMagnitude()}"); + if (len.GetSqrMagnitude() <= soundDistance) + { + //set ai to alert + } + checkSound = false;*/ + } } protected override void onCollisionEnter(CollisionInfo info) { + if (!caputurePos) { firstPostion = transform.LocalPosition; @@ -83,6 +102,7 @@ public class Item : Script protected override void onCollisionExit(CollisionInfo info) { playSound = true; + checkSound = true; } } \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs b/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs index d5046db1..4132edca 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PickAndThrow.cs @@ -26,6 +26,7 @@ public class PickAndThrow : Script private float lastZDir; private bool inRange = false; public bool throwItem = false; + private Vector3 prevTargetOffSet; [Tooltip("Lenght of ray")] public float rayDistance = 1; @@ -56,8 +57,12 @@ public class PickAndThrow : Script } protected override void update() { + if (GameManager.Instance.GamePause) + { + return; + } - if(timer <= delayTimer) + if (timer <= delayTimer) timer += Time.DeltaTimeF; CalculateDir(); @@ -76,6 +81,7 @@ public class PickAndThrow : Script { pc.isAiming = true; pc.camArm.ArmLength = aimingLength; + prevTargetOffSet = pc.camArm.TargetOffset; pc.camArm.TargetOffset = cameraArmOffSet; pc.cam.FOV = aimingFOV; } @@ -86,7 +92,7 @@ public class PickAndThrow : Script itemRidigBody.IsGravityEnabled = true; itemCollider.GetCollisionShape(0).IsTrigger = false; pc.isAiming = false; - pc.camArm.TargetOffset = Vector3.Zero; + pc.camArm.TargetOffset = prevTargetOffSet; pc.cam.FOV = defaultFOV; if (tpc) pc.camArm.ArmLength = tpc.armLength; @@ -109,7 +115,7 @@ public class PickAndThrow : Script { pc.isAiming = false; pc.cam.FOV = defaultFOV; - pc.camArm.TargetOffset = Vector3.Zero; + pc.camArm.TargetOffset = prevTargetOffSet; if (tpc) pc.camArm.ArmLength = tpc.armLength; } @@ -134,6 +140,11 @@ public class PickAndThrow : Script protected override void fixedUpdate() { + if (GameManager.Instance.GamePause) + { + return; + } + if (throwItem && itemRidigBody && pc) { if (itemScript) diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs index 202e587e..87e42032 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs @@ -124,8 +124,14 @@ public class PlayerController : Script protected override void lateUpdate() { } + protected override void update() { + if (GameManager.Instance.GamePause) + { + return; + } + if (delayTimer <= 1) delayTimer += Time.DeltaTimeF; @@ -158,22 +164,27 @@ public class PlayerController : Script if (tranform) tranform.LocalEulerAngles = new Vector3(0.0f, tranform.LocalEulerAngles.y, 0.0f); + GotCaught(); Rotation(); MoveKey(); Sprint(); Jump(); - GotCaught(); //Debug.Log($"{currentState}"); //Debug.Log($" axisX: {axisMove.x} axisY:{axisMove.y}"); //Debug.Log($"X: {rb.LinearVelocity.x}" + $" Z: {rb.LinearVelocity.z}"); //Debug.Log(currentState.ToString() + " x:" + rb.LinearVelocity.x.ToString() + " y:" + rb.LinearVelocity.y.ToString() + " z:" + rb.LinearVelocity.z.ToString()); + } protected override void fixedUpdate() { + if (GameManager.Instance.GamePause) + { + return; + } + Move(); Gravity(); - //Debug.Log($"X: {rb.LinearVelocity.x}" + $" Z: {rb.LinearVelocity.z}"); } @@ -234,7 +245,7 @@ public class PlayerController : Script private void Move() { - if (rb != null) + if (rb != null && currentState != RaccoonStates.CAUGHT) { rb.LinearVelocity += new Vector3(axisMove.x * moveForce, 0.0f, axisMove.y * moveForce) * Time.DeltaTimeF; @@ -286,7 +297,6 @@ public class PlayerController : Script } } - //press and hold jump private void Jump() { if (currentState == RaccoonStates.WALKING || currentState == RaccoonStates.RUNNING || currentState == RaccoonStates.IDLE) diff --git a/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs b/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs index c3026ce6..f339122e 100644 --- a/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs +++ b/Assets/Scripts/Gameplay/Player/SC_ThirdPersonCamera.cs @@ -41,6 +41,11 @@ namespace SHADE_Scripting protected override void update() { + if (GameManager.Instance.GamePause) + { + return; + } + CameraArm arm = GetComponent(); if (arm) { diff --git a/Assets/Scripts/Gameplay/SC_GameManager.cs b/Assets/Scripts/Gameplay/SC_GameManager.cs index 6478b5ea..3657904b 100644 --- a/Assets/Scripts/Gameplay/SC_GameManager.cs +++ b/Assets/Scripts/Gameplay/SC_GameManager.cs @@ -38,13 +38,11 @@ public class GameManager : Script private Vector3 fontScalar; public static GameManager Instance { get; private set; } - //public static int highScore { get; private set; } maybe need public bool GamePause { get; set; } protected override void start() { - base.start(); AudioHandler.audioClipHandlers["BGMAdaptive"] = Audio.CreateAudioClip("event:/Music/bgm_adaptive"); AudioHandler.audioClipHandlers["BGMAdaptive"].Play(); diff --git a/Assets/Scripts/SC_JumpPad.cs b/Assets/Scripts/Gameplay/SC_JumpPad.cs similarity index 100% rename from Assets/Scripts/SC_JumpPad.cs rename to Assets/Scripts/Gameplay/SC_JumpPad.cs diff --git a/Assets/Scripts/Gameplay/SC_JumpPad.cs.shmeta b/Assets/Scripts/Gameplay/SC_JumpPad.cs.shmeta new file mode 100644 index 00000000..c84294b0 --- /dev/null +++ b/Assets/Scripts/Gameplay/SC_JumpPad.cs.shmeta @@ -0,0 +1,3 @@ +Name: SC_JumpPad +ID: 163951275 +Type: 9 diff --git a/Assets/Scripts/UI/SC_MainMenu.cs b/Assets/Scripts/UI/SC_MainMenu.cs index 8af27d64..8c887d3c 100644 --- a/Assets/Scripts/UI/SC_MainMenu.cs +++ b/Assets/Scripts/UI/SC_MainMenu.cs @@ -5,6 +5,10 @@ using SHADE_Scripting.Audio; public class MainMenu : Script { public uint sceneID; + + public GameObject obj; + private Renderable renderable; + protected override void awake() { AudioHandler.audioClipHandlers["BGMMainMenu"] = Audio.CreateAudioClip("event:/Music/main_menu"); @@ -12,9 +16,31 @@ public class MainMenu : Script AudioHandler.audioClipHandlers["SFXUISuccess"] = Audio.CreateAudioClip("event:/UI/success"); //Audio.PlayBGMOnce2D("event:/Music/main_menu"); AudioHandler.audioClipHandlers["BGMMainMenu"].Play(); + + renderable = obj.GetComponent(); + } + + protected override void start() + { } protected override void update() { + if (Input.GetKeyDown(Input.KeyCode.K) && obj) + { + if (renderable.Material.GetProperty("data.alpha") == 1) + { + Debug.Log("ALPHA ZERO"); + Debug.Log($"{obj.EntityId}"); + obj.GetComponent().Material.SetProperty("data.alpha", 0); + } + else if (renderable.Material.GetProperty("data.alpha") == 0) + { + Debug.Log("ALPHA ONE"); + Debug.Log($"{obj.EntityId}"); + obj.GetComponent().Material.SetProperty("data.alpha", 1); + } + } + if (Input.GetKeyDown(Input.KeyCode.Space)) { //Audio.PlaySFXOnce2D("event:/UI/mouse_down_element"); diff --git a/Assets/Scripts/UI/SC_PauseMenu.cs b/Assets/Scripts/UI/SC_PauseMenu.cs index eae7aa91..521b48ea 100644 --- a/Assets/Scripts/UI/SC_PauseMenu.cs +++ b/Assets/Scripts/UI/SC_PauseMenu.cs @@ -59,8 +59,7 @@ public class PauseMenu : Script retry.OnClick.RegisterAction(() => { Audio.StopAllSounds(); - //get curr scene - //SceneManager.ChangeScene(); + SceneManager.RestartScene(); }); } else @@ -86,10 +85,6 @@ public class PauseMenu : Script protected override void update() { - if (GameManager.Instance.GamePause) - { - return; - } if (Input.GetKeyDown(Input.KeyCode.Escape) && !GameManager.Instance.GamePause) { diff --git a/Assets/Shaders/UI_FS.glsl b/Assets/Shaders/UI_FS.glsl index 3d40bc14..30b59e48 100644 --- a/Assets/Shaders/UI_FS.glsl +++ b/Assets/Shaders/UI_FS.glsl @@ -5,10 +5,8 @@ struct MatPropData { - vec4 color; int textureIndex; float alpha; - vec3 beta; }; layout(location = 0) in struct @@ -43,6 +41,8 @@ void main() { discard; } + fragColor.a = MatProp.data[In2.materialIndex].alpha; + // fragColor.a = 1.0f; outEntityID = In2.eid; } \ No newline at end of file diff --git a/Assets/Shaders/UI_FS.shshaderb b/Assets/Shaders/UI_FS.shshaderb index 024d0a3d..92f4ed4e 100644 Binary files a/Assets/Shaders/UI_FS.shshaderb and b/Assets/Shaders/UI_FS.shshaderb differ diff --git a/Assets/Shaders/UI_VS.glsl b/Assets/Shaders/UI_VS.glsl index 8856ca77..bb1ff318 100644 --- a/Assets/Shaders/UI_VS.glsl +++ b/Assets/Shaders/UI_VS.glsl @@ -58,8 +58,11 @@ void main() Out.normal.rgb = transposeInv * aNormal.rgb; Out.normal.rgb = normalize (Out.normal.rgb); + vec3 vert = aVertexPos; + vert.z += 0.1f; + // clip space for rendering - gl_Position = cameraData.projMat * worldTransform * vec4 (aVertexPos, 1.0f); - gl_Position.z += 0.1f; // HAX + gl_Position = cameraData.projMat * worldTransform * vec4 (vert, 1.0f); + // gl_Position.z += 0.1f; // HAX // gl_Position = vec4 (aVertexPos, 1.0f); } \ No newline at end of file diff --git a/Assets/Shaders/UI_VS.shshaderb b/Assets/Shaders/UI_VS.shshaderb index 79d39a82..977252c2 100644 Binary files a/Assets/Shaders/UI_VS.shshaderb and b/Assets/Shaders/UI_VS.shshaderb differ diff --git a/SHADE_Engine/src/Editor/EditorWindow/ViewportWindow/SHEditorViewport.cpp b/SHADE_Engine/src/Editor/EditorWindow/ViewportWindow/SHEditorViewport.cpp index 8c32b1c5..e571adb4 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/ViewportWindow/SHEditorViewport.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/ViewportWindow/SHEditorViewport.cpp @@ -59,7 +59,7 @@ namespace SHADE camSystem->UpdateEditorArm(SHFrameRateController::GetRawDeltaTime(), shouldUpdateCamArm, targetPos); ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f)); - + ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 1.0f)); if (Begin()) { ImGuizmo::SetDrawlist(); @@ -101,6 +101,7 @@ namespace SHADE } } } + ImGui::PopStyleColor(); ImGuizmo::SetRect(beginCursorPos.x, beginCursorPos.y, beginContentRegionAvailable.x, beginContentRegionAvailable.y); if(editor->editorState != SHEditor::State::PLAY) transformGizmo.Draw(); diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Batching/SHBatch.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Batching/SHBatch.cpp index 31cd0dfc..32a4fa76 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Batching/SHBatch.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Batching/SHBatch.cpp @@ -345,7 +345,7 @@ namespace SHADE else { // Should be deactivated - static const SHMatrix ZERO_MTX = + static const SHMatrix ZERO_MTX { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index 7f40e558..f0503741 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -350,10 +350,17 @@ namespace SHADE /*-----------------------------------------------------------------------*/ /* SCREEN SPACE PASS */ /*-----------------------------------------------------------------------*/ - auto screenSpaceNode = renderGraph->AddNode(SHGraphicsConstants::RenderGraphEntityNames::SCREEN_SPACE_PASS.data(), {"Scene", "Entity ID"}, {SHGraphicsConstants::RenderGraphEntityNames::DEFERRED_COMPOSITE_PASS.data(), SHGraphicsConstants::RenderGraphEntityNames::GBUFFER_PASS.data(), SHGraphicsConstants::RenderGraphEntityNames::DEBUG_DRAW.data()}); + auto screenSpaceNode = renderGraph->AddNode(SHGraphicsConstants::RenderGraphEntityNames::SCREEN_SPACE_PASS.data(), { "Scene", "Entity ID", "Depth Buffer" }, + { + SHGraphicsConstants::RenderGraphEntityNames::DEFERRED_COMPOSITE_PASS.data(), + SHGraphicsConstants::RenderGraphEntityNames::GBUFFER_PASS.data(), + SHGraphicsConstants::RenderGraphEntityNames::DEBUG_DRAW.data(), + SHGraphicsConstants::RenderGraphEntityNames::DEBUG_DRAW_DEPTH_PASS.data() + }); auto uiSubpass = screenSpaceNode->AddSubpass(SHGraphicsConstants::RenderGraphEntityNames::UI_SUBPASS.data(), worldViewport, screenRenderer); uiSubpass->AddColorOutput("Scene"); uiSubpass->AddColorOutput("Entity ID"); + uiSubpass->AddDepthOutput("Depth Buffer"); uiSubpass->AddExteriorDrawCalls([=](Handle cmdBuffer, Handle renderer, uint32_t frameIndex) { textRenderingSubSystem->Render(cmdBuffer, renderer, frameIndex); diff --git a/SHADE_Engine/src/Graphics/Renderpass/SHVkRenderpass.cpp b/SHADE_Engine/src/Graphics/Renderpass/SHVkRenderpass.cpp index 74128ec8..89cd2927 100644 --- a/SHADE_Engine/src/Graphics/Renderpass/SHVkRenderpass.cpp +++ b/SHADE_Engine/src/Graphics/Renderpass/SHVkRenderpass.cpp @@ -40,7 +40,7 @@ namespace SHADE if (SHVkUtil::IsDepthStencilAttachment(vkDescriptions[i].format)) clearColors[i].depthStencil = vk::ClearDepthStencilValue(1.0f, 0); else - clearColors[i].color = { {{0.0f, 0.0f, 0.0f, 1.0f}} }; + clearColors[i].color = { {{0.0f, 0.0f, 0.0f, 0.0f}} }; } diff --git a/SHADE_Managed/src/Scene/SceneManager.cxx b/SHADE_Managed/src/Scene/SceneManager.cxx index 1e139a95..a0ebc3a8 100644 --- a/SHADE_Managed/src/Scene/SceneManager.cxx +++ b/SHADE_Managed/src/Scene/SceneManager.cxx @@ -22,4 +22,12 @@ namespace SHADE { SHSceneManager::RestartScene(sceneAssetID); } + void SceneManager::RestartScene() + { + SHSceneManager::RestartScene(); + } + AssetID SceneManager::GetCurrentSceneID() + { + return SHSceneManager::GetCurrentSceneAssetID(); + } } \ No newline at end of file diff --git a/SHADE_Managed/src/Scene/SceneManager.hxx b/SHADE_Managed/src/Scene/SceneManager.hxx index e1e1ec0a..712b203c 100644 --- a/SHADE_Managed/src/Scene/SceneManager.hxx +++ b/SHADE_Managed/src/Scene/SceneManager.hxx @@ -23,5 +23,7 @@ namespace SHADE { public : static void ChangeScene(AssetID sceneAssetID); + static void RestartScene(); + static AssetID GetCurrentSceneID(); }; }