Colors of two unlit objects are different even though they use the same shader

Hey everyone,

I’m trying to create a dynamic sky with a moon/planet. But try as I might, I just can’t get the dark side of the planet to match the color of the sky, at least not during daytime. The sky dome and the planet mesh both use an opaque/unlit shader and don’t cast or receive shadows. It looks perfectly fine in unlit mode, but in lit mode there appears to be some kind of bloom effect from the directional light that works differently on the sky dome than on the planet mesh.

59034-capture.png

There is nothing fancy about their shaders. I even tried using a simple flat color shader on both of the meshes, with only a vector parameter plugged into the emissive channel, but the problem persists.

The planet has to be a separate mesh since it’s going to have a very specific shape later on that can’t easily be replicated in a shader. Also, I can’t use transparency on the planet since it needs to obscure the sun at certain points.

I’ve tried everything I can think of to fix this, but nothing seems to work. So if anyone has any ideas about how to make this work, I would greatly appreciate the help.

I highly suggest looking at the community ocean project. The new 4.9 version from github has a moon/sun cycle based on day/month/year and latitude/longitude. It doesnt suffer from the issue you describe in 4.9

See how its setup there.

Thanks for the link, Nsomnia. Unfortunately that project wasn’t made for the moon to be visible during the day, so there’s not much I can learn from it in that regard.

59086-capture2.png

Every other aspect of that project is pretty awesome though. :wink:

Stupid oversight on my part: The difference in color was caused by the atmospheric fog in the scene.

I have not yet found a way to prevent the problem completely without deleting the fog, but I could alleviate it to an acceptable level by adjusting its values.