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
0
Question by kx00 · Mar 22, 2013 at 09:25 AM · guitexturetargettexture

How do I correctly use a RenderTexture on a GUITexture?

I rendered a chat log in a GUITexture with a regular camera, cleared to black background color, and the text was crisp and clear. I moved on and set up a RenderTexture and textured a cube with the chat log, for some neat 3d effects, and the text showed up, allthough somewhat blurry but that's expected since I moved to a perspective view and the cube moves around. My solution to that problem was to find the "resting state" of the cube and when it was aligned i simply removed the cube and rendered a regular GUITexture with the same RenderTexture. As expected the chat log shows up but it is not as crisp and clear anymore.

I've tried to set up the connections both via the editor and in code. I've tried to set the size of the TargetTexture to match the dimensions of the screen, the nearest (rounded up) power of two and some test value to see the difference but I can't seem to find a solution.

Obviously one would think I should just render the original GUITexture directly and skip the TargetTexture alltogether but I really need this functionality, especially for cases where there's other things than a chat log that needs rendering.

Any guidance in this matter would be highly appreciated. I've search around the Answers section and other places on the interweb but can't seem to find a close enough match on my problem. Surely I'm just missing something simple but I just can't figure out what.

Thanks for your time folks!

(Here's a screenshot of the clear crisp text to the left and the TargetTexture connected one to the right.)

alt text

comparison.png (6.5 kB)
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
1

Answer by kx00 · Mar 27, 2013 at 04:01 PM

So, I found a way around the problem and thought I might share it in case someone should find it useful or would like to discuss it further (not that my problem has started a discussion but who knows, mayby it will ;)).

The way it works now is that when the cube stops spinning the cube is immediatly removed and its scale and translation is converted into normalized screen coordinates and applied to the rendering camera's 'rect' instead. If the chat needs to spin away again I simply reenable the cube, set the cameras render texture and start to rotate. This gives a somewhat blurry chat during transitions but a crisp and clear one when it's used.

Happy coding!

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

Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer

Texture height based on it width. 1 Answer

GUI 2D Bounding Box 1 Answer

GUI: How to "fill" a percentage of a texture? 1 Answer

How do you make guiTextures update their position upon a screen orientation change? 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