Jump to content
  • Advertisement
Sign in to follow this  
Viik

Turn cubemap into paraboloid

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

For one particluar project I want to precalculate shadow maps. There will be a lot of light sources, most of them will be a hemisperical\spot lights. So for shadow maps I need to use cubemaps or paraboloids. Regardles of mapping I'm planning to put all of them into single or maybe several shadow map atlases.
I've used atlasses paraboloids before, it works quite well, but the main issue is the tesselation of the scene.
This time, as I don't need them to be completetly realitme I've decided to go with following appoach:
- take first light's position and render scene depth from it into a cubemap
- render relevant portion of the cubemap (only half of the spere is needed) into a part of atlas as paraboloid.
Nice thing that during sampling from cubemap into paraboloid I can do a small filtering for ESM or VSM. Another bonus is that I won't have troubles with a a low teselation of the scene. The only issue is how to get such mapping. Basically I need to take each texel of paraboloid shadow map and calculate where it should point into cubemap, taking into account that direction of the paraboloid inside cubemap is arbitrary, that's where I've stuck. Appretiate any ideas.

Share this post


Link to post
Share on other sites
Advertisement
This should be the reverse problem as accessing a normal paraboloid map. Normally you have a normal vector, then convert that into texture coordinates to access the paraboloid map. So you should just be able to do the opposite operations, which will produce two possible vectors - one pointing in each hemisphere. Since you know which paraboloid you are trying to fill, you should be able to toss out the incorrect vector.

Have you tried it out yet, or are you still in the design phase?

Share this post


Link to post
Share on other sites
Just a design, will be implementing in following days. Had an quite simple idea, let's say I'll have one parabaloid size of 256x256, basically I can render tangent normal map of the sphere exactly matching 512x512 texture. That would give me 4 texels of paraboloid normals for taking 4 samples from cubemap for each texel of paraboloid atlas.

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!