Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Camera over-render and cropping

Discussion in 'Image Effects' started by SozoDev, Sep 6, 2023.

  1. SozoDev

    SozoDev

    Joined:
    Nov 15, 2016
    Posts:
    18
    Hi all
    I'm not sure if the following is possible, but I want to crop and offset my rendered camera (not UI). One way I thought of possibly: Let's say I was aiming to display my game on a screen resolution of 1920x1080, I'd like to render to some wider resolution, for example 2500x1080 then be able to crop left or right depending on some variable in order to offset the rendered image center. I can't physically move the camera transform since then the scene will render from a different perspective, which is not what I want. I simply want to offset the image to the left or right. I tried changing the camera viewport but one can only go smaller than the target resolution, then the game view has empty spaces.
    Another option was playing with render textures but not sure if this will kill my performance...

    I hope it makes sense. Is this kind of thing doable?
     
  2. POOKSHANK

    POOKSHANK

    Joined:
    Feb 8, 2022
    Posts:
    73
    you can offset it by using the lens shift in the physical camera options
     
  3. SozoDev

    SozoDev

    Joined:
    Nov 15, 2016
    Posts:
    18
    mmm... It does work to some degree. It keeps the perspective the same but it also creates a type of rotation effect by distorting the rendered image. I might still use it if the distortion isn't too bad - will depend on my specific case once tested. Thanks for the tip.

    If anyone has other options, I'd still like to investigate those.