{"id":13663161,"url":"https://github.com/SubjectNerd-Unity/UnityPixelCamera","last_synced_at":"2025-04-25T13:32:03.858Z","repository":{"id":74329250,"uuid":"83544911","full_name":"SubjectNerd-Unity/UnityPixelCamera","owner":"SubjectNerd-Unity","description":"A resolution independent pixel perfect camera for Unity","archived":false,"fork":false,"pushed_at":"2017-03-03T09:06:10.000Z","size":27,"stargazers_count":120,"open_issues_count":1,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-09T00:04:19.469Z","etag":null,"topics":["pixel-art","unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SubjectNerd-Unity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-01T10:58:43.000Z","updated_at":"2025-03-01T15:05:55.000Z","dependencies_parsed_at":"2024-01-17T05:50:02.069Z","dependency_job_id":"c28596ed-11be-435d-bf8d-cf8e777e823f","html_url":"https://github.com/SubjectNerd-Unity/UnityPixelCamera","commit_stats":null,"previous_names":["chemikhazi/unitypixelcamera"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubjectNerd-Unity%2FUnityPixelCamera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubjectNerd-Unity%2FUnityPixelCamera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubjectNerd-Unity%2FUnityPixelCamera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubjectNerd-Unity%2FUnityPixelCamera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SubjectNerd-Unity","download_url":"https://codeload.github.com/SubjectNerd-Unity/UnityPixelCamera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250825021,"owners_count":21493379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pixel-art","unity","unity3d"],"created_at":"2024-08-02T05:02:19.588Z","updated_at":"2025-04-25T13:31:58.779Z","avatar_url":"https://github.com/SubjectNerd-Unity.png","language":"C#","readme":"# Unity Pixel Camera\n\nA resolution independent pixel perfect camera for Unity.\n\nThis 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.\n\n## Features ##\n\n* Simple setup\n* Experimental perspective camera support\n\n*Standard unity camera*\n\n![Standard camera](http://i.imgur.com/pye9clh.gif)\n\n*Pixel perfect camera*\n\n![Pixel camera](http://i.imgur.com/VKhQrfu.gif)\n\n## Installation ##\n\nClone the repository or download the UnityPackage of the [latest release](https://github.com/ChemiKhazi/UnityPixelCamera/releases/latest). The `PixelCamera` directory can be moved to your location of choice in your unity project.\n\n## Basic Usage ##\n\n1. Attach the `Pixel Camera` script to an existing camera.\n2. Set `Pixels Per Unit` to an appropriate value, usually matching the settings used for your assets.\n3. Set the `Zoom Level` for the camera.\n\n## Advanced Settings ##\n\n* __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.\n* __Aspect Stretch__ - Apply a stretch to the output, allows the display to be non square pixels.\n* __Down Sample__ - Scales down the render resolution, making the output blockier.\n* __Perspective Z__ - Only for perspective cameras. The Z distance between the near and far clip planes, that is rendered as pixel perfect.\n\n## Caveats ##\n\n* If a camera or sprite is out of alignment with the pixel grid, unwanted artifacts may occur.\n* Pixel Camera will not automatically zoom in or out according to the window/viewport size.\n* Camera `Viewport Rect` settings are not taken into account.\n\n## Perspective Camera Notes ##\n* A zoom level below 1 will leave a border on the edge of the screen.\n* Perspective camera is unoptimized. A high `Field of View` setting will generate unreasonably large RenderTextures. Use with caution.\n\n## Technical Details ##\n\nPixel 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.\n\nA `RenderTexture` of the calculated render size is created, and if needed the camera settings are modified so the render fits the calculated size.\n\nThe camera output is sent to the `RenderTexture`.\n\nA 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.\n\n## API ##\n\n### Properties ###\n\n__ZoomLevel__ : float\n\nThe pixel zoom scale used by the camera.\n\n__PixelsPerUnit__ : float\n\nThe pixels per unit value used by the camera.\n\n__CameraMaterial__ : Material\n\nThe Material used to render the camera output, setting to `null` will use the default material. Pixel Camera sets the camera output as the `_MainTex` texture of the given material.\n\n__AspectStretch__ : Vector2\n\nAn additional stretch applied to the camera, allows camera to render as non square pixels.\n\n__DownSample__ : float\n\nScales down the render resolution, makes the output blockier. Minimum value is clamped at 1.\n\n__PerspectiveZ__ : float\n\nWith a perspective camera, the distance between the camera near and far planes that is rendered as pixel perfect. Value is clamped between the near and far plane values.\n\n__RenderTexture__ : RenderTexture, read only\n\nAccess the RenderTexture used as the camera output.\n\n__CameraSize__ : int[], read only\n\nActual pixel size of the camera, as an integer array.\n\n### Methods ###\n\n__ForceRefresh()__ : void\n\nForce the camera to recalculate rendering sizes.\n\n__CheckCamera()__ : bool\n\nChecks camera settings. If different from the last camera settings used, camera will be setup again. Returns `true` when settings have changed.\n","funding_links":[],"categories":["C\\#","Camera"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSubjectNerd-Unity%2FUnityPixelCamera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSubjectNerd-Unity%2FUnityPixelCamera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSubjectNerd-Unity%2FUnityPixelCamera/lists"}