Search Unity

Rendering at a lower resolution

Discussion in 'Editor & General Support' started by jefequeso, Oct 17, 2013.

  1. jefequeso

    jefequeso

    Joined:
    Oct 16, 2013
    Posts:
    29
    I'm trying to get Unity to render at 320x240 but display at whatever resolution the player chooses. I found this thread:

    http://forum.unity3d.com/threads/15...-resolution-(separate-from-screen-resolution)

    Which seems to imply that I simply set the screen resolution. I can't really tell if its working or not. It renders at what appears to be 320x240, but I'm not sure if the actual resolution is any different.

    I also tried doing the same thing in a window, and found that the window size was directly tired to the resolution I set. In other words, the window was 320x240. When I allow the player to resize the window, the resolution seems to reset along with it. I.e, the larger the window is, the higher the resolution.

    So in other words, I'm not sure if the SetResolution command is working like I want. Does anyone know how I might check, and if it isn't working, how I could get Unity to render at a lower resolution than it displays?
     
    isaidkrankify likes this.
  2. jefequeso

    jefequeso

    Joined:
    Oct 16, 2013
    Posts:
    29
    I hate to bump a post, but I'd really appreciate some help with this.
     
    isaidkrankify likes this.
  3. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,657
    I suspect the feature in the linked thread is only actually available on mobile (or other devices where apps are forced to be fullscreen at a particular resolution). Which platform are you targeting?
     
  4. jefequeso

    jefequeso

    Joined:
    Oct 16, 2013
    Posts:
    29
    PC. It's really important that I can render at a low resolution for the art style I'm experimenting with.

    I also suspect that in full screen it's actually rendering at 640x480, but I know that it renders at 320x240 in a window. I just need a way to resize the window and keep that resolution :p. Or, get it to render at 320x240 in full screen I guess.
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    You'd need to use a rendertexture, where you render the camera to a 320x240 texture and display that as a full-screen texture. Keep in mind that 320x240 is a 4:3 aspect ratio, and widescreen is more typical these days.

    --Eric
     
  6. jefequeso

    jefequeso

    Joined:
    Oct 16, 2013
    Posts:
    29
    Do I need pro edition for that?
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
  8. jefequeso

    jefequeso

    Joined:
    Oct 16, 2013
    Posts:
    29
    araz01 likes this.
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Not that I know of, sorry.

    --Eric
     
  10. jefequeso

    jefequeso

    Joined:
    Oct 16, 2013
    Posts:
    29
    Drat. Ok, thanks anyway.
     
  11. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Is there code somewhere that demonstrates good practice for this?
     
  12. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    A GUITexture with scale set to 1, 1 and positioned at .5, .5 (with all texture inset values at 0) would work.

    --Eric
     
  13. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    That does work, and it actually is probably the easiest solution for several render textures on the same screen. But is there any method that doesn't require a second camera? Graphics.DrawTexture seems to not be reliable. Maybe I'm just not calling Graphics.Blit Graphics.DrawTexture at the right time. What "Messages" function is recommended?
     
    Last edited: Jan 20, 2014
  14. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    As far as I know you need a second camera.

    --Eric
     
  15. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Okay, thanks for the informed belief!

    I'll still need to know when to do the blitting, to make sure that the GUI Texture isn't updated a frame late. Maybe the water FX package will teach me. The documentation didn't answer this, and testing things out just froze my entire OS except for mouse movement, several times, so I'm not interested in experimenting anymore.