Skip to content

Instantly share code, notes, and snippets.

@yomotsu
Last active August 29, 2015 13:56
Show Gist options
  • Save yomotsu/9203275 to your computer and use it in GitHub Desktop.
Save yomotsu/9203275 to your computer and use it in GitHub Desktop.
uniform vec2 u_resolution;
// 1
// +-----+-----+
// | | |
// -ar +-----+-----+ ar
// | | |
// +-----+-----+
// -1
float aspectRatio = u_resolution.x / u_resolution.y;
vec2 uv = ( gl_FragCoord.xy * 2.0 - u_resolution ) / u_resolution.y;
---
`a / b` を `b / a` にする(分子と分母を入れ替える)
b / a == (a / b) / pow( sqrt( a / b, 2 ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment