Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stretching pixel-perfect viewport by 1.2 vertically? #7

Open
elvisish opened this issue Sep 12, 2018 · 1 comment
Open

Stretching pixel-perfect viewport by 1.2 vertically? #7

elvisish opened this issue Sep 12, 2018 · 1 comment

Comments

@elvisish
Copy link

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.

@elvisish
Copy link
Author

elvisish commented Dec 1, 2018

I'm still trying to figure this out. Camera mainCamera = GetComponent<Camera>(); mainCamera.aspect = mainCamera.pixelRect.width / (mainCamera.pixelRect.height * 1.2f);
doesnt work, if i try this in start, it appears within the viewport rather than exceeding the screen height as it should, creating mushed looking pixels. if i put it in update, the screen keeps squashing until it disappears to black
anyone that knows about this, i'd be very grateful for any help; ive been trying on and off with this for three months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant