- Home /
Is it possible to only render specific pixels?
Is it possible to only render specific pixels or area of a camera?
The area that I want to render can be any convex shape and changes with every frame. Furthermore, I don't want to distort the image of change the perspective. I just want to render a particular section of the camera rectangle.
Any Ideas would be greatly appreciated :)
You could probably do this by creating a custom shader. You can read the camera world position and direction in it and translate it to the viewing frustum. From this you can calculate the area of the displaying pixels. Then you can hide all vertices that are outside of this area. Dont have source code ready though. Alternatively you can use the camera Api to get the viewing area and only pass the edge points into your shader. this will be simpler
As the other person said this could be achieved with a shader. Though depending on what you actually are trying to do, it might be possible to do with some clever camera work and some render textures and layer masks. Could you give a bit more information? Perhaps some screenshots.
Answer by Blooper64 · Jan 09, 2019 at 10:03 PM
In the Camera Inspector there is View-port Rect you can change the values to change the size of the screen, Is this what you needed?
No, unfortunately this doesn't work for me as it changes the rendered perspective.