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 sean · Apr 11, 2011 at 02:57 PM · guishaderimage-effects

Image-Effect Shading the GUI?

Anyone who has seen the sorts of questions I post here already knows I do some pathologically creative things to the render pipeline, even if I do them for good reason. As it turns out, I have a special case on my hands where it would be VERY useful to me to be able to apply a postprocessing shader to the GUI. Is there any way to do this? I do realize I could just convert my whole GUI to 3D billboards, but a) that would be a pain, and b) I need pixel-perfect alignment and image processing, and the transparent layering of multiple camera buffers with different postprocessors, so I'd need to do a bit more fine-tuning than just the second render. So if there's a solution which doesn't get that tangled, I'd love to hear it.

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 AngryOldMan · Apr 11, 2011 at 03:03 PM 0
Share

Could you try an overlay layer for your image much the same as photoshop? Eg add your image effect to another GUI layer then adjust it's alpha level til you get the shading you want.

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by taoa · Apr 13, 2011 at 10:25 AM

I assume you're talking about making use of Unity GUI. One thing important to know about it is that anything rendered from within an OnGUI function will ALWAYS be rendered last in the scene.

Take a look at this page that shows in what order things are rendered in Unity: http://www.unifycommunity.com/wiki/index.php?title=Event_Execution_Order

As you can see, anything GUI is very very last. Even if you have two cameras where one is drawn before the other.

So you can forget about considering Image Effects on your GUI, since those are for scripts attached to the camera and will be executed before any GUI is rendered.

One hope may be to draw a GUI element that would cover your entire screen and draw it using a custom material/shader, and in this shader make use of the Grab Pass, which would take whatever is currently in the frame buffer, and, still in your shader, as a second pass, perform whatever effects you'd like on your displayed scene. However this would unfortunately modify the ENTIRE scene, not just the GUI...

I'm afraid if you want to perform fancy things on the graphical side of GUI in Unity, you won't have a choice and do like I did and make your own GUI system. Yes, this is a pain.

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 sean · Jun 06, 2011 at 07:10 PM 0
Share

Hm. If material shaders can be applied to GUI elements, I might be able to get by with just that. Some of what I was working with needed to be dependent on absolute screen position and the code was structured by a previous author such that I wouldn't have precise placement, but this is probably the best approach for me to try in any subsequent projects.

avatar image Dreamora · Jun 07, 2011 at 12:22 AM 0
Share

materials only exist on 3D objects, not on any unity gui functionality, be it OnGUI or GUITexture - they only use images as such.

if you want material based gui you must implement an own system or use EZGUI

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

2 People are following this question.

avatar image avatar image

Related Questions

Strange shader behaviour on UI component 0 Answers

Dirt On Camera (BF3 and Metro Last Light) 1 Answer

How to Make Transparent Objects Blurry 1 Answer

Setting GUI GameObjects to ignore all lighting 1 Answer

Documentation on the bloom filter 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