Added DEBUG flags to all debug imgui stuff
This commit is contained in:
@@ -75,7 +75,7 @@ void Renderer::InitializeWindow()
|
|||||||
//glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
|
//glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
|
||||||
//glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);
|
//glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);
|
||||||
glfwWindowHint(GLFW_DECORATED, false);
|
glfwWindowHint(GLFW_DECORATED, false);
|
||||||
glfwWindowHint(GLFW_AUTO_ICONIFY, false);
|
//glfwWindowHint(GLFW_AUTO_ICONIFY, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//glfwWindowHint(GLFW_SAMPLES, 8);
|
//glfwWindowHint(GLFW_SAMPLES, 8);
|
||||||
@@ -167,17 +167,21 @@ void Renderer::Draw(RenderFrame& frame)
|
|||||||
{
|
{
|
||||||
GLERROR("PRE");
|
GLERROR("PRE");
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::Combo("Draw textures", &m_DebugTextureToDraw, "Final\0Scene\0Bloom\0Gaussian\0Picking\0Ambient Occlusion\0Combined Scene Texture\0Full Blurred Texture");
|
ImGui::Combo("Draw textures", &m_DebugTextureToDraw, "Final\0Scene\0Bloom\0Gaussian\0Picking\0Ambient Occlusion\0Combined Scene Texture\0Full Blurred Texture");
|
||||||
ImGui::Combo("CubeMap", &m_CubeMapTexture, "Nevada(512)\0Sky(1024)");
|
ImGui::Combo("CubeMap", &m_CubeMapTexture, "Nevada(512)\0Sky(1024)");
|
||||||
|
#endif
|
||||||
if(m_CubeMapTexture == 0) {
|
if(m_CubeMapTexture == 0) {
|
||||||
m_CubeMapPass->LoadTextures("Nevada");
|
m_CubeMapPass->LoadTextures("Nevada");
|
||||||
} else if (m_CubeMapTexture == 1) {
|
} else if (m_CubeMapTexture == 1) {
|
||||||
m_CubeMapPass->LoadTextures("Sky");
|
m_CubeMapPass->LoadTextures("Sky");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::SliderInt("SSAO Quality", &m_SSAO_Quality, 0, 3);
|
ImGui::SliderInt("SSAO Quality", &m_SSAO_Quality, 0, 3);
|
||||||
ImGui::SliderInt("Glow Quality", &m_GLOW_Quality, 0, 3);
|
ImGui::SliderInt("Glow Quality", &m_GLOW_Quality, 0, 3);
|
||||||
ImGui::SliderInt("MSAA Level", (int*)&m_MSAA_Level, 0, 16);
|
ImGui::SliderInt("MSAA Level", (int*)&m_MSAA_Level, 0, 16);
|
||||||
|
#endif
|
||||||
m_SSAOPass->ChangeQuality(m_SSAO_Quality);
|
m_SSAOPass->ChangeQuality(m_SSAO_Quality);
|
||||||
m_DrawBloomPass->ChangeQuality(m_GLOW_Quality);
|
m_DrawBloomPass->ChangeQuality(m_GLOW_Quality);
|
||||||
m_DrawFinalPass->setMSAA(m_MSAA_Level);
|
m_DrawFinalPass->setMSAA(m_MSAA_Level);
|
||||||
|
|||||||
@@ -25,11 +25,13 @@ ShadowPass::~ShadowPass()
|
|||||||
|
|
||||||
void ShadowPass::DebugGUI()
|
void ShadowPass::DebugGUI()
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::Checkbox("EnableShadows", &m_EnableShadows);
|
ImGui::Checkbox("EnableShadows", &m_EnableShadows);
|
||||||
ImGui::DragFloat2("ShadowMapNearFar", m_NearFarPlane, 1.f, -1000.f, 1000.f);
|
ImGui::DragFloat2("ShadowMapNearFar", m_NearFarPlane, 1.f, -1000.f, 1000.f);
|
||||||
ImGui::DragFloat("ShadowClippingWeight", &m_SplitWeight, 0.001f, 0.f, 1.f);
|
ImGui::DragFloat("ShadowClippingWeight", &m_SplitWeight, 0.001f, 0.f, 1.f);
|
||||||
ImGui::Checkbox("ShadowTransparentObjects", &m_TransparentObjects);
|
ImGui::Checkbox("ShadowTransparentObjects", &m_TransparentObjects);
|
||||||
ImGui::Checkbox("ShadowOnTextureAlphas", &m_TexturedShadows);
|
ImGui::Checkbox("ShadowOnTextureAlphas", &m_TexturedShadows);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShadowPass::InitializeCameras(RenderScene & scene)
|
void ShadowPass::InitializeCameras(RenderScene & scene)
|
||||||
|
|||||||
@@ -202,12 +202,18 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
|
|
||||||
if (addSpeed > 0) {
|
if (addSpeed > 0) {
|
||||||
static float accel = 15.f;
|
static float accel = 15.f;
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::InputFloat("accel", &accel);
|
ImGui::InputFloat("accel", &accel);
|
||||||
|
#endif
|
||||||
static float airAccel = 0.5f;
|
static float airAccel = 0.5f;
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::InputFloat("airAccel", &airAccel);
|
ImGui::InputFloat("airAccel", &airAccel);
|
||||||
|
#endif
|
||||||
float actualAccel = isOnGround ? accel : airAccel;
|
float actualAccel = isOnGround ? accel : airAccel;
|
||||||
static float surfaceFriction = 5.f;
|
static float surfaceFriction = 5.f;
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::InputFloat("surfaceFriction", &surfaceFriction);
|
ImGui::InputFloat("surfaceFriction", &surfaceFriction);
|
||||||
|
#endif
|
||||||
float accelerationSpeed = actualAccel * (float)dt * wishSpeed * surfaceFriction;
|
float accelerationSpeed = actualAccel * (float)dt * wishSpeed * surfaceFriction;
|
||||||
//if doubleTapped do Assault Dash - but only boost maximum 50.0f
|
//if doubleTapped do Assault Dash - but only boost maximum 50.0f
|
||||||
float doubleTapDashBoost = controller->AssaultDashDoubleTapped() ? 40.0f : 1.0f;
|
float doubleTapDashBoost = controller->AssaultDashDoubleTapped() ? 40.0f : 1.0f;
|
||||||
@@ -220,7 +226,9 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
|||||||
accelerationSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
accelerationSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||||
}
|
}
|
||||||
velocity += accelerationSpeed * (glm::vec3)wishDirection;
|
velocity += accelerationSpeed * (glm::vec3)wishDirection;
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x(), velocity.y(), velocity.z(), glm::length((glm::vec3)velocity));
|
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x(), velocity.y(), velocity.z(), glm::length((glm::vec3)velocity));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isOnGround) {
|
if (isOnGround) {
|
||||||
@@ -336,10 +344,14 @@ void PlayerMovementSystem::updateVelocity(EntityWrapper player, double dt)
|
|||||||
// Ground friction
|
// Ground friction
|
||||||
float speed = glm::length((glm::vec3)velocity);
|
float speed = glm::length((glm::vec3)velocity);
|
||||||
static float groundFriction = 7.f;
|
static float groundFriction = 7.f;
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::InputFloat("groundFriction", &groundFriction);
|
ImGui::InputFloat("groundFriction", &groundFriction);
|
||||||
|
#endif
|
||||||
static float airFriction = 2.f;
|
static float airFriction = 2.f;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
ImGui::InputFloat("airFriction", &airFriction);
|
ImGui::InputFloat("airFriction", &airFriction);
|
||||||
|
#endif
|
||||||
float friction = isOnGround ? groundFriction : airFriction;
|
float friction = isOnGround ? groundFriction : airFriction;
|
||||||
if (speed > 0) {
|
if (speed > 0) {
|
||||||
float drop = speed * friction * (float)dt;
|
float drop = speed * friction * (float)dt;
|
||||||
|
|||||||
Reference in New Issue
Block a user