Git Product home page Git Product logo

2d-pixel-perfect's Introduction

2D Pixel Perfect

This repository contains samples of the 2D Pixel Perfect features to be used with Unity 2018.2b3 and newer.

Getting Started

Get the Unity Editor

To get started, download and install the latest Unity 2018.2 beta, here: https://unity3d.com/unity/beta-download

Get the Package

These samples already include the necessary manifest in the Packages folder of the project. If you want to activate these features in another project, you may use the Package Manager.

Find out more about packages here: Unity Package Manager

Preview Feature Documentation

❗️❗️❗️ Warning ❗️❗️❗️

Project backward compatibility between Preview versions is NOT GUARANTEED. Always backup your project before updating the package. Preview features here are not production ready, please DO NOT use this package for your final production. Preview features may be discontinued/dropped.

2d-pixel-perfect's People

Contributors

darrenquek avatar rainsing avatar rus-unity avatar sam-unity avatar unitypaul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

2d-pixel-perfect's Issues

Texture upscaling is not compatible with PostProcessingStack v2

When using a PostProcessLayer and this script in the same Camera, the resulting image will be blurry when using the upscale texture feature.
Disabling either the volume or this script makes the image normal again.

Is this known? I'll create a reproduction project soon and attach it here later.


Exact steps to reproduce

  • add PostProcess layer and Pixel Perfect components to the camera
  • enable texture upscaling
  • set the GameView to an exact multiple of the reference resolution set on the Pixel Perfect component

Notes

  • there's no active effect in the PostProcess layer, just the bare component.
  • All sprites are 100 pixels per unit
  • changing the reference resolution to 2px smaller temporarily fixes the issue (at the cost of 1px borders around the game view). But, as soon as you change the pixels per meter to anything, it goes back to being blurry

Blurry

blurry

Normal

normal

Settings

screenshot 2018 08 09-07 08 14

Extra info

Using

  • latest Post Processing Stack (2.0.10)

  • latest Pixel Perfect component (1.0.1)

  • Unity 2018.2.1f1

Upscaling causes pixelated text

I have some text that is part of the world (an example would be damage numbers). However, when I upscale render textures, it's incredibly blurry and pixelated no matter the settings of the text and canvas components. I've had to disable upscaling to get readable text. Pixel Snapping also causes jittery camera movements so that also had to be disabled.

What's going on here?

Is development for this project still going?

This project has not had any public contributions since late August? Does this mean it is now being managed internally and will be deployed as part of the Unity client? I am not sure how to interpret quiet Unity repos.

Upscale AND pixel snapping?

Why are upscaling and pixel snapping mutually exclusive settings?

My workaround is using pixel perfect camera component for snapping, and custom render-to-texture for upscaling.

The goal for me is recreating the effect of rendering to a low-resolution screen, by both "pixel snap" to a discrete grid (e.g. 5x5 real pixels) AND upscale so that nothing smaller than a 5x5 block is rendered.
Note: the importance of using both is that pixel snap prevents or minimises "averaging" across the discrete grid, e.g. 5x5 pixels, which happens when upscaling.

Really appreciate this awesome asset, by the way! Great work so far. Sorry for so much text.

Camera does not use Culling Mask

The way our scene is setup is we have 2 cameras: one that does the world, and one that does the UI.
We have the world camera set to use the Pixel Perfect, and it has its Culling Mask to render everything but our UI, since we do not want our UI to be Pixel Perfect.

We have found an issue that even though our Pixel Perfect camera is not set to render our UI, it still effects our UI, causing it to be Pixel Perfect, therefore making it render blurry.

With Pixel Perfect:
pp1

Without Pixel Perfect:
pp2

The UI is on a different layer and is only Rendered by its own Camera, and therefore should not be effected by the "Pixel Perfect."

Usage with Cinemachine

It would be nice, if the pixel perfect camera could be used with Cinemachine's Virtual Camera.

Stretching pixel-perfect viewport by 1.2 vertically?

I'm looking through PixelPerfectCameraInternal trying to find the right place to stretch the viewport height by 1.2, so effectively every pixel appears to be 1/5 taller than it is wide, to emulate the old 320x200 to 320x240 CRT aspect ratio correction. I understand the viewport will render outside of the screen, which is fine since I'll be designing everything to fit in the section that is within the screen. Which part of the script/class should I modify to allow this? Here's an example:
image
The left is square pixels, the middle is what would happen if the rendertexture at the reference size were stretched, and the right image is what would happen if the upscaled rendertexture were stretched. You end up with nice, 1:1.2 width/height pixels, whereby the width of the pixel is the same, but the height is now 1.2, as it has been stretched after the upscale, which is allowing this.

2 Camera setup -- "Upscale Render Texture" w/ Culling Mask above Basic 3D Camera

See the images:

Disabled "Upscale Render Texture":
issue_pixel1
Enabled "Upscale Render Texture":
issue_pixel2

Bomberman is on a Layer named "PIXELS" and I am trying to display him (using the "Upscale Render Texture" feature) downsampled on top of the standard 3D camera rendering.
The Layer named "PIXELS" is excluded from the standard camera's rendering so that it appears on top.
The only object on that layer is Bomberman, but I want him downsampled and upscaled back to the way he was (prior to being downsampled).

I want to be able to use the pixelated rendering of the 3D object as an overlay on the normal 3d background.

The problem is that the BACKGROUND camera (PixelCamera_BG) is not returned to its original perspective settings (or something?) -- meaning the background camera is not displayed in the correct perspective suddenly when "Upscale Render Texture" is enabled. When this is disabled, I get the BG in the correct perspective, but no downsampled pixels.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.