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 Filippopotamus · Jul 25, 2012 at 07:42 PM · cameraiosbackgroundeffectsefficiency

Most efficient way to darken the screen?

I want to do a simple dark backdrop of the screen. For example, if the pause menu of the game is gonna appear, I want to darken the screen and then show the pause menu. I understand that there are multiple ways of doing this, and I know how to do the ways I am aware of (such as (1) using camera effects, (2) using a black GUITexture in front of the camera and managing its alpha channel, and (3) playing with the lighting of the scene).

My game is completely light-free, so option (3) is out. Which one ((1) or (2), or any other method I have not mentioned) is the most efficient for a mobile platform like iOS? I'm concerned about all that alpha blending on every pixel of the screen.

Any thoughts? Thanks in advance!

Cheers!

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

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Meltdown · Jul 25, 2012 at 07:46 PM

Instantiating a black GUITexture or even a textured 1x1 plane in front of the rest of the menu is pretty efficient. Although for a pause menu I wouldn't be too worried about performance.

You could even have two cameras, one for your game, one for your pause menu, and only render those respective layers on each camera, so you simply disable one camera, and enable the other.

Comment
Add comment · Show 4 · 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 Filippopotamus · Jul 25, 2012 at 07:49 PM 0
Share

Thanks for the quick reply! :) Can you elaborate a bit more on the 1x1 plane idea?

avatar image Meltdown · Jul 25, 2012 at 07:55 PM 1
Share

There is a create plane script here from his most esteemed Sir $$anonymous$$ichael Garforth.. http://unifycommunity.com/wiki/index.php?title=CreatePlane

Basically the default Unity plane has an excessive amount of polygons, this lets you create a 1x1 plane mesh to use in Unity for your plains where you don't need the detail.

You can put it on its own layer, with its own camera, and wrap it all up into a prefab.

avatar image Filippopotamus · Jul 25, 2012 at 07:57 PM 0
Share

Thanks for the tip! Is it more efficient to have it on its own layer/camera? What would be the benefits over just using it on my UI camera or main camera?

avatar image AlucardJay · Jul 25, 2012 at 08:03 PM 0
Share

also on the UnifyCommunity 'site, there are lots of useful scripts, some being GUITexture Faders :

From our very own Eric : http://unifycommunity.com/wiki/index.php?title=Fade

and : http://unifycommunity.com/wiki/index.php?title=FadeIn

one more : http://unifycommunity.com/wiki/index.php?title=FadeInOut

avatar image
2

Answer by Mortoc · Jul 25, 2012 at 07:52 PM

The most efficient way would be to use option 2 (GUITexture with alpha across the screen) for a single frame, setting the camera to not clear out the display buffer and then disable rendering of everything else in the scene. If you need the pause menu to be interactive, you would copy the screen to a render texture and use that texture as the background instead (this would require Unity Pro).

This is most likely overkill, just putting a simple GUITexture over the screen should run just fine.

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 Filippopotamus · Jul 25, 2012 at 07:55 PM 0
Share

I do have Unity Pro. But I have never used RenderTextures. I have some reading to do. Thanks for the help!

avatar image Meltdown · Jul 25, 2012 at 08:01 PM 1
Share

I wouldn't suggest using Render Textures for this. a) because it requires PRO and b.) Using two cameras on two different layers is more diverse, and you can wrap up each screen and camera in a prefab quite easily and make good re-use of it.

avatar image
0

Answer by chantey · Aug 19, 2018 at 10:12 AM

I found using an Image on a canvas stretched across the screen was quite an easy way to do this.

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

9 People are following this question.

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

Related Questions

Multiple post processing profiles? 2 Answers

Camera layering with post processing? 0 Answers

Call a Function When App Exits 4 Answers

Keep network connection from interrupting on iOS multitasking switch 1 Answer

(C#)Changing Camera Background Via Code 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