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 Cheekorobbins · Jan 24, 2012 at 12:51 PM · shadertextureperformancetransparencytexture-atlas

Transparency and texture atlases, shader calls affecting performance?

Hi,

I have a texture atlas which is being used for an entire level environment of an iphone game, part of that environment are trees that use transparency for the leaves. I'm trying to weigh up the performance of having less textures or less shaders on meshes.

Am I better off keeping the textures that require transparency separate from the main atlas to avoid all the other textures being slowed down by the transparency shader?

Or should I keep them all together on one atlas as the transparency shader won't affect performance on all the other textures?

Thanks.

Comment
Add comment · Show 1
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 syclamoth · Jan 24, 2012 at 12:53 PM 0
Share

Split them.

2 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by Cheekorobbins · Jan 24, 2012 at 04:50 PM

Okay, thanks.

What do you mean when you 'move the masks from the alpha channel, to somewhere else.'

Do you mean create a separate png/other image file just for the mask as a black and white image?

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 Jessy · Jan 24, 2012 at 04:52 PM 0
Share

This is not an answer.

avatar image
0

Answer by Jessy · Jan 24, 2012 at 02:56 PM

Fewer textures is better. Here's what to be concerned about for the present, though: you can't use good-looking compression on images with an alpha channel, with PVRTC. (Unity 3.5 calls this the "Best" setting.) As such, I'd either split the RGBA from the RGB, so you can use better compression on the RGB areas, or, you can move the masks from the alpha channel, to somewhere else. I've personally been using the latter, with the mask in all three channels, on the RGB atlas. The result is outstanding.

Edit - You asked about "somewhere else". It could be its own image. Obviously an 8-bit mask is going to give you the best results (unless you started with an even higher depth mask, but Unity doesn't facilitate working with that yet), but it could be RGB, or any one subset of those, and that will allow for compression. You just need to pull from the right place, in your shader. There is a hit for swizzling lowp vectors on the SGX, but it's worth it for this, and you can sort of get around it by dotting the .rgb of the texture with some vec3 constant, and moving that to the alpha channel, which seems to be cheaper than moving from one RGB channel to any other channel. If you can use the same offset for all of your masks, then you can avoid having to use a 2nd UV set, for batching.

Like I said, I've used the mask in all three channels, so the result is greyscale, but I haven't checked to see if just using one channel would change the quality.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Making a cutout semi-transparent? 1 Answer

Is there a shader that will give me a range of transparencies for an unlit texture? 2 Answers

How do I blend or overlay a texture over the main texture? 1 Answer

Most efficient shader - Default/Sprite or Mobile/AlphaBlended ? 1 Answer

How can i shader transparent Objects together? 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