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
3
Question by cowlinator · Jun 13, 2012 at 05:24 PM · shadershadersshaderlab

Shaders: Why is _Time stored in a vector4?

And what do they represent? I thought perhaps it just stored (UnityTime, 0, 0, 0), but this does not seem to be the case.

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 CHPedersen · Mar 13, 2015 at 08:05 AM 0
Share

Why is this voted down? I find this to be a perfectly reasonable question.

+1.

2 Replies

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

Answer by Wolfram · Jun 13, 2012 at 05:32 PM

http://docs.unity3d.com/462/Documentation/Manual/SL-BuiltinValues.html

EDIT: link fixed; thanks @Usul

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 cowlinator · Jun 14, 2012 at 01:30 AM 0
Share

Thanks Wolfram. I actually took a look at that already, and couldn't make much sense of it. Am I to assume that 't' is the Time.time value, and that the vector just stores multiples of it? It seems a bit redundant... Or do I misunderstand?

avatar image Wolfram · Jun 14, 2012 at 01:37 AM 1
Share

float4 _Time : Time (t/20, t, t*2, t*3)

This means, _Time.y contains the regular time, _Time.x regular time /20, and so on. For whatever reason.

avatar image cowlinator · Jun 14, 2012 at 01:41 AM 0
Share

Ok, Thanks! =)

avatar image PaulUsul · Mar 13, 2015 at 08:01 AM 0
Share

http://docs.unity3d.com/462/Documentation/$$anonymous$$anual/SL-BuiltinValues.html

avatar image
1

Answer by GeekyMonkey · Jan 01, 2017 at 07:16 PM

It's just a clever way of giving you 4 variations of the value, potentially saving you a multiply operation by re-using the pre-multiplied value for every pixel being rendered. There are 4 values available.

 _Time.x = time / 20
 _Time.y = time
 _Time.z = time * 2
 _Time.w = time * 3

I don't know why these specific values were chosen. Anyone have an idea?

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 sgrein · May 04, 2019 at 08:28 PM 0
Share

Yes, interesting to know why these values are chosen.

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

7 People are following this question.

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

Related Questions

Curve shader with lights 0 Answers

For a glass shader: How to "Fallback" completely 100% transparent that works in all device or that it do not render at all? 0 Answers

How to adapt this shader into a transparent one (alpha blend) 0 Answers

How do I set a shader property in MonoBehaviour? 0 Answers

Found undocumented ZTest mode, unity_GUIZTestMode for Shader. What kind of ZTest mode this is? 3 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