Advertisement Jump to content
Sign in to follow this  
obhi

Perspective projection: Intersection length between light and view

This topic is 1877 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,

 

I have always wondered on this, may be i am missing something very simple, in the perspective shadow map calculation from the paper: http://www.cs.berkeley.edu/~ravir/6160-fall04/papers/p557-stamminger.pdf

 

In section 1.1, it mentions that when a ray bundle from shadow map hits the surface at a distance rs with an angle substended at alpha, and the shadow map pixel width is ds, the lenght of the surface hit is equal to approximately: dsrs/(cos(alpha).

 

How do we arrive at this derivition?

 

Any help is much appreciated.

 

Thanks,

obhi

Share this post


Link to post
Share on other sites
Advertisement

The ds * rs part is the inverse square law. Here you are only considering the width and not the whole area, so it increases linearly with distance as you would expect (if you stare at an object through a camera at a distance D and see it records a length of X pixels, then walk back to a distance 2D, its length will have decreased to X/2 pixels).

 

479px-Inverse_square_law.svg.png

 

The cosine division part is basically the cosine law in action:

 

fig6-3.gif

 

So as the angle approaches 90 (grazing) the perceived length gets smaller and smaller. So if you start with a ray bundle that hits a surface with an perceived width of ds, the true length is going to get larger as the angle tends to grazing (here think of ds as the width of the blue beam). Of course if you are looking at it at normal incidence, then its true length is the same as its perceived length, and cos(alpha) = 1 as expected.

Share this post


Link to post
Share on other sites

So at 2D the lenght becomes X/2, which means a the surface pixel count should be (for rs units) rs*ds. And the blue line: d*cos(theta) = percieved length = rs*ds (from inverse sq).. Thanks a lot :)

Share this post


Link to post
Share on other sites

So at 2D the lenght becomes X/2, which means a the surface pixel count should be (for rs units) rs*ds. And the blue line: d*cos(theta) = percieved length = rs*ds (from inverse sq).. Thanks a lot smile.png

 

Yes, that's right (sorry for the typo, it's late smile.png - fixed)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!