Bug fixes, Scene changes and new features #376

Merged
glencelow merged 15 commits from PlayerController into main 2023-02-28 23:10:33 +08:00
69 changed files with 300 additions and 60 deletions
Showing only changes of commit 79cb0f12ae - Show all commits

View File

@ -1,4 +0,0 @@
Start Maximized: true
Working Scene ID: 86098106
Window Size: {x: 1920, y: 1013}
Style: 0

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI Translucent
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 65439157
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_01a
ID: 120028153
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI Translucent
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 54232941
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_01b
ID: 130271494
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI Translucent
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 61642935
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_01c
ID: 118957569
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 56583306
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_02a
ID: 120947645
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 65259204
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_02b
ID: 129923341
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 66222856
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_02c
ID: 133191310
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 58931679
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_03a
ID: 129620984
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 56330596
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_03b
ID: 119078830
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 66929828
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_03c
ID: 133041695
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 66009942
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_03d
ID: 117751129
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 61803402
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_03e
ID: 131504451
Type: 7

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 66775153
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: CutScene_bg
ID: 117531460
Type: 7

View File

@ -1,7 +1,7 @@
- EID: 1
Name: Canvas
IsActive: true
NumberOfChildren: 1
NumberOfChildren: 3
Components:
Canvas Component:
Canvas Width: 1920
@ -28,11 +28,11 @@
Transform Component:
Translate: {x: -500, y: -1000, z: 0.5}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 500, y: 1080, z: 1}
Scale: {x: 675, y: 1009, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 121834459
Material: 120028153
IsActive: true
UI Component:
Canvas ID: 1
@ -46,13 +46,13 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 1000, z: 0.5}
Translate: {x: 0, y: 1000, z: 0.400000006}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 500, y: 1080, z: 1}
Scale: {x: 1000, y: 1032, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 123313564
Material: 130271494
IsActive: true
UI Component:
Canvas ID: 1
@ -66,13 +66,53 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 500, y: -1000, z: 0.5}
Translate: {x: 500, y: -1000, z: 0.300000012}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 500, y: 1080, z: 1}
Scale: {x: 756, y: 984, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 129138332
Material: 118957569
IsActive: true
UI Component:
Canvas ID: 1
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 11
Name: Background
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.699999988}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1920, y: 1080, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 117531460
IsActive: true
UI Component:
Canvas ID: 1
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 12
Name: Text
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 50, y: 50, z: 50}
IsActive: true
Text Renderer Component:
Text: Press Space to contiune
Font: 176667660
IsActive: true
UI Component:
Canvas ID: 1
@ -126,7 +166,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: -500, y: 0, z: 0}
Translate: {x: -550, y: 0, z: 0.5}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
@ -137,7 +177,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Translate: {x: 0, y: 0, z: 0.400000006}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
@ -148,7 +188,7 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 500, y: 0, z: 0}
Translate: {x: 550, y: 0, z: 0.300000012}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true

View File

@ -9,20 +9,21 @@ public class Cutscene : Script
public float duration = 3.0f;
private Renderable pic1Renderable;
private Renderable pic2Renderable;
private Renderable pic3Renderable;
private Renderable pic1aRenderable;
private Renderable pic1bRenderable;
private Renderable pic1cRenderable;
private Transform pic1Tran;
private Transform pic2Tran;
private Transform pic3Tran;
private Transform pic1aTran;
private Transform pic1bTran;
private Transform pic1cTran;
private float alphaIn = 0.0f;
//private float alphaOut = 1.0f;
private float time = 0.0f;
private bool showPic1 = true;
private bool showPic2 = false;
private bool showPic3 = false;
private bool showPic1a = true;
private bool showPic1b = false;
private bool showPic1c = false;
private bool cutsceneDone = false;
public float slideSpeed = 5.0f;
public GameObject cutscene1Points;
@ -43,27 +44,27 @@ public class Cutscene : Script
if (listOfCutscene1Pics[0])
{
pic1Renderable = listOfCutscene1Pics[0].GetComponent<Renderable>();
pic1Tran = listOfCutscene1Pics[0].GetComponent<Transform>();
pic1Renderable.Material.SetProperty<float>("data.alpha" , 0.0f);
pic1aRenderable = listOfCutscene1Pics[0].GetComponent<Renderable>();
pic1aTran = listOfCutscene1Pics[0].GetComponent<Transform>();
pic1aRenderable.Material.SetProperty<float>("data.alpha" , 0.0f);
}
else
Debug.LogError("PIC1 MISSING");
if (listOfCutscene1Pics[1])
{
pic2Renderable = listOfCutscene1Pics[1].GetComponent<Renderable>();
pic2Tran = listOfCutscene1Pics[1].GetComponent<Transform>();
pic2Renderable.Material.SetProperty<float>("data.alpha", 0.0f);
pic1bRenderable = listOfCutscene1Pics[1].GetComponent<Renderable>();
pic1bTran = listOfCutscene1Pics[1].GetComponent<Transform>();
pic1bRenderable.Material.SetProperty<float>("data.alpha", 0.0f);
}
else
Debug.LogError("PIC2 MISSING");
if (listOfCutscene1Pics[2])
{
pic3Renderable = listOfCutscene1Pics[2].GetComponent<Renderable>();
pic3Tran = listOfCutscene1Pics[2].GetComponent<Transform>();
pic3Renderable.Material.SetProperty<float>("data.alpha", 0.0f);
pic1cRenderable = listOfCutscene1Pics[2].GetComponent<Renderable>();
pic1cTran = listOfCutscene1Pics[2].GetComponent<Transform>();
pic1cRenderable.Material.SetProperty<float>("data.alpha", 0.0f);
}
else
Debug.LogError("PIC3 MISSING");
@ -73,63 +74,73 @@ public class Cutscene : Script
protected override void update()
{
if (showPic1)
if (showPic1a)
{
pic1Tran.LocalPosition = Vector3.Lerp(pic1Tran.LocalPosition, listOfCutscene1Points[0].LocalPosition, slideSpeed * Time.DeltaTimeF);
pic1aTran.LocalPosition = Vector3.Lerp(pic1aTran.LocalPosition, listOfCutscene1Points[0].LocalPosition, slideSpeed * Time.DeltaTimeF);
if (time < duration)
{
alphaIn = SHADE.Math.Lerp(0.0f, 1.0f, time / duration);
time += Time.DeltaTimeF;
}
else
{
pic1aTran.LocalPosition = listOfCutscene1Points[0].LocalPosition;
alphaIn = 1.0f;
}
pic1Renderable.Material.SetProperty<float>("data.alpha", alphaIn);
pic1aRenderable.Material.SetProperty<float>("data.alpha", alphaIn);
if (alphaIn >= 1.0f)
{
showPic1 = false;
showPic2 = true;
showPic1a = false;
showPic1b = true;
time = 0;
alphaIn = 0;
}
}
if (showPic2)
if (showPic1b)
{
pic2Tran.LocalPosition = Vector3.Lerp(pic2Tran.LocalPosition, listOfCutscene1Points[1].LocalPosition, slideSpeed * Time.DeltaTimeF);
pic1bTran.LocalPosition = Vector3.Lerp(pic1bTran.LocalPosition, listOfCutscene1Points[1].LocalPosition, slideSpeed * Time.DeltaTimeF);
if (time < duration)
{
alphaIn = SHADE.Math.Lerp(0.0f, 1.0f, time / duration);
time += Time.DeltaTimeF;
}
else
{
pic1bTran.LocalPosition = listOfCutscene1Points[1].LocalPosition;
alphaIn = 1.0f;
}
pic2Renderable.Material.SetProperty<float>("data.alpha", alphaIn);
pic1bRenderable.Material.SetProperty<float>("data.alpha", alphaIn);
if (alphaIn >= 1.0f)
{
showPic2 = false;
showPic3 = true;
showPic1b = false;
showPic1c = true;
time = 0;
alphaIn = 0;
}
}
if (showPic3)
if (showPic1c)
{
pic3Tran.LocalPosition = Vector3.Lerp(pic3Tran.LocalPosition, listOfCutscene1Points[2].LocalPosition, slideSpeed * Time.DeltaTimeF);
pic1cTran.LocalPosition = Vector3.Lerp(pic1cTran.LocalPosition, listOfCutscene1Points[2].LocalPosition, slideSpeed * Time.DeltaTimeF);
if (time < duration)
{
alphaIn = SHADE.Math.Lerp(0.0f, 1.0f, time / duration);
time += Time.DeltaTimeF;
}
else
{
pic1cTran.LocalPosition = listOfCutscene1Points[2].LocalPosition;
alphaIn = 1.0f;
}
pic3Renderable.Material.SetProperty<float>("data.alpha", alphaIn);
pic1cRenderable.Material.SetProperty<float>("data.alpha", alphaIn);
if (alphaIn >= 1.0f)
{
showPic3 = false;
showPic1c = false;
cutsceneDone = true;
time = 0;
alphaIn = 0;
}

View File

@ -9,10 +9,6 @@ public class MainMenu : Script
public GameObject obj;
private Renderable renderable;
//tbr
public GameObject test;
public Renderable testRenderable;
protected override void awake()
{
AudioHandler.audioClipHandlers["BGMMainMenu"] = Audio.CreateAudioClip("event:/Music/main_menu");
@ -23,8 +19,6 @@ public class MainMenu : Script
renderable = obj.GetComponent<Renderable>();
//tbr
testRenderable = test.GetComponent<Renderable>();
}
protected override void start()
@ -32,7 +26,7 @@ public class MainMenu : Script
}
protected override void update()
{
if (Input.GetKeyDown(Input.KeyCode.K) && obj)
/* if (Input.GetKeyDown(Input.KeyCode.K) && obj)
{
if (testRenderable.Material.GetProperty<float>("data.alpha") == 1)
{
@ -42,7 +36,7 @@ public class MainMenu : Script
{
testRenderable.Material.SetProperty<float>("data.alpha", 1);
}
}
}*/
if (Input.GetKeyDown(Input.KeyCode.Space))
{

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_01a
ID: 65439157
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_01b
ID: 54232941
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_01c
ID: 61642935
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_02a
ID: 56583306
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_02b
ID: 65259204
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_02c
ID: 66222856
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_03a
ID: 58931679
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_03b
ID: 56330596
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_03c
ID: 66929828
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_03d
ID: 66009942
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_03e
ID: 61803402
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: TX_cutscene_bg
ID: 66775153
Type: 3

View File

@ -131,7 +131,20 @@ namespace SHADE
bool isOpen = false;
if(filter.empty())
isOpen = ImGui::TreeNodeEx(folder, flags, "%s %s", ICON_MD_FOLDER, folder->name.data());
if (ImGui::BeginPopupContextItem())
{
if (ImGui::Selectable("Compile All"))
{
for (auto& file : files)
{
if (file.compilable)
SHAssetManager::CompileAsset(file.path, !file.compiled);
}
QueueRefresh();
}
ImGui::EndPopup();
}
const ImRect nodeRect = ImRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax());
//if (ImGui::BeginPopupContextItem())

View File

@ -34,6 +34,7 @@ namespace SHADE
currentMatSpec = SHResourceManager::LoadOrGet<SHMaterialSpec>(assetId);
currentMaterial = SHResourceManager::LoadOrGet<SHMaterial>(assetId);
materialName = SHAssetManager::GetAsset(assetId)->name;
}
void SHMaterialInspector::Init()
@ -169,6 +170,12 @@ namespace SHADE
}
}
ImGui::EndDisabled();
if (currentViewedMaterial)
{
ImGui::Text(materialName.data());
}
ImGui::EndMenuBar();
}
}

View File

@ -26,6 +26,7 @@ namespace SHADE
bool isDirty;
bool isNewMaterial;
AssetID currentViewedMaterial;
std::string materialName{};
Handle<SHMaterialSpec> currentMatSpec;
Handle<SHMaterial> currentMaterial;
Handle<SHVkShaderModule> vertShaderHandle, fragShaderHandle;

View File

@ -128,6 +128,7 @@ namespace SHADE
static constexpr std::string_view GBUFFER_WRITE_SUBPASS = "G-Buffer Write";
static constexpr std::string_view UI_SUBPASS = "UI";
static constexpr std::string_view UI_TRANSLUCENT_SUBPASS = "UI Translucent";
static constexpr std::string_view VFX_SUBPASS = "VFX";
static constexpr std::string_view OBJ_VFX_SUBPASS = "Object VFX Subpass No Depth";
@ -135,6 +136,7 @@ namespace SHADE
{
GBUFFER_WRITE_SUBPASS,
UI_SUBPASS,
UI_TRANSLUCENT_SUBPASS,
OBJ_VFX_SUBPASS
};
};

View File

@ -361,12 +361,20 @@ namespace SHADE
uiSubpass->AddColorOutput("Scene");
uiSubpass->AddColorOutput("Entity ID");
uiSubpass->AddDepthOutput("Depth Buffer");
uiSubpass->AddExteriorDrawCalls([=](Handle<SHVkCommandBuffer> cmdBuffer, Handle<SHRenderer> renderer, uint32_t frameIndex)
usableSubpassesMapping.emplace(SHGraphicsConstants::RenderGraphEntityNames::UI_SUBPASS.data(), uiSubpass);
auto uiTranslucentSubpass = screenSpaceNode->AddSubpass(SHGraphicsConstants::RenderGraphEntityNames::UI_TRANSLUCENT_SUBPASS.data(), worldViewport, screenRenderer);
uiTranslucentSubpass->AddColorOutput("Scene");
uiTranslucentSubpass->AddColorOutput("Entity ID");
uiTranslucentSubpass->AddDepthOutput("Depth Buffer");
uiTranslucentSubpass->AddExteriorDrawCalls([=](Handle<SHVkCommandBuffer> cmdBuffer, Handle<SHRenderer> renderer, uint32_t frameIndex)
{
textRenderingSubSystem->Render(cmdBuffer, renderer, frameIndex);
});
usableSubpassesMapping.emplace(SHGraphicsConstants::RenderGraphEntityNames::UI_SUBPASS.data(), uiSubpass);
usableSubpassesMapping.emplace(SHGraphicsConstants::RenderGraphEntityNames::UI_TRANSLUCENT_SUBPASS.data(), uiTranslucentSubpass);
/*-----------------------------------------------------------------------*/
/* RENDER TO SWAPCHAIN IMAGE FOR PRESENT PASS */
@ -461,7 +469,7 @@ namespace SHADE
// initialize the text renderer
auto uiNode = renderGraph->GetNode(SHGraphicsConstants::RenderGraphEntityNames::SCREEN_SPACE_PASS.data());
textRenderingSubSystem->Init(device, uiNode->GetRenderpass(), uiNode->GetSubpass(SHGraphicsConstants::RenderGraphEntityNames::UI_SUBPASS), descPool, textVS, textFS);
textRenderingSubSystem->Init(device, uiNode->GetRenderpass(), uiNode->GetSubpass(SHGraphicsConstants::RenderGraphEntityNames::UI_TRANSLUCENT_SUBPASS), descPool, textVS, textFS);
trajectoryRenderingSubSystem = resourceManager.Create<SHTrajectoryRenderingSubSystem>();