PixelCamera2D icon indicating copy to clipboard operation
PixelCamera2D copied to clipboard

No Camera is Rendering error

Open OptimusPi opened this issue 8 years ago • 5 comments

So I don't know how to use this. I'm new to Unity. But I gave up and wanted to leave a note so you know that it didn't work for me.

I followed the instructions on here and it created a RenderTexture. Cool. So now what?

It was my understanding that I attach that to the default camera under 'Target Texture' but nothing happens. It says No Camera is Rendering when I run my game. Obviously I'm missing something. If there is another step please update the readme so other people running into the pixel art problem with Unity can see it.

OptimusPi avatar Jan 11 '17 02:01 OptimusPi

So, I deleted the default camera and just have "PixelCamera2D" and I change the background color and that works. I change my X, Y, Z transform to be sensible (0, 0, -10) (But I tried several numbers and nothing works)

I did get pixel perfect to work using Orthographic size, for one set resolution, so oh well for now.

OptimusPi avatar Jan 11 '17 14:01 OptimusPi

I haven't used this in a while, but last time I did the instructions in the "Usage" section worked fine. It should create the render texture automatically when you press that button. It should attach it to your camera automatically so you shouldn't have to worry about that.

There's also a folder in the repo called PixelCamera2DDemo that should show you how things are set up. You do probably have to delete your default scene camera like you said above though.

RyanNielson avatar Jan 11 '17 14:01 RyanNielson

Right,t hat's exactly what I thought. But the demo doesn't have a main camera! :O

And when I set up the default camera to use the created PixelCamera2D.renderTexture, it showed "No cameras rendering"

I tried re-doing this over and over so not sure where I'm going wrong. I have just started my project so it's just an animation playing. I will try again with a fresh project perhaps. Thanks for the help.

OptimusPi avatar Jan 11 '17 14:01 OptimusPi

Any idea why one of the cameras has -99999 X -99999 Y ? That seemed off to me but I assumed it was a value not being used. I changed it to 0, 0 and it didn't help. :P

OptimusPi avatar Jan 11 '17 14:01 OptimusPi

This system uses 2 cameras and a quad to render your pixellated view.

  1. The camera named PixelCamera2D renders your scene to a render texture, and it should be the one that moves around, follows your player, etc. This would be your main camera. This render texture is then applied to a quad.

  2. The child camera named PixelCameraRenderer (the one at x -99999 and y -99999) is pointing at the quad and rendering it to your view. It's placed at that position just to get it out of the way so the quad isn't blocking your scene view and it doesn't get in to way of PixelCamera2D.

You can change the name of the PixelCamera2D game object to Main Camera if you want.

RyanNielson avatar Jan 11 '17 14:01 RyanNielson