Changing the texture of the moon every day

Hi,
Could you please advise me how I can set up a system to change the moon texture every day?
I have an MPC in which there are several parameters to control the textures of moons and suns. I also have a material where I have my base textures for suns and moons.
However, for one moon, I want to use a texture change every night to create the effect of changing phases.
I’ve tried to customise on my own, but I’ve just hit a wall.
I’ve created a Texture Archive and am trying to set everything up to interact with it, but I just seem to be doing everything wrong. I’ve hooked up all the new settings to the update node. But the texture doesn’t change.

How can I get the desired result? How in theory should a workflow like this even be created? Please advise.

Thank you!

A couple of ways you could do this.

MOD(INT((B2-DATE(2000;1;6))/27,3);4)+1 is the first result of a formula on stack overflow.
Date here is based on Jan 6, 2000

You can also have a small script to print out the current phase of the moon into a textfile that gets loaded in and checked against. I find this to be an easy solution, but it may not work for everyone’s application, as it would need to be called outside of the main program, through a C++ script, or through the python objects.

1 Like

I got help from one forum. I am sharing the answer)
The solution to this problem was so close.

Can be much simpler:

image

Adjust the Modulo % value as needed. This is a 0-12 range.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.