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 oliver-jones · Nov 26, 2010 at 06:20 PM · cameraguitexturerendergui-window

Apply Render Texture To GUI + Transparency?

Hello,

I have made a texture render that I have applied to a camera in my scene. I was wondering if its possible to add this texture to a GUI window so I can get a little display window in my GUI, so I get a result like this (top left):

alt text

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by IJM · Nov 27, 2010 at 12:23 AM

I recomend using 32bit bitmaps with alpha channel. In general 24bit bitmpas (Something like Windows BMP or JPG) have Red,Gren and Blue (aka RGB) per each pixel, wich means that they can only suport opaque color. With 32bit you are getting 8 bits more per each pixel, and you can save transparency for it in range from 0.0 to 1.0. (0.0 is min, 0.5 is in the middle and 1.0 max) You can create such bitmpas easily with tools like GIMP or Photoshop. I recommand saving your bitmaps to TGA or PNG format. (Unity supports both)

p.s.

32bit bitmaps with alpha channel are also know as RGBA

p.p.s. U can use google.com for more on bitmaps ;)

Comment
Add comment · Show 2 · 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
avatar image oliver-jones · Nov 27, 2010 at 12:29 AM 0
Share

But its not really a texture I'm applying, its a camera view using the Render Texture that I have applied to a camera within my scene ...

avatar image IJM · Nov 27, 2010 at 11:07 AM 0
Share

In Unity GUI works like a state machine, if you call GUI.color = new Color( 1,1,1, 0.5f); before GUI.DrawTexture that will set your alpha to 0.5f, you will need to call GUI.color = new Color( 1,1,1,1); after it to reset the alpha to 1.

avatar image
2

Answer by oliver-jones · Nov 26, 2010 at 06:47 PM

Managed to get it to work. I used this in the GUI function:

GUI.DrawTexture(Rect(Screen.width - 300, Screen.height - 300,260,260), TurretCamera, ScaleMode.StretchToFill, false, 30.0f);

How would I apply a slight transparency to it?

Comment
Add comment · Show 1 · 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
avatar image Molix · Nov 27, 2010 at 02:47 AM 1
Share

You should be able to just put GUI.color = new Color( 1,1,1, 0.5f); in front of the DrawTexture.

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

No one has followed this question yet.

Related Questions

Can i render a camera to a gui texture? 1 Answer

Help with cameras and enabling/disabling GUItextures? 1 Answer

Making GUI Buttons on a GUI Texture 1 Answer

White line along the edge 2 Answers

My GUI elements are not rendering on top of all cameras. Any ideas why? 1 Answer


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