diff options
| author | raysan5 <[email protected]> | 2021-01-25 17:53:04 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2021-01-25 17:53:04 +0100 |
| commit | 65b299c6cfdfd85a79833641c96b41babd50c872 (patch) | |
| tree | 43cdf1814f61550f6f0a9a5679f582436e45b487 /examples/models/resources | |
| parent | f3ce3a6f741fdf02eb602e2d7df7b14951f4aa65 (diff) | |
| download | raylib-65b299c6cfdfd85a79833641c96b41babd50c872.tar.gz raylib-65b299c6cfdfd85a79833641c96b41babd50c872.zip | |
Replace tabs by 4 spaces
Diffstat (limited to 'examples/models/resources')
| -rw-r--r-- | examples/models/resources/shaders/glsl330/brdf.fs | 26 | ||||
| -rw-r--r-- | examples/models/resources/shaders/glsl330/prefilter.fs | 26 | ||||
| -rw-r--r-- | examples/models/resources/shaders/glsl330/skybox.fs | 2 |
3 files changed, 27 insertions, 27 deletions
diff --git a/examples/models/resources/shaders/glsl330/brdf.fs b/examples/models/resources/shaders/glsl330/brdf.fs index d04bc661..f2774f81 100644 --- a/examples/models/resources/shaders/glsl330/brdf.fs +++ b/examples/models/resources/shaders/glsl330/brdf.fs @@ -41,27 +41,27 @@ float RadicalInverseVdC(uint bits) // Compute Hammersley coordinates vec2 Hammersley(uint i, uint N) { - return vec2(float(i)/float(N), RadicalInverseVdC(i)); + return vec2(float(i)/float(N), RadicalInverseVdC(i)); } // Integrate number of importance samples for (roughness and NoV) vec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness) { - float a = roughness*roughness; - float phi = 2.0 * PI * Xi.x; - float cosTheta = sqrt((1.0 - Xi.y)/(1.0 + (a*a - 1.0)*Xi.y)); - float sinTheta = sqrt(1.0 - cosTheta*cosTheta); + float a = roughness*roughness; + float phi = 2.0 * PI * Xi.x; + float cosTheta = sqrt((1.0 - Xi.y)/(1.0 + (a*a - 1.0)*Xi.y)); + float sinTheta = sqrt(1.0 - cosTheta*cosTheta); - // Transform from spherical coordinates to cartesian coordinates (halfway vector) - vec3 H = vec3(cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta); + // Transform from spherical coordinates to cartesian coordinates (halfway vector) + vec3 H = vec3(cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta); - // Transform from tangent space H vector to world space sample vector - vec3 up = ((abs(N.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0)); - vec3 tangent = normalize(cross(up, N)); - vec3 bitangent = cross(N, tangent); - vec3 sampleVec = tangent*H.x + bitangent*H.y + N*H.z; + // Transform from tangent space H vector to world space sample vector + vec3 up = ((abs(N.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0)); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + vec3 sampleVec = tangent*H.x + bitangent*H.y + N*H.z; - return normalize(sampleVec); + return normalize(sampleVec); } float GeometrySchlickGGX(float NdotV, float roughness) diff --git a/examples/models/resources/shaders/glsl330/prefilter.fs b/examples/models/resources/shaders/glsl330/prefilter.fs index 941ea86c..82f0f771 100644 --- a/examples/models/resources/shaders/glsl330/prefilter.fs +++ b/examples/models/resources/shaders/glsl330/prefilter.fs @@ -54,26 +54,26 @@ float RadicalInverse_VdC(uint bits) vec2 Hammersley(uint i, uint N) { - return vec2(float(i)/float(N), RadicalInverse_VdC(i)); + return vec2(float(i)/float(N), RadicalInverse_VdC(i)); } vec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness) { - float a = roughness*roughness; - float phi = 2.0*PI*Xi.x; - float cosTheta = sqrt((1.0 - Xi.y)/(1.0 + (a*a - 1.0)*Xi.y)); - float sinTheta = sqrt(1.0 - cosTheta*cosTheta); + float a = roughness*roughness; + float phi = 2.0*PI*Xi.x; + float cosTheta = sqrt((1.0 - Xi.y)/(1.0 + (a*a - 1.0)*Xi.y)); + float sinTheta = sqrt(1.0 - cosTheta*cosTheta); - // Transform from spherical coordinates to cartesian coordinates (halfway vector) - vec3 H = vec3(cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta); + // Transform from spherical coordinates to cartesian coordinates (halfway vector) + vec3 H = vec3(cos(phi)*sinTheta, sin(phi)*sinTheta, cosTheta); - // Transform from tangent space H vector to world space sample vector - vec3 up = ((abs(N.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0)); - vec3 tangent = normalize(cross(up, N)); - vec3 bitangent = cross(N, tangent); - vec3 sampleVec = tangent*H.x + bitangent*H.y + N*H.z; + // Transform from tangent space H vector to world space sample vector + vec3 up = ((abs(N.z) < 0.999) ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0)); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + vec3 sampleVec = tangent*H.x + bitangent*H.y + N*H.z; - return normalize(sampleVec); + return normalize(sampleVec); } void main() diff --git a/examples/models/resources/shaders/glsl330/skybox.fs b/examples/models/resources/shaders/glsl330/skybox.fs index c7a17883..dd8078e0 100644 --- a/examples/models/resources/shaders/glsl330/skybox.fs +++ b/examples/models/resources/shaders/glsl330/skybox.fs @@ -4,7 +4,7 @@ * * Copyright (c) 2017 Victor Fisac * -* 19-Jun-2020 - modified by Giuseppe Mastrangelo (@peppemas) - VFlip Support +* 19-Jun-2020 - modified by Giuseppe Mastrangelo (@peppemas) - VFlip Support * **********************************************************************************************/ |
