Jump to content
  • Advertisement
Sign in to follow this  
kazemi

Cylindrical Projection

This topic is 2435 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

Hi

My Question is basically how can I implement a cylindrical projection matrix with pixel/vertex shader in Direct3D? I want to achieve the effect of a full 180 degree camera which seems impossible with standard projection.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Cylindrical projection is not a linear map, and cannot be represented with a matrix. You can still perform the projection using appropriate trigonometric formulas in vertex shader or pixel shader.

Note that because it is not linear, if you perform the projection in the vertex shader, you will receive rendering artifacts, since the attributes from vertices are linearly interpolated for each rasterized pixel, and because cylindrical projection is not linear, the linear interpolation will cause distortion. One way to minimize this distortion is to tessellate your input vertex data to a sufficiently fine detail, so that the triangle sizes are appropriately small. If you want pixel-precise projection, you will have to do it in a pixel shader, which can be expensive.

Share this post


Link to post
Share on other sites
The distortion that clb is talking about is actually a function of how large a triangle is in screen space after the cylindrical projection. If you have a very large triangle, then it will perhaps have some distortion associated with it.

However, unless you have lots of large triangles in your scene, or if you have triangles that pass very close to your cylinder axis, then you may not notice any artifacts. You should try it out and then decide afterward if there is a need to impose higher tessellation on your scene.

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!