2
$\begingroup$

Good evening,

I am currently struggling with Blender regarding the Nishita sky texture.

I want to add a sun together with a moon at the sky using Nishita as a sky texture (since it is most beautiful to be honest). However since the Nishita sky is already the background (so being farthest away) so when I add a moon to the sky it appears as a full sphere with the dark side clearly appearing in front of the sky.

I did a comparison rendering to show my expected result (top picture) and what I actually get (below picture).

Please find the comparison in the image below.

enter image description here

The top picture rendering only seems to work for me if I do the following steps:

  • Adding Nishita sky without objects
  • Doing equirectangular panorama render
  • Export the texture
  • surround the camera with a semi transparent sphere containing the rendered panorama texture as emissive texture
  • Adding both moons
  • Switch on Nishita sky again without air, dust and ozone
  • Doing the final render with perspective camera.

Actually I found a way to map non Nishita sky directly on a UV sphere. So I can now put the sky as a spherical layer between the camera inside and the moons behind. But this does not work with my favorite Nishita since the node does not have input vector coordinates.

enter image description here

Another possibility which I tried was doing a compositor. However I currently do not see a reduction of steps doing so.

Does someone have a solution to simplify the workflow? At the end of the day my intention is to put Nishita on my sky sphere as indicated in the picture with only one single step. Is this possible?

Thank you very much and best regards... Harry

$\endgroup$

1 Answer 1

3
$\begingroup$

Objects in Orbit With Nishita Sky Texture

I've landed on a setup that I think simplifies your workflow.

enter image description here

The strategy takes advantage of the Vector input that appears on the Nishita Sky Texture node when Sun Disc is unchecked. We use the Nishita Sky to texture a sphere. We then isolate the sun disc in the World beyond in order to light the moons. The different Sky Texture nodes are kept in sync through the use of drivers.

Create the sky sphere and two moons. In a new material on the sky sphere bring in the Sky Texture node set to Nishita. Use the Object output of a Texture Coordinate node as the Vector input for the sky. Use Mix Shader node with a Transparent shader so that the moons will be visible through it.

enter image description here

The World is pitch black with only the sun disc as a light source, similar to outer space. We can isolate the sun from the rest of the sky by subtracting a sky texture without a sun disc from one with a sun disc:

enter image description here

Let's look at it from inside the sky sphere:

enter image description here

Not bad! The shadowy areas of the moons are disappearing into the atmosphere as desired. There is even some light bouncing onto the larger moon from the smaller one, just like the reference.

Now the issue is that we have three different sky texture nodes to update if we want to adjust the position of the sun. This is where drivers come into play.

Create a sphere Empty and lock its Y-axis rotation, we won't be needing it. adjust the size so you can see it from outside of the sky sphere. Properties Panel > Data > Empty > Size

enter image description here

For each Sky Texture node, add a driver linking the Sun Elevation to the empty's X-axis rotation, and a driver linking the Sun Rotation to the inverse of the empty's Z-axis rotation.

Now when the empty is rotated, the sun will stay in sync for all Sky Texture nodes.

This is a good approach if you want any arbitrary object to be placed in orbit and have its lighting react dynamically to changes in the time of day. Other approaches like pre-rendered HDRIs or pre-rendered sprites in the sky don't allow for such flexibility.

star destroyers

Star destroyer geometry from Sketchfab: "Star Wars: Imperial II Star Destroyer" (https://skfb.ly/LuuA) by Daniel is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/).

$\endgroup$
1
  • $\begingroup$ Awesome! This was EXACTLY the answer I was looking for and the solution for my problem. Thank you very very much... $\endgroup$
    – HarryS
    Commented Oct 15, 2023 at 15:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .