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 Spaniel · Dec 22, 2012 at 12:30 PM · shaderrender

Need help with progress bar shader

Hi. I am trying to have it so when a player touches a computer, the bar fills with red starting at the left until it has hit the right side. I understand the logic behind it but am wondering what way you would recommend I go about doing this with a shader or if anyone can recommend something. For instance. here is the texture we are using:

alt text

I have looked at a bunch of shaders and couldn't figure out how they would actually apply to my situation where I just want red to fill the bar.

Can anyone explain if this shader would help me accomplish this or if they have something else that would work?

http://wiki.unity3d.com/index.php?title=Reveal_Non-Uniform_Texture

Furthermore, would it just make sense to calculate how far out the red should go based on the time the use has held the screen (a number I already have been calculating) and then if the pixel is between the y range and the x start and the x end, make it red.

What would you recommend?

corescreen.png (151.6 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 raoz · Dec 22, 2012 at 10:35 PM

I would say math is the way to go here.

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 Spaniel · Dec 22, 2012 at 11:25 PM 0
Share

This answer is worthless...

avatar image raoz · Dec 22, 2012 at 11:33 PM 0
Share

Ok, sorry, I meant the the last idea you brought up would make sense in this situation. If you need further help on implementing this, feel free to comment

avatar image Spaniel · Dec 22, 2012 at 11:35 PM 0
Share

Thank you for the clarification.

avatar image raoz · Dec 22, 2012 at 11:36 PM 0
Share

You're welcome!

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

10 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

Related Questions

Transparent Shader Render Order Issue 0 Answers

How to render projector in front of walls but behind player? 1 Answer

Transparent Diffuse issues 1 Answer

Always on top mask shader? 2 Answers

Shader producing a different result in-game and in-editor 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