A Bit about Projection Matrix Transformation


This little post will talk about how the W component of a vector4 is transformed in the Graphic Pipeline, starting from Model Space and ending in the Screen Space Coordinates.

In Model Space (even in World Space =P) the W component does not exists, it is can be seen as a facility to represent vectors and points in a similar way. A vector (like normal) will have the W component as 0 and a point (like position) will have it as 1.
After you transform the input (points and vectors — normal, positions, tangents ….) into the view space, the W component will remains 1 or 0 and the Z will contains the distance between the actual point (vector does not have a physical position) to the 0,0,0 (the camera).
When you transform the previous values to projection space, then the W component will contains exactely what the Z component of the view space contained.
That is:

positionAfterProjection = mul(positionViewSpace, ProjectionMatrix);

now positionAfterProjection .w = positionViewSpace.z

We can say that positionAfterProjection is now in “homogenous clip space”.

Between the vertex and pixel shader the GPU will perform a what is called “homogenous divide” that is:

positionAfterProjection /= positionAfterProjection .w

And now we are in the “normalized device coordinate space” where W is 1.

which (in DirectX conventions) is:

  • -1 to +1 for X and Y
  • 0 to 1 for Z

(top left = (-1, 1,0) and bottom right = (1, -1, 0) in near plane =P, the far plane will be with Z instead of 0)

Finally the ViewPort information is used to transform from normalized Device Coordiantes space into Screen Space (top left = (0, 0) bottom right = (width, height) — yes, now is 2D … you cant retrive this in pixel shaders, what we do is to put the position in a texture register and recovers it in pixel shader, then we have to manually make the division by the W component)

Perspective projection matrix is “strange” until you realize that it is doing 3 separate things:

– perspective
– non-linear mapping of view space Z to unit Z (the scary stuff)
– scaling into Normalized Device Coordinates space

Thats all for today =P

  1. #1 by consumer reports auto insurance on 24 de março de 2017 - 5:53 pm

    My hat is off to your astute command over this topic-bravo!

  2. #2 by geico.com on 24 de março de 2017 - 6:00 pm

    Thanks for great info that truthfully benefit checking renewed concepts. The best possibility to receive rates is free process which provides the cheapest offers for auto insurance policies from good known agent like American family from the United States.

  3. #3 by jasa pengacara perceraian on 24 de março de 2017 - 6:03 pm

    With havin so much written content do you ever run into any issues of plagorism or copyright violation? My website has a lot of completely unique content I’ve either written myself or outsourced but it looks like a lot of it is popping it up all over the web without my authorization. Do you know any methods to help prevent content from being stolen? I’d truly appreciate it.

  4. #4 by http://www.whatsyouroldbrooklyn.com/car-insurance-gonzales-la.html on 24 de março de 2017 - 6:37 pm

    Gee whiz, and I thought this would be hard to find out.

  5. #5 by http://www.tier1graphicsusa.com/worst-cars-for-insurance.html on 24 de março de 2017 - 6:40 pm

    That’s really shrewd! Good to see the logic set out so well.

  6. #6 by http://www.studioy.us/selling-insurance-policy.html on 24 de março de 2017 - 6:42 pm

    At last, someone comes up with the “right” answer!

  7. #7 by car insurance in byram ms on 24 de março de 2017 - 7:22 pm

    ekilibr dit :Peut-on ne pas utiliser tous les outils à notre disposition pour enseigner ? Les jeunes s’informent par tous les moyens, il ne faudrait pas que le corps enseignant ait un train de retard sur la technologie.

  8. #8 by how old do you have to be to get car insurance in ct on 24 de março de 2017 - 7:32 pm

    A wonderful job. Super helpful information.

  9. #9 by car insurance for indiana on 24 de março de 2017 - 7:38 pm

    It’s a joy to find someone who can think like that

  10. #10 by http://news.christianlouboutinoutlet.win/christianlouboutinoutletwin/171.asp on 24 de março de 2017 - 7:41 pm

    We have bought your brand of bracelet a few occasions. Every single a person is very adorable, done well, cannot tarnish and/or important depending on which a single you purchase as well as that one award they and.

  11. #11 by Augusto de Arruda Botelho on 24 de março de 2017 - 7:48 pm

    Nice post. I learn something new and challenging on sites I stumbleupon every day.
    It will always be exciting to read through articles from other writers
    and use something from other websites.

  12. #12 by Download HPE0-J76 Certification Dumps on 24 de março de 2017 - 7:50 pm

    always a significant fan of linking to bloggers that I adore but do not get lots of link love from

  13. #13 by navigate to these guys on 24 de março de 2017 - 7:59 pm

    It really is the best opportunity to create some intentions for the near future. I have looked over this blog entry and if I can possibly, I desire to recommend you number of interesting advice.

  14. #14 by coreast on 24 de março de 2017 - 8:01 pm

    学校や企業のPCにもお勧めできるレベルの軽快さ。  一つ一つ、クラブに合わせて振るなんて、やっぱり 確実性が落ちるのは当たり前か・・・打ってて気にならないシャフトは、5UTと3W。 [url=http://forum.urbanlyrics.com/read.php?1,28068,28068#msg-28068]windows 7 アップデート[/url]
    一度JPexamの74-343試験情報を使用すると、きっと二度目を使用したいです。 ●システムモードシステムモードはH9のBluetooth、バイパス、Auxスイッチ、MIDI、グローバル、チューナー、ユーティリティ等、システム全体の設定を行います。
    [url=http://spione.adept-press.com/forum/comments.php?DiscussionID=23152]office2016 メディア 購入[/url] Pass4Testはあなたの成功を保証することができます。 D. ホストウェブにゕ プリから CSS フゔ゗ルをコピーします。
    [url=http://mixzing.freeforums.org/windows10-t92875.html]office2016 メディア 購入[/url]
     ・液晶:10.1型WXGAグレア液晶(1280×800)   まあまあの画面のきれいさか。 第18条 大統領・副大統領は、任期9年とし、全国民の一人一票の投票によってそれぞれ最大の得票を得たものが選ばれる。 [url=http://countrymusic.forumfree.org/index.php?&act=ST&f=1&t=1140]office 2013 通販[/url]
    また、SEMやTEMのような試料の前処理は不要である。 ですから逆の立場ということを思いつつ少しでも旅人に優しい店は目指して行きたい。
    [url=http://scpoenvironnement.forumcrea.com/viewtopic.php?pid=37396#p37396]windows 7 の ダウンロード[/url] E. fabrikam.com ドメ゗ンの受信コネクタを作成します。 ソールが滑るのか?簡単にヘッドが抜けるから、トップやダフリの心配が無い?元々SWのトップはボール手前にヘッドが入ると薄い芝だと下の土で跳ね返されてリーディングエッジが浮いて、ボールにまともに当たるからトップするので有って、LWはそのまま振り切れれるので、芝を滑ってロフト通りに球が当たる気がする。
    [url=http://support.punbb-hosting.com/viewtopic.php?pid=24794#p24794]office2016 の プロダクト キー[/url]

  15. #15 by http://www.evolutionhairdressers.com/how-can-i-check-who-my-car-is-insured-with.html on 24 de março de 2017 - 8:01 pm

    Que bonito contratestemunho essa troca de elogios. Prato cheio dos anticristãos virem acusar os católicos de não saberem moderar a língua. E, infelizmente, aqui teríamos que lhes dar razão nesse caso.Tristíssimo. Deus nos ajude.

  16. #16 by car insurance new braunfels on 24 de março de 2017 - 8:09 pm

    I appreciate you taking to time to contribute That’s very helpful.

  17. #17 by auto insurance zero down on 24 de março de 2017 - 8:10 pm

    I am thrilled beyond belief to have found yer blog… What an inspiration these gals are… Not to forget they are the owners of some amazing vintage stuff.. I'm here whenever you post. Mind if I brag you on my blog..?

  18. #18 by http://www.warburtongallery.com/hair-salon-liability-insurance.html on 24 de março de 2017 - 8:14 pm

    Articles like this just make me want to visit your website even more.

  19. #19 by Gemma on 24 de março de 2017 - 8:17 pm

    Hi, I do think this is an excellent web site.
    I stumbledupon it 😉 I will revisit once again since I saved as a favorite it.

    Money and freedom is the greatest way to change, may you
    be rich and continue to help other people.

  20. #20 by Tourism on 24 de março de 2017 - 8:36 pm

    Wow! This could be one particular of the most helpful blogs We have ever arrive across on this subject. Actually Excellent. I am also a specialist in this topic so I can understand your effort.

  21. #21 by http://www.yosemitesoap.com/ on 24 de março de 2017 - 8:54 pm

    Great article but it didn’t have everything-I didn’t find the kitchen sink!

  22. #22 by yeezy boost 750 for sale on 24 de março de 2017 - 9:00 pm

1 705 706 707
(não será publicado)