Announcement

Collapse
No announcement yet.

Projecting a Moon on to the Sky Sphere

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Projecting a Moon on to the Sky Sphere

    Hello forums.

    I'm trying to make a day/night cycle and during the night I want to, of course, have a moon.
    For this I decided to modify the sky sphere material and the sky sphere blueprint.
    However, I've gotten to a point where I'm stuck. The moon texture isn't projected with a uniform scale across the sky. When it reaches the horizon it starts to stretch something fierce.

    Here is a video to illustrate the problem.


    And here is a screenshot of the material blueprint.
    Click image for larger version

Name:	moon.JPG
Views:	53
Size:	140.4 KB
ID:	1454946

    Any help would be very much appreciated
    Last edited by Sir_Manfred; 04-03-2018, 08:04 PM.

    #2
    Usually i use a mesh instead

    Comment


      #3
      Thanks for the reply!
      This has been suggested to me. However, I want to do it this way to benefit from the built in layers of atmosphere and clouds as well as being able to use real-world distances in the lighting calculations

      Comment


        #4
        I found a way to project the moon to existing sky sphere with skybox image node. It works fine with clouds and other existing features of skysphere
        Check this video,
        https://youtu.be/iLRDfj9K99w

        Comment


          #5
          yes, as you mentioned, if we use a separate mesh, we can't get the advantages of the layers like clouds which comes with default skysphere. Therefore, we have to implement the moon inside the sky material. I made a little video to show the process.
          https://youtu.be/iLRDfj9K99w

          Comment


            #6
            I actually managed to fix this aabout a year ago or so.
            Forgot to post my solution here but if anyone is interested I can dig it up and post it

            Comment


              #7
              Can you please post your solution? I tried following Thilina_arimac's video but i get massive stretching if I let it cycle a full day.

              Comment


                #8
                I'm actually going to be looking into doing something similar with this. Although, with an added twist and I challenge you all to see if you can do it (Honestly have no idea if I can achieve it, lol)

                The idea is this, basically take what you all are attempting to do. However, the moon won't simply orbit "opposite" of the sun to only appear at night. Instead, it will be calculated for proper moon cycles. Meaning it can occasionally make an appearance during the day, and have cresting, as well.

                What makes it complicated is you can't simply have it's speed on a 30/1 ratio with the sun because that won't account for the Earth's rotation. My thoughts are to determine 3 states; shows during day, night or not at all. Once you determine those 3 states, you can then just pan it through the sky at the proper time and hide it during all other times.

                It sounds much easier than it actually will be, I'm sure

                If I manage to pull this off, I'll be sure to post back here showing how its done. Forewarning, it might be awhile as it is far down on my todo list.
                No bugs were harmed during bug killing operations

                Comment


                  #9
                  Suprised to see this bumped after a year,actually after i post that i was trying to use camera vector to draw the uv coordinate,you can copy the content of the txt file to material editor to see what i did.The calculation could still be optimized,and i only use YAW and PITCH cause that's only what i need,feel free to change that.
                  Attached Files
                  Last edited by profhua; 04-18-2019, 10:55 PM.

                  Comment

                  Working...
                  X