-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
96 additions
and
3 deletions.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
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,45 @@ | ||
#version 400 core | ||
|
||
layout(location = 0) in vec3 coordinates; | ||
layout(location = 1) in vec2 textureCoordinates; | ||
|
||
out vec2 pass_textureCoordinates; | ||
|
||
vec4 Distort(vec4 p, float BarrelPower) { | ||
float CALIBRATION2 = -0.068731; | ||
float paramA = -0.007715; | ||
float paramC = -0.25; | ||
float paramD = 1.0 - paramA - CALIBRATION2 - paramC; | ||
|
||
|
||
vec2 v = p.xy / p.w; | ||
// Convert to polar coords: | ||
float radius = length(v); | ||
if (radius > 0) { | ||
float theta = atan(v.y, v.x); | ||
|
||
// Distort: | ||
radius = (paramA * radius * radius * radius + CALIBRATION2 * radius * radius + paramC * radius + paramD) | ||
* radius * 0.77; | ||
|
||
// Convert back to Cartesian: | ||
v.x = radius * cos(theta); | ||
v.y = radius * sin(theta); | ||
p.xy = v.xy * p.w; | ||
} | ||
return p; | ||
} | ||
|
||
void main() { | ||
vec4 P = vec4(coordinates, 1); | ||
P.x += 0.45; | ||
|
||
vec4 newPos = Distort(P, 0.9); | ||
newPos.x -= 0.5; | ||
//newPos.y += 0.03; | ||
|
||
newPos.x += 0.03; | ||
|
||
gl_Position = newPos; | ||
pass_textureCoordinates = textureCoordinates; | ||
} |
Empty file.
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,45 @@ | ||
#version 400 core | ||
|
||
layout(location = 0) in vec3 coordinates; | ||
layout(location = 1) in vec2 textureCoordinates; | ||
|
||
out vec2 pass_textureCoordinates; | ||
|
||
vec4 Distort(vec4 p, float BarrelPower) { | ||
float CALIBRATION2 = -0.068731; | ||
float paramA = -0.007715; | ||
float paramC = -0.25; | ||
float paramD = 1.0 - paramA - CALIBRATION2 - paramC; | ||
|
||
|
||
vec2 v = p.xy / p.w; | ||
// Convert to polar coords: | ||
float radius = length(v); | ||
if (radius > 0) { | ||
float theta = atan(v.y, v.x); | ||
|
||
// Distort: | ||
radius = (paramA * radius * radius * radius + CALIBRATION2 * radius * radius + paramC * radius + paramD) | ||
* radius * 0.77; | ||
|
||
// Convert back to Cartesian: | ||
v.x = radius * cos(theta); | ||
v.y = radius * sin(theta); | ||
p.xy = v.xy * p.w; | ||
} | ||
return p; | ||
} | ||
|
||
void main() { | ||
vec4 P = vec4(coordinates, 1); | ||
P.x -= 0.45; | ||
|
||
vec4 newPos = Distort(P, 0.9); | ||
newPos.x += 0.5; | ||
//newPos.y += 0.03; | ||
|
||
newPos.x += 0.03; | ||
|
||
gl_Position = newPos; | ||
pass_textureCoordinates = textureCoordinates; | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
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
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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
Empty file.
Empty file.