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 Zyar · May 25, 2014 at 01:39 PM · transparent-texture

PNG's with Translucency, and Optimization

Hi everyone, I've been working on optimization for my levels but I'm a bit confused about translucency. One common tactic I've noticed in games is to reduce what could be a complex model into a single surface.

An example from Dishonored:

alt text

I've seen countless examples of this in games, but what I don't understand is why the textures never appear to have anti aliasing, leaving very rough edges between the solid and the transparent like in the example above.

Here's a grass texture I found:

alt text

This one has a translucent edge and looks much better. Is there a reason that the pixels of the PNG should only be at 100% opaque or 0% opaque and that anything between would slow things down? I have tested this myself in Unity and I see no performance difference between either method. But if this is the case, than why do so many games do this? Is there a reason I should be avoiding translucency when using PNGs like this? I would really appreciate any suggestions.

Comment
Add comment · Show 2
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 Fornoreason1000 · May 25, 2014 at 01:46 PM 0
Share

The reduction to a single surface is called Bill boarding, nice question BTW. $$anonymous$$y guess is that the opacity bits would be encoded as 1 or 0 ins$$anonymous$$d of 0.66857524631524 which is easier to process.

avatar image Owen-Reynolds · May 25, 2014 at 07:55 PM 0
Share

An obvious sharp border between opaque and transparent probably means they're using sub meshes. As to why -- maybe Unreal just makes that way easier to do.

And, of course, overlapping partly transparent objects can be tricky.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by supernat · May 26, 2014 at 05:32 AM

In shaders (this goes back to the original fixed function pipeline design), you have two options with regard to alpha: 1) reject a pixel with an alpha value less than some threshold (Alpha Testing) (which is what you see) or 2) blend the alpha with the background. By design, the 1st is much faster (it used to be anyway), because you don't have to perform any blending. The pixel in the non-opaque areas is just immediately tossed out and the color buffer remains with the last color. When you alternatively use the 2nd approach, you have to blend all of the texture, so even places with zero opacity will take a hit, and the actual blending itself is a bit heavy. They don't specifically call this out as the reason on this linked page, but I think they are doing a two pass render to optimize the speed: https://docs.unity3d.com/Documentation/Components/SL-AlphaTest.html

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

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

Related Questions

How do I soften the edges of a transparent Plane texture 1 Answer

Mobile shader with transparent rendering mode 1 Answer

How to use Transparent Material ? 0 Answers

How to make a part of a texture transparent? 0 Answers

Problems with Textures 2 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