Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Ante · Mar 27, 2013 at 07:10 PM · camerascreen resolutionrender texture

Rendering at a smaller resolution?

I'm working on a version of my game to display on an older arcade monitor running at 240p, which is half 480p on both dimensions. However, I cannot seem to get Unity to use anything lower then 480p, even when trying to manually set the resolution in a script after setting up my video card to scale to 240p. Has anyone figured out a way to do this? Anyway, that's not my major issue right now; it's resolution scaling.

If I can't get it to run at 240p, I'd like to be able to upscale a 240p render texture and display it at whichever resolution the game is running at. I was able to get this working in the editor, but when I try to run it in a build, everything is just black. While running fraps, the fps counter draws over itself like the whole thing isn't refreshing or something. Anyone have any ideas? Here is my code that works in the editor:

     #pragma strict
     var renderSizeX : int = 320;
     var renderSizeY : int = 240;
     var renderTex : RenderTexture;
     function Start () {
         renderTex = RenderTexture(renderSizeX,renderSizeY,24,RenderTextureFormat.Default);
         renderTex.filterMode=FilterMode.Point;
         renderTex.Create();
         camera.targetTexture=renderTex;
     }
     
     function Update () {
     
     }
     function OnGUI() {
         if(renderTex){
             GUI.BeginGroup (Rect (0, 0, Screen.width,Screen.height));
             GUI.DrawTexture(Rect(0,0,Screen.width,Screen.height),renderTex);
             GUI.EndGroup ();
         }
     }
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Ante · Mar 28, 2013 at 05:54 PM

To answer my own question, it seems that the stand alone behaves differently, only rendering either to the render texture or to the screen while the editor renders to both. To fix this, I put all of my GUI elements on another layer, created a new camera, and set the culling mask to not show those GUI elements. GUI.DrawTexture still displayed the render texture on the new camera. If it draws it on a specific layer, my guess would be that it draws on the layer of the object it's attached to.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Render Texture strange noise error 1 Answer

Camera Render to texture not showing alpha in build, but does in editor playmode 3 Answers

How do I take a screenshot from a headless server build? 0 Answers

Stop Camera Size and GUI Position Displaying Differently on Different Resolutions 1 Answer

Render to Texture player's path 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges