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

Started by
0 comments, last by ErnstH 9 years, 5 months ago

I have a cube map array texture. I need to get one image like here http://paulbourke.net/miscellaneous/sphericalpano/ . I don't have any idea how unwrap my cube texture like in a cylinder panorama, for example. Maby some tutorial or algorythm. Will be wery glad. In directx10.

Thnks.

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]

This topic is closed to new replies.

Advertisement