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 JusticeAShearing · Sep 03, 2014 at 04:20 PM · smoothinfinite terrain

Infinite Range, Smooth, Day-Night Cycle

Could somebody please tell me how to implement a day-night cycle with smooth transition that has no limitations placed upon its range.

Firstly, I would like the sun and moon to move smoothly across the sky.

Secondly, my terrain is infinite. Therefore, I would be grateful for a sky that is infinitely far away.

However, if you have a solution but it proves me wrong about either of my conclusions, please tell me about it.

Comment
Add comment · Show 2
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 jokim · Sep 03, 2014 at 04:26 PM 1
Share

wait, did you come here asking for someone to code this out for you ?....

What you should do is actually work your way toward a solution, then come here asking if you're on the right track...

The whole "I request" thing kind of comes off as "agressive" - to me at least.

avatar image JusticeAShearing · Sep 07, 2014 at 03:43 PM 1
Share

Thank you for telling me so, I have amended my question.

I would merely like to be pointed in the right direction, and I have explored possibilities, but they didn't deal with radius expansion or infinite distance.

I find that finishing the work myself aids my understanding, and thus I can answer other questions on the same general field in a more skilled fashion.

If you wish to appear helpful or friendly upon the first impression, please use the ter$$anonymous$$ology "I recommend" ins$$anonymous$$d of "You should" when commenting.

3 Replies

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

Answer by betaFlux · Sep 07, 2014 at 03:59 PM

Hello Justice, my advice: Follow the BurgZergArcade tutorial series about Day Night Cycle beginning with this video. As for the infinite sky distance, may be once you have finished your Day Night Cycle, you are skilled enough to implement this feature by yourself, or may be it would be enough to let all relevant sky objects move along with/rotate around the player.

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 JusticeAShearing · Sep 07, 2014 at 04:15 PM 0
Share

Thank you! I will try this as well as the above answer. I particularly enjoy following YouTube tutorials, and this series looks promising.

Thanks for calling me 'Justice', I find it very enjoyable and it makes you seem friendly and happily helpful.

avatar image betaFlux · Sep 07, 2014 at 04:42 PM 0
Share

Well, that was kind of you too! :) I also enjoy following yt tutorials especially the BurgZergArcade episodes. Petey is such cool guy, it is fun listening to him. I also followed these tutorials and created a Day Night Cycle for my game and I still use it, since 2 years. It's simplicity itself and thus easy to edit, even for a beginner like me.

avatar image JusticeAShearing · Oct 01, 2014 at 04:49 PM 0
Share

All right, it's all done! $$anonymous$$y day-night cycle is coded fully and everything that should be related to the time is so. This was achieved through all of your answers (thank you very much), other questions and answers on this site, and a variety of YouTube tutorials, from betaFlux and otherwise.

avatar image JusticeAShearing · Oct 01, 2014 at 04:52 PM 0
Share

@betaFlux I accepted your answer in particular because it gave access to lots of advice, and I could learn the coding myself via following the tutorial, as I have with my old favourite.

avatar image
2

Answer by jokim · Sep 03, 2014 at 04:29 PM

Now, If i was to actually take a shot at an "answer" I'd say :

Have you thought about making the sky a set distance from the player (or the camera).

What i'm seeing is some sort of a sphere (huge, indeed) that has the sky on it (a sky dome), and has a moon and sun rotating around it. That sphere could be attached to the camera or the player. that way, it gives the illusion of "infinite" as you're never getting any closer to it.

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 JusticeAShearing · Sep 04, 2014 at 04:43 PM 0
Share

That's a very good idea, I'll try it and tell you if it works or does not do so.

avatar image JusticeAShearing · Oct 01, 2014 at 04:50 PM 0
Share

Yes, it worked. Thanks!

avatar image
1

Answer by TD10074405 · Sep 04, 2014 at 05:47 PM

My own personal method is to use a Sphere as above, delete the mesh renderer (or just disable) attach a directional light source at a point (Preferable at 92 Degrees so its beyond your horizon / below your terrain) this will be your "Sun"

you will then need to declare a simple sec/min/hour/day float to say that 1 day = 24hr, 1 hr = 60 min, 1 min = 60 secs

basically then rotate the sphere by adding setting your objects transform rotation equal to current time (A variable, float) + Time.deltaTime, Which should rotate per second.

I can write a longer response later on if needs be.

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 JusticeAShearing · Sep 06, 2014 at 03:06 PM 0
Share

Thank you for the extra information, I will retry the above method with it.

avatar image JusticeAShearing · Sep 27, 2014 at 05:05 PM 0
Share

@TD10074405 I have finished with your method, and it was brilliant for the sun and moon. Thank you for it!

@jokim The same applies to you.

I have never had more than one answer to accept before, and I want to accept everybody's. betaFlux is definitely going to be accepted, but I want to accept yours, TD10074405, because of your idea and your detail. I up-voted jokim because of his idea.

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

25 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to generate infinite cube world / minecraft terrain with perlin noise? 1 Answer

Animation speed control - no smooth animation on slow down 3 Answers

2d camera help! 0 Answers

Turn page, smooth rotate 1 Answer

Smooth rotation problem 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