Pixels Per Unit and Image Pixels in Unity

Time:2024-6-19

Pixels Per Unit: how many pixels per Unity unit to display. Default is 100.

Pixels Per Unit and Image Pixels in Unity
A small grid in the picture is a unity unit

Camera’s size attribute

To understand ppu, you first need to understand thecamerathesizeProperties;
size: The vertical size of the camera view. The vertical size of the camera view.

Pixels Per Unit and Image Pixels in Unity
The size of the camera can be interpreted as the unity units from the center of the screen to the top and bottom respectively, when the size is set to 3, the screen can see 6 unity units from the top to the bottom (as shown in the picture above)

If an image has 1080 pixels and the ppu is the default 100, then we set the size to 5.4 to see the full content of the image.

PPU

Pixels Per Unit and Image Pixels in Unity
We use an image with 100×100 pixels and the ppu set to 100, at which point he will take up an entire unity unit.

Pixels Per Unit and Image Pixels in Unity
Results for ppu of 300

Pixels Per Unit and Image Pixels in Unity
Results for ppu of 50

It can be seen that when the image pixels remain constant, the visible size on the camera becomes smaller as ppu increases and larger as ppu decreases; but a larger image will make the graph look fuzzy.

We can get the formula

unity units = image pixels / ppu

Recommended Today

[MySQL]: DDL Database Definitions and Operations

Article Catalog preamble I. Classification of SQL II. DDL database operations 2.1 Query all databases 2.2 Querying the current database 2.3 Creation of databases 2.4 Deletion of databases 2.5 Switching databases 3. DDL table operations 3.1 Query Creation 3.2 Data types 3.3 Modifications 3.4 Delete . Full Summary preamble SQL is a powerful language that […]