Merge and some small fixes
This commit is contained in:
@@ -226,8 +226,8 @@ void dd::Renderer::CreateBuffers()
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, m_Resolution.Width, m_Resolution.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
//Fill waterBlur pass
|
||||
glGenFramebuffers(1, &t_m_fbWaterBlur);
|
||||
@@ -247,8 +247,8 @@ void dd::Renderer::CreateBuffers()
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, m_Resolution.Width, m_Resolution.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
//Fill waterBlur pass2
|
||||
glGenFramebuffers(1, &t_m_fbWaterBlur2);
|
||||
@@ -267,8 +267,8 @@ void dd::Renderer::CreateBuffers()
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, m_Resolution.Width, m_Resolution.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
// Create third pass framebuffer
|
||||
glGenFramebuffers(1, &m_fbDeferred3);
|
||||
@@ -537,10 +537,11 @@ void dd::Renderer::DrawWater(RenderQueue &rq)
|
||||
glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
t_m_spWater2->Bind();
|
||||
float radius = 3.f;
|
||||
|
||||
glUniform2fv(glGetUniformLocation(shaderProgramHandle, "dir"), 1, glm::value_ptr(glm::vec2(1.0f, 0.0f)));
|
||||
glUniform1f(glGetUniformLocation(shaderProgramHandle, "res"), m_Resolution.Width);
|
||||
glUniform1f(glGetUniformLocation(shaderProgramHandle, "radius"), 3.0f);
|
||||
glUniform1f(glGetUniformLocation(shaderProgramHandle, "radius"), radius);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, t_m_Gwater);
|
||||
@@ -560,7 +561,7 @@ void dd::Renderer::DrawWater(RenderQueue &rq)
|
||||
|
||||
glUniform2fv(glGetUniformLocation(shaderProgramHandle, "dir"), 1, glm::value_ptr(glm::vec2(0.0f, 1.0f)));
|
||||
glUniform1f(glGetUniformLocation(shaderProgramHandle, "res"), m_Resolution.Height);
|
||||
glUniform1f(glGetUniformLocation(shaderProgramHandle, "radius"), 3.0f);
|
||||
glUniform1f(glGetUniformLocation(shaderProgramHandle, "radius"), radius);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, t_m_BWater);
|
||||
@@ -665,6 +666,9 @@ void dd::Renderer::DebugKeys()
|
||||
m_CurrentScreenBuffer = m_tLighting;
|
||||
}
|
||||
if (glfwGetKey(m_Window, GLFW_KEY_F7)) {
|
||||
m_CurrentScreenBuffer = t_m_BWater;
|
||||
m_CurrentScreenBuffer = t_m_Gwater;
|
||||
}
|
||||
if (glfwGetKey(m_Window, GLFW_KEY_F8)) {
|
||||
m_CurrentScreenBuffer = t_m_BWater;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ EntityID dd::Systems::PadSystem::CreateBall()
|
||||
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
|
||||
physics->Static = false;
|
||||
|
||||
cball->Speed = 10;
|
||||
cball->Speed = 5.f;
|
||||
|
||||
m_World->CommitEntity(ent);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ void dd::Systems::PhysicsSystem::Initialize()
|
||||
void dd::Systems::PhysicsSystem::InitializeWater()
|
||||
{
|
||||
b2ParticleSystemDef m_ParticleSystemDef;
|
||||
m_ParticleSystemDef.radius = 0.1f;
|
||||
m_ParticleSystemDef.radius = 0.13f;
|
||||
|
||||
m_ParticleSystem = m_PhysicsWorld->CreateParticleSystem(&m_ParticleSystemDef);
|
||||
}
|
||||
@@ -265,7 +265,6 @@ void dd::Systems::PhysicsSystem::CreateParticleGroup(EntityID e)
|
||||
shape.SetAsBox(transform->Scale.x/2.f, transform->Scale.y/2.f);
|
||||
pd.shape = &shape;
|
||||
pd.flags = b2_tensileParticle;
|
||||
pd.linearVelocity = b2Vec2(0, 5.f);
|
||||
pd.position.Set(transform->Position.x, transform->Position.y);
|
||||
//TODO: PUT IN LIST
|
||||
t_watergroup = m_ParticleSystem->CreateParticleGroup(pd);
|
||||
@@ -276,8 +275,6 @@ void dd::Systems::PhysicsSystem::CreateParticleGroup(EntityID e)
|
||||
auto transformChild = m_World->AddComponent<Components::Transform>(t_waterparticle);
|
||||
//auto sprite = m_World->AddComponent<Components::Sprite>(t_waterparticle);
|
||||
|
||||
|
||||
|
||||
transformChild->Position = glm::vec3(t_ParticlePositions[i].x - transform->Position.x, t_ParticlePositions[i].y - transform->Position.y, -9.5f);
|
||||
transformChild->Scale = glm::vec3(m_ParticleSystem->GetRadius())/transform->Scale;
|
||||
//sprite->SpriteFile = "Textures/Ball.png";
|
||||
|
||||
Reference in New Issue
Block a user