Jump to content
  • Advertisement
Sign in to follow this  
pilula4life

DirectX: How to unwrap the cube map array texture into a cylinder panorama.

This topic is 1425 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

When you render a quad with UV coordinates (0,0) top left to (1,1) bottom right you can render your cubemap as a cylinder panorama with a pixel shader like this:

[source]

float4 PS(VS_OUTPUT input): SV_Target{

 

float heading=input.tex.x*cPI*2;
float pitch=cPI*0.5-input.tex.y*cPI;

 

float3 ReflectionVector;
ReflectionVector.x=sin(heading)*cos(pitch);
ReflectionVector.y=sin(pitch);
ReflectionVector.z=cos(heading)*cos(pitch);

 

return MyTexture0.Sample(MySampler0, ReflectionVector);
}

[/source]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!