-
Notifications
You must be signed in to change notification settings - Fork 54
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
9 changed files
with
88 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
!!cvarf ffov | ||
!!samps screen:samplerCube=0 | ||
|
||
//panini view rendering, for high fovs that are still playable. | ||
|
||
#ifdef VERTEX_SHADER | ||
attribute vec2 v_texcoord; | ||
varying vec2 texcoord; | ||
uniform float cvar_ffov; | ||
void main() | ||
{ | ||
texcoord = v_texcoord.xy; | ||
|
||
//make sure the ffov cvar actually does something meaningful | ||
texcoord *= cvar_ffov / 90.0; | ||
|
||
gl_Position = ftetransform(); | ||
} | ||
#endif | ||
#ifdef FRAGMENT_SHADER | ||
varying vec2 texcoord; | ||
void main() | ||
{ | ||
vec3 tc; | ||
vec2 d; | ||
vec2 ang; | ||
d = texcoord; | ||
|
||
//compute the 2d->3d projection | ||
float div = 1.0 + d.x*d.x + d.y*d.y; | ||
tc.x = 2.0*d.x/div; | ||
tc.y = -d.y; | ||
tc.z = -(-1.0 + d.x*d.x + d.y*d.y)/div; | ||
|
||
gl_FragColor = textureCube(s_screen, tc); | ||
} | ||
#endif |
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