mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-04 11:35:06 +03:00
Various coding style improvements
This commit is contained in:
@@ -242,15 +242,16 @@ void main()
|
||||
float distance = length(Lights[i].Position - worldPos);
|
||||
float attenuation = 1.0 / (distance * distance);
|
||||
|
||||
if (Lights[i].Type == 0) {
|
||||
if (Lights[i].Type == 0)
|
||||
{
|
||||
L = normalize(Lights[i].Direction);
|
||||
attenuation = 1.0f;
|
||||
shadow += ShadowCalculation(Lights[i], worldPos, N);
|
||||
}
|
||||
|
||||
vec3 radiance = Lights[i].Color * attenuation ;
|
||||
|
||||
if (Lights[i].Type == 0) {
|
||||
if (Lights[i].Type == 0)
|
||||
{
|
||||
radiance *= shadow;
|
||||
}
|
||||
|
||||
@@ -281,8 +282,8 @@ void main()
|
||||
vec3 kD = 1.0 - kS;
|
||||
kD *= 1.0 - metallic;
|
||||
|
||||
vec3 ambient = (kD * albedo) * (ao);
|
||||
vec3 color = (ambient * ssao) + Lo;
|
||||
vec3 ambient = (kD * albedo) * (ao) * ssao;
|
||||
vec3 color = (ambient) + Lo;
|
||||
|
||||
// Display CSM splits..
|
||||
/*float depth = length(worldPos - u_EyePosition);
|
||||
|
||||
@@ -176,11 +176,11 @@ void main() {
|
||||
}
|
||||
|
||||
|
||||
outColor = vec4(resultingColor.xyz * Fresnel, metallic) ;
|
||||
outColor = vec4(resultingColor.xyz * Fresnel, 1.0) ;
|
||||
|
||||
}
|
||||
else {
|
||||
outColor = vec4(SSR(position, normalize(reflectionDirection)) * Fresnel, metallic);
|
||||
outColor = vec4(SSR(position, normalize(reflectionDirection)) * Fresnel, 1.0);
|
||||
if (outColor.xyz == vec3(0.f)) {
|
||||
outColor = texture(textureFrame, UV);
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ vec3 ComputeVolumetric(vec3 FragPos, Light light)
|
||||
vec3 rayVector = FragPos - startPosition; // Ray Direction
|
||||
|
||||
float rayLength = length(rayVector); // Length of the raymarched
|
||||
if(rayLength > 100)
|
||||
return vec3(0);
|
||||
if(rayLength > 1000.0)
|
||||
return vec3(1.0, 1.0, 1.0);
|
||||
float stepLength = rayLength / u_StepCount; // Step length
|
||||
vec3 rayDirection = rayVector / rayLength;
|
||||
vec3 step = rayDirection * stepLength; // Normalized to step length direction
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Nuake {
|
||||
mFinalFramebuffer->Clear();
|
||||
RenderCommand::Disable(RendererEnum::FACE_CULL);
|
||||
|
||||
Vector3 cameraPosition = Vector3(view[3]);
|
||||
auto cameraPosition = Vector3(view[3]);
|
||||
Shader* volumetricShader = ShaderManager::GetShader("resources/Shaders/volumetric.shader");
|
||||
volumetricShader->Bind();
|
||||
volumetricShader->SetUniformMat4f("u_Projection", projection);
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace Nuake
|
||||
if (!previous && controlled)
|
||||
{
|
||||
firstMouse = true;
|
||||
mouseLastX = x;
|
||||
mouseLastY = y;
|
||||
//mouseLastX = x;
|
||||
//mouseLastY = y;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -61,12 +61,7 @@ namespace Nuake
|
||||
if (Input::YScroll != 0.0f)
|
||||
{
|
||||
this->Fov += Input::YScroll;
|
||||
|
||||
if (Fov < 5.0f)
|
||||
{
|
||||
Fov = 5.0f;
|
||||
}
|
||||
|
||||
Fov = glm::max(Fov, 5.0f);
|
||||
Input::YScroll = 0.0f;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +87,6 @@ namespace Nuake
|
||||
if (Speed < 0)
|
||||
Speed = 0;
|
||||
|
||||
|
||||
if (m_Type == CAMERA_TYPE::ORTHO)
|
||||
{
|
||||
if (Input::IsKeyDown(GLFW_KEY_RIGHT))
|
||||
@@ -106,7 +100,7 @@ namespace Nuake
|
||||
}
|
||||
else
|
||||
{
|
||||
glm::vec3 movement = glm::vec3(0, 0, 0);
|
||||
auto movement = Vector3(0, 0, 0);
|
||||
|
||||
if (Input::IsKeyDown(GLFW_KEY_D))
|
||||
movement -= Right * (Speed * ts);
|
||||
@@ -175,9 +169,7 @@ namespace Nuake
|
||||
Translation += Vector3(Direction) * Input::YScroll;
|
||||
Input::YScroll = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
mouseLastX = x;
|
||||
mouseLastY = y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user