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 Jackey · Aug 04, 2010 at 02:53 AM · texturerendertransparent

Something about Render Texture Transparent..

I want to use a second camera to draw my character into a render texture. And whatever I set the background colorsI always get the texture that is my character with white background colors. How can I set my background colors to be transparent,and only show my character in the texture, which for my the GUI Showing. Thanks! And Sorry for my poor English!

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
4

Answer by qJake · Aug 04, 2010 at 04:33 AM

I think you want to set the Clear Flags of the RT Camera to not clear everything. This should only make it draw your character, and not the background, too.

Clear Flags
Each Camera stores color and depth information when it renders its view. The portions of the screen that are not drawn in are empty, and will display the skybox by default. When you are using multiple Cameras, each one stores its own color and depth information in buffers, accumulating more data as each Camera renders. As any particular Camera in your scene renders its view, you can set the Clear Flags to clear different collections of the buffer information.

http://unity3d.com/support/documentation/Components/class-Camera.html

Comment
Add comment · Show 5 · 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 Jackey · Aug 04, 2010 at 06:57 AM 0
Share

Thanks SpikeX. There are only 4 options of clear flags I can select. Do you mean the "Don't clear" Flag?

avatar image qJake Jackey · Aug 04, 2010 at 08:15 AM 0
Share

Whichever one works for you, if there's only four it's not hard to test.

avatar image Barrett-Fox · Jul 07, 2011 at 12:45 AM 1
Share

So I'm attempting exactly the same thing. I'm trying all settings of the Clear Flags field but none are removing the background from my render texture. If I set the alpha value of the render camera's background color, I can only make the entire texture, including objects the cam is rendering, uniformly transparent.

If I use the "Depth Only" setting, I get garbage in the render texture during playback.

Have done thorough searching on Answers and Forum but not finding anything helpful.

avatar image Velcrohead Barrett-Fox · Jul 31, 2016 at 05:47 PM 1
Share

Did you ever find a solution for this?

I'm in the same situation myself right now.

avatar image Cogniad Velcrohead · Feb 09, 2019 at 03:27 AM 0
Share

This may not help you now, but it may help someone else.

I turned off HDR and it made it work, though the texture was a little blurry. Not sure how that works, but it gave me the effect I needed.

avatar image
2

Answer by Waz · Jul 07, 2011 at 01:43 AM

I've had problems with this and one issue is that some shaders have a Colormask of RGB only, not RGBA. Certainly you need to start with clear flags of SolidColor and the color having alpha of zero.

In my specific case, I also rendered my camera twice, once with a custom replacement shader that only wrote to alpha channel, but you might not need this, depending what shaders you are already using.

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 Barrett-Fox · Jul 07, 2011 at 07:21 PM 0
Share

But if you happen to be using the render texture in a GUItexture, then you're stuck with whatever the Clear Flags options give you, right?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Rendering issue on iPhone 1 Answer

Trees in distance show as black without texture 1 Answer

Generating UVs for a scripted mesh 4 Answers

Tiled GPU perf warning? 1 Answer

transparent texture problem 3 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