Debug tool for different CubeMap

changed cubemap influence.
This commit is contained in:
Tleety
2016-02-24 14:47:47 +01:00
parent f41e0b29be
commit feeff5b164
5 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ public:
void GenerateCubeMapTexture(); void GenerateCubeMapTexture();
//GLuint CubeMapTexture() const { return m_CubeMapTexture; } //GLuint CubeMapTexture() const { return m_CubeMapTexture; }
GLuint m_CubeMapTexture; GLuint m_CubeMapTexture = -1;
private: private:
IRenderer* m_Renderer; IRenderer* m_Renderer;
+1
View File
@@ -59,6 +59,7 @@ private:
Model* m_UnitSphere; Model* m_UnitSphere;
int m_DebugTextureToDraw = 0; int m_DebugTextureToDraw = 0;
int m_CubeMapTexture = 0;
bool m_ResizeWindow = false; bool m_ResizeWindow = false;
float m_SSAO_Radius = 1.0f; float m_SSAO_Radius = 1.0f;
float m_SSAO_Bias = 0.05f; float m_SSAO_Bias = 0.05f;
+1 -1
View File
@@ -170,7 +170,7 @@ void main()
vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed); vec4 color_result = mix((Color * diffuseTexel * DiffuseColor), Input.ExplosionColor, Input.ExplosionPercentageElapsed);
color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)); color_result = color_result * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel));
float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0; float specularResult = (specularTexel.r + specularTexel.g + specularTexel.b)/3.0;
color_result = color_result * clamp(1/specularTexel, 0, 1) + reflectionColor * clamp(specularTexel, 0, 1); color_result = color_result * clamp(1/specularTexel, 0, 1)*2 + reflectionColor * clamp(specularTexel, 0, 1)/2;
//vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color; //vec4 color_result = (DiffuseColor + Input.ExplosionColor) * (totalLighting.Diffuse + (totalLighting.Specular * specularTexel)) * diffuseTexel * Color;
+3 -1
View File
@@ -4,7 +4,6 @@ CubeMapPass::CubeMapPass(IRenderer* renderer)
:m_Renderer(renderer) :m_Renderer(renderer)
{ {
LoadTextures("Nevada"); LoadTextures("Nevada");
GenerateCubeMapTexture();
} }
void CubeMapPass::LoadTextures(std::string input) void CubeMapPass::LoadTextures(std::string input)
@@ -17,12 +16,15 @@ void CubeMapPass::LoadTextures(std::string input)
Texture* img = ResourceManager::Load<Texture>(str); Texture* img = ResourceManager::Load<Texture>(str);
m_CubeMapTextures.push_back(img); m_CubeMapTextures.push_back(img);
} }
GenerateCubeMapTexture();
} }
} }
void CubeMapPass::GenerateCubeMapTexture() void CubeMapPass::GenerateCubeMapTexture()
{ {
if (m_CubeMapTexture == -1) {
glGenTextures(1, &m_CubeMapTexture); glGenTextures(1, &m_CubeMapTexture);
}
glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapTexture); glBindTexture(GL_TEXTURE_CUBE_MAP, m_CubeMapTexture);
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
+6
View File
@@ -108,6 +108,12 @@ void Renderer::Draw(RenderFrame& frame)
{ {
GLERROR("PRE"); GLERROR("PRE");
ImGui::Combo("Draw textures", &m_DebugTextureToDraw, "Final\0Scene\0Bloom\0SceneLowRes\0BloomLowRes\0Gaussian\0Picking\0Ambient Occlusion"); ImGui::Combo("Draw textures", &m_DebugTextureToDraw, "Final\0Scene\0Bloom\0SceneLowRes\0BloomLowRes\0Gaussian\0Picking\0Ambient Occlusion");
ImGui::Combo("CubeMap", &m_CubeMapTexture, "Nevada(512)\0Sky(1024)");
if(m_CubeMapTexture == 0) {
m_CubeMapPass->LoadTextures("Nevada");
} else if (m_CubeMapTexture == 1) {
m_CubeMapPass->LoadTextures("Sky");
}
ImGui::SliderFloat("SSAO sample radius", &m_SSAO_Radius, 0.01f, 5.0f); ImGui::SliderFloat("SSAO sample radius", &m_SSAO_Radius, 0.01f, 5.0f);
ImGui::SliderFloat("SSAO bias", &m_SSAO_Bias, 0.0f, 0.1f); ImGui::SliderFloat("SSAO bias", &m_SSAO_Bias, 0.0f, 0.1f);