Answers for "Shader MVP matrices: what does vertex position mean at each step?"
http://answers.unity.com/questions/462253/shader-mvp-matrices-what-does-vertex-position-mean.html
The latest answers for the question "Shader MVP matrices: what does vertex position mean at each step?"Answer by darktemplar216
http://answers.unity.com/answers/1015802/view.html
the answer is wrong.
after v = p*v*m*v0, v.x is not[-1, 1], v.y is not[-1, 1]![alt text][1]
[1]: /storage/temp/51066-qq图片20150727181046.jpg
the grey area is[-1, 1]
I use o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); o.vertex as color to do the experimentMon, 27 Jul 2015 11:05:37 GMTdarktemplar216Answer by Boris S.
http://answers.unity.com/answers/834963/view.html
I am learning transformations too and have found a strange issue. After applying MVP transformation in vertex shader I expect to get vertex coordinates in [-1;1] range, but it is true only for orthographic camera. With perspective camera it is not true. I do not know what exactly values I get, but they are much bigger than 1. Could anyone please explain me why it happens?Tue, 18 Nov 2014 17:33:37 GMTBoris S.Answer by Owen-Reynolds
http://answers.unity.com/answers/462305/view.html
OpenGL stuff (like the graphics "Red Book") do a pretty good job explaining that stuff. It's standard -- nothing to do with Unity.
Initial are the raw model coords, straight from the modelling program. Can be anything, but obviously should be touching/surrounding 000. The tip of an animated orc's nose is always (0,3,0.4) for every orc, every frame.
After MV is "world units" in the camera's local coordinate system. The same as `Cam.main.InverseTransform(P);`. If the camera is 10 meters away facing you, it will be (0,0,-10) (at some step, negative Z is in front of you.)
P accounts for the view angle and converts to generic viewPort as you say. Depending on the system that's often -1 to 1 (so 00 is centered.) Hardware will convert to pixels. The same way, is now "normalized" depth.
---
Standard way to make something the same size at depth is to set the matrix not to shrink it. In Unity, it's simpler to just make a 2nd Ortho camera (which makes the matrix you wanted.) For depth doing funny stuff, should be able to have the vert shader check Z (in meters) or distance(xyz), also in meters, after the MV step.Fri, 24 May 2013 01:45:40 GMTOwen-Reynolds