Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3aba6748b |
@@ -19,7 +19,7 @@ struct DirectionalLightJob : RenderJob
|
|||||||
Direction = glm::vec4(0,0,-1,0) * glm::inverse(Transform::AbsoluteOrientation(m_World, transformComponent.EntityID));
|
Direction = glm::vec4(0,0,-1,0) * glm::inverse(Transform::AbsoluteOrientation(m_World, transformComponent.EntityID));
|
||||||
//Direction = glm::vec4((glm::vec3)directionalLightComponent["Direction"], 0.f);
|
//Direction = glm::vec4((glm::vec3)directionalLightComponent["Direction"], 0.f);
|
||||||
Color = (glm::vec4)directionalLightComponent["Color"];
|
Color = (glm::vec4)directionalLightComponent["Color"];
|
||||||
Intensity = (double)directionalLightComponent["Intensity"];
|
Intensity = (float)directionalLightComponent["Intensity"];
|
||||||
};
|
};
|
||||||
|
|
||||||
glm::vec4 Direction;
|
glm::vec4 Direction;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ struct ExplosionEffectJob : ModelJob
|
|||||||
ExplosionDuration = (double)explosionEffectComponent["ExplosionDuration"];
|
ExplosionDuration = (double)explosionEffectComponent["ExplosionDuration"];
|
||||||
EndColor = (glm::vec4)explosionEffectComponent["EndColor"];
|
EndColor = (glm::vec4)explosionEffectComponent["EndColor"];
|
||||||
Randomness = (bool)explosionEffectComponent["Randomness"];
|
Randomness = (bool)explosionEffectComponent["Randomness"];
|
||||||
RandomnessScalar = (double)explosionEffectComponent["RandomnessScalar"];
|
RandomnessScalar = (float)((double)explosionEffectComponent["RandomnessScalar"]);
|
||||||
Velocity = (glm::vec2)explosionEffectComponent["Velocity"];
|
Velocity = (glm::vec2)explosionEffectComponent["Velocity"];
|
||||||
ColorByDistance = (bool)explosionEffectComponent["ColorByDistance"];
|
ColorByDistance = (bool)explosionEffectComponent["ColorByDistance"];
|
||||||
ExponentialAccelaration = (bool)explosionEffectComponent["ExponentialAccelaration"];
|
ExponentialAccelaration = (bool)explosionEffectComponent["ExponentialAccelaration"];
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ struct ModelJob : RenderJob
|
|||||||
if (world->HasComponent(Entity, "Animation") && Skeleton != nullptr) {
|
if (world->HasComponent(Entity, "Animation") && Skeleton != nullptr) {
|
||||||
auto animationComponent = world->GetComponent(Entity, "Animation");
|
auto animationComponent = world->GetComponent(Entity, "Animation");
|
||||||
Animation = model->m_RawModel->m_Skeleton->GetAnimation(animationComponent["Name"]);
|
Animation = model->m_RawModel->m_Skeleton->GetAnimation(animationComponent["Name"]);
|
||||||
AnimationTime = (double)animationComponent["Time"];
|
AnimationTime = (float)((double)animationComponent["Time"]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ struct PointLightJob : RenderJob
|
|||||||
Position = glm::vec4((glm::vec3)transformComponent["Position"], 1.0f);
|
Position = glm::vec4((glm::vec3)transformComponent["Position"], 1.0f);
|
||||||
Position = glm::vec4(Transform::AbsolutePosition(m_World, transformComponent.EntityID), 1.f);
|
Position = glm::vec4(Transform::AbsolutePosition(m_World, transformComponent.EntityID), 1.f);
|
||||||
Color = (glm::vec4)pointLightComponent["Color"];
|
Color = (glm::vec4)pointLightComponent["Color"];
|
||||||
Radius = (double)pointLightComponent["Radius"];
|
Radius = (float)((double)pointLightComponent["Radius"]);
|
||||||
Intensity = (double)pointLightComponent["Intensity"];
|
Intensity = (float)pointLightComponent["Intensity"];
|
||||||
Falloff = (double)pointLightComponent["Falloff"];
|
Falloff = (float)pointLightComponent["Falloff"];
|
||||||
};
|
};
|
||||||
|
|
||||||
glm::vec4 Position;
|
glm::vec4 Position;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ struct std::hash<glm::ivec2>
|
|||||||
{
|
{
|
||||||
inline std::size_t operator()(const glm::ivec2 &v) const
|
inline std::size_t operator()(const glm::ivec2 &v) const
|
||||||
{
|
{
|
||||||
return boost::hash<float>()(v.x) ^ boost::hash<float>()(v.y);
|
return boost::hash<int>()(v.x) ^ boost::hash<int>()(v.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator()(const glm::ivec2& a, const glm::ivec2& b)const
|
inline bool operator()(const glm::ivec2& a, const glm::ivec2& b)const
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ void DrawBloomPass::Draw(GLuint texture)
|
|||||||
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].StartIndex);
|
, GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].StartIndex);
|
||||||
|
|
||||||
//Iterate some times to make it more gaussian.
|
//Iterate some times to make it more gaussian.
|
||||||
for (int i = 1; i < m_iterations; i++) {
|
for (int i = 1; i < (int)m_iterations; i++) {
|
||||||
//Vertical pass
|
//Vertical pass
|
||||||
m_GaussianFrameBuffer_vert.Bind();
|
m_GaussianFrameBuffer_vert.Bind();
|
||||||
m_GaussianProgram_vert->Bind();
|
m_GaussianProgram_vert->Bind();
|
||||||
@@ -129,6 +129,6 @@ void DrawBloomPass::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum fil
|
|||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, dimensions.x, dimensions.y, 0, format, type, nullptr);//TODO: Renderer: Fix the precision and Resolution
|
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, (GLsizei)dimensions.x, (GLsizei)dimensions.y, 0, format, type, nullptr);//TODO: Renderer: Fix the precision and Resolution
|
||||||
GLERROR("Texture initialization failed");
|
GLERROR("Texture initialization failed");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ void DrawFinalPass::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum fil
|
|||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, dimensions.x, dimensions.y, 0, format, type, nullptr);//TODO: Renderer: Fix the precision and Resolution
|
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, (GLsizei)dimensions.x, (GLsizei)dimensions.y, 0, format, type, nullptr);//TODO: Renderer: Fix the precision and Resolution
|
||||||
GLERROR("Texture initialization failed");
|
GLERROR("Texture initialization failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,8 +98,8 @@ void DrawFinalPass::GenerateMipMapTexture(GLuint* texture, GLenum wrapping, glm:
|
|||||||
{
|
{
|
||||||
glGenTextures(1, texture);
|
glGenTextures(1, texture);
|
||||||
glBindTexture(GL_TEXTURE_2D, *texture);
|
glBindTexture(GL_TEXTURE_2D, *texture);
|
||||||
glTexStorage2D(GL_TEXTURE_2D, numMipMaps, GL_RGBA8, dimensions.x, dimensions.y);
|
glTexStorage2D(GL_TEXTURE_2D, numMipMaps, GL_RGBA8, (GLsizei)dimensions.x, (GLsizei)dimensions.y);
|
||||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, dimensions.x, dimensions.y, format, type, texture);
|
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (GLsizei)dimensions.x, (GLsizei)dimensions.y, format, type, texture);
|
||||||
glGenerateMipmap(GL_TEXTURE_2D);
|
glGenerateMipmap(GL_TEXTURE_2D);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapping);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapping);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
||||||
@@ -131,7 +131,7 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
|||||||
|
|
||||||
if (explosionEffectJob->Animation != nullptr) {
|
if (explosionEffectJob->Animation != nullptr) {
|
||||||
std::vector<glm::mat4> frameBones = explosionEffectJob->Skeleton->GetFrameBones(*explosionEffectJob->Animation, explosionEffectJob->AnimationTime);
|
std::vector<glm::mat4> frameBones = explosionEffectJob->Skeleton->GetFrameBones(*explosionEffectJob->Animation, explosionEffectJob->AnimationTime);
|
||||||
glUniformMatrix4fv(glGetUniformLocation(explosionHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
glUniformMatrix4fv(glGetUniformLocation(explosionHandle, "Bones"), (GLsizei)frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
|||||||
if (modelJob) {
|
if (modelJob) {
|
||||||
//bind forward program
|
//bind forward program
|
||||||
m_ForwardPlusProgram->Bind();
|
m_ForwardPlusProgram->Bind();
|
||||||
glUniform2f(glGetUniformLocation(forwardHandle, "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
glUniform2f(glGetUniformLocation(forwardHandle, "ScreenDimensions"), (GLfloat)m_Renderer->GetViewportSize().Width, (GLfloat)m_Renderer->GetViewportSize().Height);
|
||||||
|
|
||||||
//bind uniforms
|
//bind uniforms
|
||||||
BindModelUniforms(forwardHandle, modelJob, scene);
|
BindModelUniforms(forwardHandle, modelJob, scene);
|
||||||
@@ -159,7 +159,7 @@ void DrawFinalPass::DrawModelRenderQueues(std::list<std::shared_ptr<RenderJob>>&
|
|||||||
|
|
||||||
if (modelJob->Animation != nullptr) {
|
if (modelJob->Animation != nullptr) {
|
||||||
std::vector<glm::mat4> frameBones = modelJob->Skeleton->GetFrameBones(*modelJob->Animation, modelJob->AnimationTime);
|
std::vector<glm::mat4> frameBones = modelJob->Skeleton->GetFrameBones(*modelJob->Animation, modelJob->AnimationTime);
|
||||||
glUniformMatrix4fv(glGetUniformLocation(forwardHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
glUniformMatrix4fv(glGetUniformLocation(forwardHandle, "Bones"), (GLsizei)frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,13 +178,13 @@ void DrawFinalPass::BindExplosionUniforms(GLuint shaderHandle, std::shared_ptr<E
|
|||||||
{
|
{
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||||
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), m_Renderer->Resolution().Width, m_Renderer->Resolution().Height);
|
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), (GLfloat)m_Renderer->Resolution().Width, (GLfloat)m_Renderer->Resolution().Height);
|
||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color));
|
||||||
glUniform3fv(glGetUniformLocation(shaderHandle, "ExplosionOrigin"), 1, glm::value_ptr(job->ExplosionOrigin));
|
glUniform3fv(glGetUniformLocation(shaderHandle, "ExplosionOrigin"), 1, glm::value_ptr(job->ExplosionOrigin));
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "TimeSinceDeath"), job->TimeSinceDeath);
|
glUniform1f(glGetUniformLocation(shaderHandle, "TimeSinceDeath"), (GLfloat)job->TimeSinceDeath);
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "ExplosionDuration"), job->ExplosionDuration);
|
glUniform1f(glGetUniformLocation(shaderHandle, "ExplosionDuration"), (GLfloat)job->ExplosionDuration);
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "EndColor"), 1, glm::value_ptr(job->EndColor));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "EndColor"), 1, glm::value_ptr(job->EndColor));
|
||||||
glUniform1i(glGetUniformLocation(shaderHandle, "Randomness"), job->Randomness);
|
glUniform1i(glGetUniformLocation(shaderHandle, "Randomness"), job->Randomness);
|
||||||
glUniform1f(glGetUniformLocation(shaderHandle, "RandomnessScalar"), job->RandomnessScalar);
|
glUniform1f(glGetUniformLocation(shaderHandle, "RandomnessScalar"), job->RandomnessScalar);
|
||||||
@@ -199,7 +199,7 @@ void DrawFinalPass::BindModelUniforms(GLuint shaderHandle, std::shared_ptr<Model
|
|||||||
{
|
{
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "V"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "P"), 1, GL_FALSE, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||||
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), m_Renderer->Resolution().Width, m_Renderer->Resolution().Height);
|
glUniform2f(glGetUniformLocation(shaderHandle, "ScreenDimensions"), (GLfloat)m_Renderer->Resolution().Width, (GLfloat)m_Renderer->Resolution().Height);
|
||||||
|
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "M"), 1, GL_FALSE, glm::value_ptr(job->Matrix));
|
||||||
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color));
|
glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color));
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ void FrameBuffer::Generate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
GLenum* bufferTextures = &attachments[0];
|
GLenum* bufferTextures = &attachments[0];
|
||||||
glDrawBuffers(attachments.size(), bufferTextures);
|
glDrawBuffers((GLsizei)attachments.size(), bufferTextures);
|
||||||
|
|
||||||
if (GLenum frameBufferStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
|
if (GLenum frameBufferStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
|
||||||
LOG_ERROR("FrameBuffer incomplete: 0x%x\n", frameBufferStatus);
|
LOG_ERROR("FrameBuffer incomplete: 0x%x\n", frameBufferStatus);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ void LightCullingPass::GenerateNewFrustum(RenderScene& scene)
|
|||||||
|
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, m_FrustumSSBO);
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, m_FrustumSSBO);
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_CalculateFrustumProgram->GetHandle(), "P"), 1, false, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
glUniformMatrix4fv(glGetUniformLocation(m_CalculateFrustumProgram->GetHandle(), "P"), 1, false, glm::value_ptr(scene.Camera->ProjectionMatrix()));
|
||||||
glUniform2f(glGetUniformLocation(m_CalculateFrustumProgram->GetHandle(), "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
glUniform2f(glGetUniformLocation(m_CalculateFrustumProgram->GetHandle(), "ScreenDimensions"), (GLfloat)m_Renderer->GetViewportSize().Width, (GLfloat)m_Renderer->GetViewportSize().Height);
|
||||||
glDispatchCompute((int)(m_Renderer->GetViewportSize().Width/(TILE_SIZE*TILE_SIZE) + 1), (int)(m_Renderer->GetViewportSize().Height/(TILE_SIZE*TILE_SIZE) + 1), 1);
|
glDispatchCompute((int)(m_Renderer->GetViewportSize().Width/(TILE_SIZE*TILE_SIZE) + 1), (int)(m_Renderer->GetViewportSize().Height/(TILE_SIZE*TILE_SIZE) + 1), 1);
|
||||||
|
|
||||||
GLERROR("CalculateFrustum Error: End");
|
GLERROR("CalculateFrustum Error: End");
|
||||||
@@ -67,14 +67,14 @@ void LightCullingPass::CullLights(RenderScene& scene)
|
|||||||
glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
|
glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
|
||||||
|
|
||||||
m_LightCullProgram->Bind();
|
m_LightCullProgram->Bind();
|
||||||
glUniform2f(glGetUniformLocation(m_LightCullProgram->GetHandle(), "ScreenDimensions"), m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height);
|
glUniform2f(glGetUniformLocation(m_LightCullProgram->GetHandle(), "ScreenDimensions"), (GLfloat)m_Renderer->GetViewportSize().Width, (GLfloat)m_Renderer->GetViewportSize().Height);
|
||||||
glUniformMatrix4fv(glGetUniformLocation(m_LightCullProgram->GetHandle(), "V"), 1, false, glm::value_ptr(scene.Camera->ViewMatrix()));
|
glUniformMatrix4fv(glGetUniformLocation(m_LightCullProgram->GetHandle(), "V"), 1, false, glm::value_ptr(scene.Camera->ViewMatrix()));
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, m_FrustumSSBO);
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 0, m_FrustumSSBO);
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, m_LightSSBO);
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, m_LightSSBO);
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, m_LightGridSSBO);
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, m_LightGridSSBO);
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, m_LightOffsetSSBO);
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, m_LightOffsetSSBO);
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 4, m_LightIndexSSBO);
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 4, m_LightIndexSSBO);
|
||||||
glDispatchCompute(glm::ceil(m_Renderer->GetViewportSize().Width/ TILE_SIZE), glm::ceil(m_Renderer->GetViewportSize().Height / TILE_SIZE), 1);
|
glDispatchCompute(glm::ceil((GLuint)m_Renderer->GetViewportSize().Width/ TILE_SIZE), glm::ceil((GLuint)m_Renderer->GetViewportSize().Height / TILE_SIZE), 1);
|
||||||
|
|
||||||
GLERROR("CullLights Error: End");
|
GLERROR("CullLights Error: End");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ void PickingPass::Draw(RenderScene& scene)
|
|||||||
|
|
||||||
if (modelJob->Animation != nullptr) {
|
if (modelJob->Animation != nullptr) {
|
||||||
std::vector<glm::mat4> frameBones = modelJob->Skeleton->GetFrameBones(*modelJob->Animation, modelJob->AnimationTime);
|
std::vector<glm::mat4> frameBones = modelJob->Skeleton->GetFrameBones(*modelJob->Animation, modelJob->AnimationTime);
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), (GLsizei)frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ void PickingPass::Draw(RenderScene& scene)
|
|||||||
|
|
||||||
if (modelJob->Animation != nullptr) {
|
if (modelJob->Animation != nullptr) {
|
||||||
std::vector<glm::mat4> frameBones = modelJob->Skeleton->GetFrameBones(*modelJob->Animation, modelJob->AnimationTime);
|
std::vector<glm::mat4> frameBones = modelJob->Skeleton->GetFrameBones(*modelJob->Animation, modelJob->AnimationTime);
|
||||||
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), (GLsizei)frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,6 +208,6 @@ void PickingPass::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filte
|
|||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, dimensions.x, dimensions.y, 0, format, type, nullptr);//TODO: Renderer: Fix the precision and Resolution
|
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, (GLsizei)dimensions.x, (GLsizei)dimensions.y, 0, format, type, nullptr);//TODO: Renderer: Fix the precision and Resolution
|
||||||
GLERROR("Texture initialization failed");
|
GLERROR("Texture initialization failed");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ bool RenderSystem::OnSetCamera(Events::SetCamera& e)
|
|||||||
{
|
{
|
||||||
ComponentWrapper cTransform = e.CameraEntity["Transform"];
|
ComponentWrapper cTransform = e.CameraEntity["Transform"];
|
||||||
ComponentWrapper cCamera = e.CameraEntity["Camera"];
|
ComponentWrapper cCamera = e.CameraEntity["Camera"];
|
||||||
m_Camera->SetFOV((double)cCamera["FOV"]);
|
m_Camera->SetFOV((float)cCamera["FOV"]);
|
||||||
m_Camera->SetNearClip((double)cCamera["NearClip"]);
|
m_Camera->SetNearClip((float)cCamera["NearClip"]);
|
||||||
m_Camera->SetFarClip((double)cCamera["FarClip"]);
|
m_Camera->SetFarClip((float)cCamera["FarClip"]);
|
||||||
m_Camera->SetPosition(cTransform["Position"]);
|
m_Camera->SetPosition(cTransform["Position"]);
|
||||||
m_Camera->SetOrientation(glm::quat((const glm::vec3&)cTransform["Orientation"]));
|
m_Camera->SetOrientation(glm::quat((const glm::vec3&)cTransform["Orientation"]));
|
||||||
m_CurrentCamera = e.CameraEntity;
|
m_CurrentCamera = e.CameraEntity;
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ void Renderer::GenerateTexture(GLuint* texture, GLenum wrapping, GLenum filterin
|
|||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapping);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filtering);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filtering);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, dimensions.x, dimensions.y, 0, format, type, nullptr);//TODO: Renderer: Fix the precision and Resolution
|
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, (GLsizei)dimensions.x, (GLsizei)dimensions.y, 0, format, type, nullptr);//TODO: Renderer: Fix the precision and Resolution
|
||||||
GLERROR("Texture initialization failed");
|
GLERROR("Texture initialization failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user