Difference between Screen & Viewport Space

+2 votes
asked Apr 11, 2015 in Unity 3D by Gleny Student (480 points)
retagged Apr 11, 2015 by Gleny
Hello. I have read it a thousand times but not really get the differnece between screen space and viewport space. Is there any difference at all? I mean these are both on the near clipping plane of the camera?!

Any clarification would be much appreciated!

1 Answer

+2 votes
answered Apr 12, 2015 by Bugstacker Senior (4,800 points)
selected Apr 13, 2015 by Gleny
 
Best answer

You are right both spaces are related to the camera's near clipping palne. The near clipping plane is basically your screen. 

The difference between those two is the range of values.

Screen Space

The range in both directions [x, y] is equals to the render target's (screen) resolution [width, height]. Due the fact that the render resolution is variable, this space is not appropriate for e.g. GUI positioning. This is where the viewport space comes into play.

Viewport Space

The range in both directions [x, y] is normalized to [0, 0] <-> [1, 1]. Each coordinate is basically a percentage value and therefore resolution-independent. Per example GUI elements should be positioned and dimensioned in this space.

commented Apr 13, 2015 by Gleny Student (480 points)
Ok! Thanks for the clarification! Now I got it!
Welcome to Bugstacker Q&A, where you can ask questions concerning Game Development, Programming and Design and receive answers from other members of the community.

Help for

...