Orthographic size

Unity3D 2019. 4. 17. 09:27
반응형

https://indiehoodgames.wordpress.com/2013/07/27/pixel-perfect-calculator-for-orthographic-camera-unity3d/

 

Pixel Perfect Calculator for Orthographic Camera : Unity3D

It’s pretty easy to setup an Orthographic Camera in Unity, but without paying attention the settings can cause us numerous problems when it comes to sprites, textures and the quest for pixel …

indiehoodgames.wordpress.com

Orthographic size means how many units in world space the viewport half height is. So when you set Orthographic size to 5.8, it simply means that for example a cube placed at coordinates (0f, 5.8f) has it's pivot point aligned with the top of the screen (bottom half of it should be visible because the pivot is in the middle by default)

 

The camera will always show that same amount of world units on the screen height-wise regardless of resolution. So if you look at the game on a 200x100 pixel screen, Unity will try to render exactly the same part of the game world on the screen with a 400x200 screen. The picture will just be more detailed because the device has a better resolution.

 

Depending on the device's screen aspect ratio, the visible world area WIDTH can change and can be calculated based on the orthographic size and device resolution

 

직교 크기는 월드 공간에서 뷰포트 절반 높이의 단위 수를 의미합니다. 그래서 Orthographic 크기를 5.8로 설정하면, 예를 들어 좌표 (0f, 5.8f)에 배치 된 큐브가 화면의 상단과 일치하는 피벗 점을 갖게됩니다 (피벗이 화면의 맨 아래에 표시되어야합니다). 기본적으로 중간)

 

카메라는 해상도에 관계없이 화면에 항상 같은 양의 세계 단위를 표시합니다. 따라서 200x100 픽셀 화면에서 게임을 보면 유니티는 400x200 화면으로 게임 세계의 똑같은 부분을 정확하게 렌더링하려고합니다. 장치가 더 나은 해상도를 가지고 있기 때문에 그림이 더 자세하게 나타납니다.

 

장치의 화면 종횡비에 따라 보이는 세계 영역의 너비가 변경 될 수 있으며 직교 크기 및 장치 해상도를 기반으로 계산할 수 있습니다

 

Pixel Perfect Calculator for Orthographic Camera : Unity3D

It’s pretty easy to setup an Orthographic Camera in Unity, but without paying attention the settings can cause u..

indiehoodgames.wordpress.com

 


https://forum.unity.com/threads/orthographic-camera-size-multiple-resolutions-iphone.327723/?gq=Orthographic%20size%20

 

Orthographic size dictates how much the camera sees vertically in World Space units (not screen pixel resolution). So if you set it to 5, it means, you can move your character 10 units (transform.position.y) from top the bottom. You should pick a value that is meaningful to you so when you code your movement/placement, it makes sense. Think board/match-3 games. The width, in world space, is determined by the aspect ratio.

 

This world space is then projected onto a physical screen where its resolution in independent of this ortho size. That means, for iPhone 6+ in landscape, 10 world space units is mapped to 1080 pixels. This gives 108 pixels per world space unit.

 

The engine then determines how much world space a sprite should occupy by looking at the sprite's texture resolution and the PixelsPerUnit settings. If you set the PixelsPerUnit to 64, on a sprite with resolution of 64x64, then the engine will render 64 pixels per world space unit , effectively taking 1 unit. If the texture is 128x128, it will take 2 world space units (on each dimension) to render it. This effectively means, the engine is rendering 64 pixels of texture in 108 screen pixels (following the iPhone6 example above).

 

So the golden question that most people ask is, how to make my game pixel perfect? The task is just ensuring that the number of pixels of textures that gets rendered per world space units matches the number of hardware screen pixels per world space units. You can do this by tweaking the PixelsPerUnit, Orthosize and texture resolution.

 

 

 

직교 크기는 카메라가 월드 스페이스 단위로 (화면 픽셀 해상도가 아닌) 세로로 표시되는 정도를 나타냅니다. 따라서 5로 설정하면 캐릭터 10 단위 (transform.position.y)를 아래에서 위로 이동할 수 있습니다. 의미있는 가치를 선택해야하므로 운동 / 게재 위치를 코딩 할 때 의미가 있습니다. 보드 / 매치 3 게임을 생각해보십시오. 월드 공간에서 너비는 가로 세로 비율에 따라 결정됩니다.

 

이 월드 공간은이 정사각형 크기와는 독립적 인 해상도로 실제 화면에 투사됩니다. 다시 말해서, 풍경에있는 iPhone 6+의 경우 10 개의 세계 공간 단위가 1080 픽셀로 매핑됩니다. 이것은 세계 공간 단위당 108 픽셀을 제공합니다.

 

그런 다음 엔진은 스프라이트의 텍스처 해상도와 PixelsPerUnit 설정을보고 스프라이트가 차지할 공간을 결정합니다. 해상도가 64x64 인 스프라이트에서 PixelsPerUnit을 64로 설정하면 엔진이 월드 공간 단위당 64 픽셀을 렌더링하여 효과적으로 1 단위를 렌더링합니다. 텍스처가 128x128이라면 렌더링을 위해 2 차원 공간 단위 (각 차원에서)가 필요합니다. 이것은 효과적으로, 엔진이 108 스크린 픽셀 (위의 iPhone6 ​​예제에 따라)에서 64 픽셀의 텍스처를 렌더링한다는 것을 의미합니다.

 

대부분의 사람들이 물어 보는 황금 질문은 게임 픽셀을 완벽하게 만드는 방법입니다. 이 작업은 월드 공간 단위당 렌더링되는 텍스처의 픽셀 수를 월드 공간 단위당 하드웨어 화면 픽셀 수와 일치시키는 것입니다. PixelsPerUnit, Orthosize 및 텍스처 해상도를 조정하여이 작업을 수행 할 수 있습니다.

 

https://answers.unity.com/questions/168156/screen-vs-viewport-what-is-the-difference.html

반응형

'Unity3D' 카테고리의 다른 글

Quaternion.LookRotation  (0) 2019.04.23
(unity) find child recursively  (1) 2019.04.21
How Unity Supports Cross Platform Feature  (0) 2019.03.20
C# 컴파일 그리고 il2cpp  (0) 2019.03.07
JsonUtility  (0) 2019.03.07
: