Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 darthtelle · Jul 29, 2015 at 11:19 AM · shaderspritetransparentrender texture

Render Texture causing sprite transparency errors

The game I am currently working on requires the GUI to be rendered within a safe frame of the screen. We're being constrained to using Unity 4.3 so are unable to make use of the new Unity GUI features, so instead we are using Render Textures to display the GUI and then scale the textures depending on percentage of safe frame required.

Any object/sprite/texture we want rendered as the GUI are assigned a specific "render texture" layer which is then used on one camera which renders its output to a texture. This camera is set to "Solid Colour" with the colour being (0, 0, 0, 0). The generated render texture is then assigned a material where the shader is set to "Transparent/Diffuse" and applied to a cube object. Finally, this cube is rendered on another specific "display render texture" layer and is used by a camera which is set to "Depth only".

alt text alt text

But we're having issues where sprites which have transparency on them are burning holes through to what should be an opaque background behind them (see attached images). All the sprites use the "Sprites-Default" shader and their colours are (generally) (255, 255, 255, 255). Is there a different shader we should be using to prevent the sprite transparency from affecting the sprite behind it?

rendertexture-1.png (284.9 kB)
rendertexture-0.png (315.2 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
0

Answer by Douvantzis · May 16, 2016 at 01:47 PM

This appears as a blending problem on the alpha channel.

You need to adjust the blending mode applied to the alpha channel when you render your sprites on the renderTexture or when you render the renderTexture on screen.

You can read more about this problem in my question.

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

22 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unlit Speed tree Bilboard shader 0 Answers

Making a color transparent in shaders 1 Answer

3D Custom Render Texture 0 Answers

About shader! 0 Answers

Unity Fog Shader with Alpha 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