-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a bunch of files that i forgot before... oops
- Loading branch information
Showing
16 changed files
with
38,435 additions
and
211 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# This file uses centimeters as units for non-parametric coordinates. | ||
|
||
mtllib unitCube.mtl | ||
g default | ||
v -0.500000 -0.500000 0.500000 | ||
v 0.500000 -0.500000 0.500000 | ||
v -0.500000 0.500000 0.500000 | ||
v 0.500000 0.500000 0.500000 | ||
v -0.500000 0.500000 -0.500000 | ||
v 0.500000 0.500000 -0.500000 | ||
v -0.500000 -0.500000 -0.500000 | ||
v 0.500000 -0.500000 -0.500000 | ||
vt 0.375000 0.000000 | ||
vt 0.625000 0.000000 | ||
vt 0.375000 0.250000 | ||
vt 0.625000 0.250000 | ||
vt 0.375000 0.500000 | ||
vt 0.625000 0.500000 | ||
vt 0.375000 0.750000 | ||
vt 0.625000 0.750000 | ||
vt 0.375000 1.000000 | ||
vt 0.625000 1.000000 | ||
vt 0.875000 0.000000 | ||
vt 0.875000 0.250000 | ||
vt 0.125000 0.000000 | ||
vt 0.125000 0.250000 | ||
vn 0.000000 0.000000 1.000000 | ||
vn 0.000000 0.000000 1.000000 | ||
vn 0.000000 0.000000 1.000000 | ||
vn 0.000000 0.000000 1.000000 | ||
vn 0.000000 1.000000 0.000000 | ||
vn 0.000000 1.000000 0.000000 | ||
vn 0.000000 1.000000 0.000000 | ||
vn 0.000000 1.000000 0.000000 | ||
vn 0.000000 0.000000 -1.000000 | ||
vn 0.000000 0.000000 -1.000000 | ||
vn 0.000000 0.000000 -1.000000 | ||
vn 0.000000 0.000000 -1.000000 | ||
vn 0.000000 -1.000000 0.000000 | ||
vn 0.000000 -1.000000 0.000000 | ||
vn 0.000000 -1.000000 0.000000 | ||
vn 0.000000 -1.000000 0.000000 | ||
vn 1.000000 0.000000 0.000000 | ||
vn 1.000000 0.000000 0.000000 | ||
vn 1.000000 0.000000 0.000000 | ||
vn 1.000000 0.000000 0.000000 | ||
vn -1.000000 0.000000 0.000000 | ||
vn -1.000000 0.000000 0.000000 | ||
vn -1.000000 0.000000 0.000000 | ||
vn -1.000000 0.000000 0.000000 | ||
s off | ||
g pCube1 | ||
usemtl initialShadingGroup | ||
f 1/1/1 2/2/2 4/4/3 3/3/4 | ||
f 3/3/5 4/4/6 6/6/7 5/5/8 | ||
f 5/5/9 6/6/10 8/8/11 7/7/12 | ||
f 7/7/13 8/8/14 2/10/15 1/9/16 | ||
f 2/2/17 8/11/18 6/12/19 4/4/20 | ||
f 7/13/21 1/1/22 3/3/23 5/14/24 |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"Name" : "HDR_cubemap", | ||
"Vertex" : "shaders/hdr_cubemap_vert.glsl", | ||
"Fragment" : "shaders/hdr_cubemap_frag.glsl" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"Name" : "HDR_cubemap_irradiance", | ||
"Vertex" : "shaders/hdr_cubemap_vert.glsl", | ||
"Fragment" : "shaders/hdr_cubemap_irradiance_frag.glsl" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#version 410 core | ||
|
||
layout(location=0) out vec4 FragColor; | ||
in vec3 localPos; | ||
|
||
uniform sampler2D sphereMap; | ||
|
||
const vec2 invAtan = vec2(0.1591, 0.3183); | ||
vec2 SampleSphericalMap(vec3 v) | ||
{ | ||
vec2 uv = vec2(atan(v.z, v.x), asin(v.y)); | ||
uv *= invAtan; | ||
uv += 0.5; | ||
return uv; | ||
} | ||
|
||
void main() | ||
{ | ||
vec2 uv = SampleSphericalMap(normalize(localPos)); // make sure to normalize localPos | ||
vec3 color = texture(sphereMap, uv).rgb; | ||
|
||
FragColor = vec4(color, 1.0); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#version 410 core | ||
|
||
layout(location=0) out vec4 FragColor; | ||
in vec3 localPos; | ||
|
||
uniform samplerCube envMap; | ||
|
||
const float PI = 3.14159265359; | ||
|
||
void main() | ||
{ | ||
// The world vector acts as the normal of a tangent surface | ||
// from the origin, aligned to WorldPos. Given this normal, calculate all | ||
// incoming radiance of the environment. The result of this radiance | ||
// is the radiance of light coming from -Normal direction, which is what | ||
// we use in the PBR shader to sample irradiance. | ||
vec3 N = normalize(localPos); | ||
|
||
vec3 irradiance = vec3(0.0); | ||
|
||
// tangent space calculation from origin point | ||
vec3 up = vec3(0.0, 1.0, 0.0); | ||
vec3 right = cross(up, N); | ||
up = cross(N, right); | ||
|
||
float sampleDelta = 0.025; | ||
float nrSamples = 0.0; | ||
for(float phi = 0.0; phi < 2.0 * PI; phi += sampleDelta) | ||
{ | ||
for(float theta = 0.0; theta < 0.5 * PI; theta += sampleDelta) | ||
{ | ||
// spherical to cartesian (in tangent space) | ||
vec3 tangentSample = vec3(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)); | ||
// tangent space to world | ||
vec3 sampleVec = tangentSample.x * right + tangentSample.y * up + tangentSample.z * N; | ||
|
||
irradiance += texture(envMap, sampleVec).rgb * cos(theta) * sin(theta); | ||
nrSamples++; | ||
} | ||
} | ||
irradiance = PI * irradiance * (1.0 / float(nrSamples)); | ||
|
||
FragColor = vec4(irradiance, 1.0); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#version 410 core | ||
|
||
layout (location = 0) in vec3 inVert; | ||
|
||
out vec3 localPos; | ||
|
||
uniform mat4 view; | ||
uniform mat4 projection; | ||
|
||
void main() | ||
{ | ||
localPos = inVert; | ||
gl_Position = projection * view * vec4(localPos, 1.0); | ||
} |
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.