Skip to content

Commit a3e89e4

Browse files
committed
Updated readme.
1 parent 654796e commit a3e89e4

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ A resolution independent pixel perfect camera for Unity.
44

55
This package simplifies making a Unity camera render to exact pixel units, for use with pixel art or similar art styles where blockiness is part of the aesthetic.
66

7+
## Features ##
8+
9+
* Simple setup
10+
* Perspective camera support
11+
712
*Standard unity camera*
813

914
![Standard camera](http://i.imgur.com/pye9clh.gif)
@@ -14,25 +19,28 @@ This package simplifies making a Unity camera render to exact pixel units, for u
1419

1520
## Basic Usage ##
1621

17-
1. Attach the Pixel Camera script to an orthographic camera.
18-
2. Set the Pixels Per Unit to an appropriate value, usually matching the settings used for your assets.
19-
3. Set the Zoom Level for the camera.
22+
1. Attach the `Pixel Camera` script to an existing camera.
23+
2. Set `Pixels Per Unit` to an appropriate value, usually matching the settings used for your assets.
24+
3. Set the `Zoom Level` for the camera.
2025

21-
## Advanced Usage ##
26+
## Advanced Settings ##
2227

23-
* Camera Material - allows a shader to be applied on the camera output. The script sets the camera output as the `_MainTex` of the material.
24-
* Aspect Stretch - apply a custom stretch to the output, allowing your assets to be displayed in non square pixels.
28+
* __Camera Material__ - A material applied to the camera output, allows shaders to modify the image. The camera output is set as the `_MainTex` of the material.
29+
* __Aspect Stretch__ - Apply a stretch to the output, allowing the display to be non square pixels.
30+
* __Perspective Z__ - Only for perspective cameras. The Z distance from the camera that is rendered as pixel perfect.
2531

2632
## Caveats ##
2733

28-
* If a camera or sprite is out of alignment with the pixel grid, unwanted artifacts may occur
29-
* Pixel Camera will not automatically zoom in or out according to the window/viewport size
34+
* If a camera or sprite is out of alignment with the pixel grid, unwanted artifacts may occur.
35+
* Pixel Camera will not automatically zoom in or out according to the window/viewport size.
36+
* Camera `Viewport Rect` settings are not taken into account.
37+
* With a perspective camera, zoom levels below 1 will render a black border.
3038

3139
## Technical Details ##
3240

33-
Pixel camera takes the size of the screen and finds the pixel size required to cover the entire screen at the given settings.
41+
Pixel camera takes the size of the screen and finds the render size required to cover the screen in a pixel perfect manner, at the given settings.
3442

35-
The camera orthographic size is modified so that the render fits the calculated size, and the output is sent to a RenderTexture.
43+
A `RenderTexture` of the calculated render size is created, and if needed the camera settings are modified so the render fits the calculated size. The camera output is sent to the `RenderTexture`.
3644

3745
A dummy camera that renders nothing is created, and the `OnPostRender()` function is used to draw the output of the attached camera onto the screen using GL commands.
3846

@@ -56,11 +64,15 @@ __AspectStretch__ : Vector2
5664

5765
An additional stretch applied to the camera, allows camera to render as non square pixels.
5866

59-
__RenderTexture__ : RenderTexture
67+
__PerspectiveZ__ : float
68+
69+
With a perspective camera, the distance from the camera that is rendered as pixel perfect.
70+
71+
__RenderTexture__ : RenderTexture, read only
6072

6173
Access to the RenderTexture used as the camera output.
6274

63-
__CameraSize__ : int[]
75+
__CameraSize__ : int[], read only
6476

6577
Actual pixel size of the camera, as an integer array.
6678

0 commit comments

Comments
 (0)