Fix code style

This commit is contained in:
Wojtek Figat
2020-12-21 23:37:28 +01:00
parent d322015e6e
commit 2a29abcc39
13 changed files with 47 additions and 89 deletions

View File

@@ -39,22 +39,6 @@ struct LightShadowData
#define DECLARE_LIGHTSHADOWDATA_ACCESS(uniformName) LightShadowData Get##uniformName##Data() { return uniformName; }
#endif
// Gets the cube texture face index to use for shadow map sampling for the given view-to-light direction vector
// Where: direction = normalize(worldPosition - lightPosition)
int GetCubeFaceIndex(float3 direction)
{
int cubeFaceIndex;
float3 absDirection = abs(direction);
float maxDirection = max(absDirection.x, max(absDirection.y, absDirection.z));
if (maxDirection == absDirection.x)
cubeFaceIndex = absDirection.x == direction.x ? 0 : 1;
else if (maxDirection == absDirection.y)
cubeFaceIndex = absDirection.y == direction.y ? 2 : 3;
else
cubeFaceIndex = absDirection.z == direction.z ? 4 : 5;
return cubeFaceIndex;
}
float3 GetShadowPositionOffset(float offsetScale, float NoL, float3 normal)
{
float normalOffsetScale = saturate(1.0f - NoL);