Created
August 21, 2015 11:47
-
-
Save yorung/9c7f8184d886f9a76ad2 to your computer and use it in GitHub Desktop.
Stereographic projection(Little Planet)
This file contains hidden or 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
| float4 mainPS(VsToPs inp) : SV_Target | |
| { | |
| float2 scale = float2(4.0f / 3.0f, 1) * 3; // scale & aspect ratio | |
| float2 plane = inp.screenPos.xy * scale; | |
| float3 dir = float3(plane.x * 2, plane.y * 2, -1 + dot(plane, plane)) / (1 + dot(plane, plane)); | |
| return texCube.Sample(samplerState, dir.xzy); // y is upper | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment