forked from tippesi/Atlas-Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port open world features to Vulkan (tippesi#28)
* Fixed many terrain loading issues * Terrain rendering is working again * Working on terrain shadows * The ocean rendering (not simulation) is working again * Fixed a few issues * Working on caustics * Fixes regarding Windows * Working on ocean simulation * Further work on ocean simulation * Ocean simulation is working fully now * Replace tabs with spaces * Fix of shadow on caustics * Improved upsampling for reflections and clouds * Working on an improved impostor system * Impostor generation is working again * Continuing work on impostors * Changes to shaders * Impostor shadow rendering working again * Fixing some issues * Fixing remaining issues for PR * More fixes
- Loading branch information
Showing
419 changed files
with
19,460 additions
and
18,830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
#include <../common/PI.hsh> | ||
|
||
struct BRDFSample { | ||
vec3 reflectance; | ||
vec3 L; | ||
float pdf; | ||
vec3 reflectance; | ||
vec3 L; | ||
float pdf; | ||
}; | ||
|
||
vec3 FresnelSchlick(vec3 F0, float F90, float CosTheta) { | ||
|
||
return F0 + (vec3(F90) - F0) * pow(1.0 - CosTheta, 5.0); | ||
return F0 + (vec3(F90) - F0) * pow(1.0 - CosTheta, 5.0); | ||
|
||
} | ||
|
||
float RenormalizedDisneyDiffuse(float NdotV, float NdotL, float LdotH, float linearRoughness) { | ||
|
||
float energyBias = mix(0.0, 0.5, linearRoughness); | ||
float energyFactor = mix(1.0, 1.0 / 1.51, linearRoughness); | ||
float FD90 = energyBias + 2.0 * LdotH * LdotH * linearRoughness; | ||
float lightScatter = FresnelSchlick(vec3(1.0), FD90, NdotL).r; | ||
float viewScatter = FresnelSchlick(vec3(1.0), FD90, NdotV).r; | ||
float energyBias = mix(0.0, 0.5, linearRoughness); | ||
float energyFactor = mix(1.0, 1.0 / 1.51, linearRoughness); | ||
float FD90 = energyBias + 2.0 * LdotH * LdotH * linearRoughness; | ||
float lightScatter = FresnelSchlick(vec3(1.0), FD90, NdotL).r; | ||
float viewScatter = FresnelSchlick(vec3(1.0), FD90, NdotV).r; | ||
|
||
return lightScatter * viewScatter * energyFactor; | ||
return lightScatter * viewScatter * energyFactor; | ||
|
||
} | ||
|
||
float VisibilitySmithGGXSeparable(float CosTheta, float alpha) { | ||
|
||
float alpha2 = alpha * alpha; | ||
return 2.0 / (1.0 + sqrt(alpha2 + (1 - alpha2) * CosTheta * CosTheta)); | ||
float alpha2 = alpha * alpha; | ||
return 2.0 / (1.0 + sqrt(alpha2 + (1 - alpha2) * CosTheta * CosTheta)); | ||
|
||
} | ||
|
||
float VisibilitySmithGGXCorrelated(float NdotL, float NdotV, float alpha) { | ||
|
||
float alpha2 = alpha * alpha; | ||
float GGXL = NdotV * sqrt((-NdotL * alpha2 + NdotL) * NdotL + alpha2); | ||
float GGXV = NdotL * sqrt((-NdotV * alpha2 + NdotV) * NdotV + alpha2); | ||
float alpha2 = alpha * alpha; | ||
float GGXL = NdotV * sqrt((-NdotL * alpha2 + NdotL) * NdotL + alpha2); | ||
float GGXV = NdotL * sqrt((-NdotV * alpha2 + NdotV) * NdotV + alpha2); | ||
|
||
// Avoid NaN | ||
return 0.5 / (GGXL + GGXV + 0.0000001); | ||
// Avoid NaN | ||
return 0.5 / (GGXL + GGXV + 0.0000001); | ||
|
||
} | ||
|
||
float DistributionGGX(float NdotH, float alpha) { | ||
|
||
float alpha2 = alpha * alpha; | ||
float f = (NdotH * alpha2 - NdotH) * NdotH + 1.0; | ||
float alpha2 = alpha * alpha; | ||
float f = (NdotH * alpha2 - NdotH) * NdotH + 1.0; | ||
|
||
// Avoid NaN | ||
return alpha2 / (f * f + 0.0000001) * INV_PI; | ||
// Avoid NaN | ||
return alpha2 / (f * f + 0.0000001) * INV_PI; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.