mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +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
|
||||
|
||||
Reference in New Issue
Block a user