Blending Skyboxes?

Hi all, it’s been awhile.

I’m taking another stab at a day/night cycle system. I’ve got a decent, working sun moving about, now I just need to blend a day and a night skybox together. How easy would this be, to create a material that can be used as a skybox, that blends textures from two different skyboxes based on a slider?

For instance, during the “day”, the day skybox would be in full effect, but as the sun sets, it eases into a nighttime skybox, and the material itself could be controlled with a slider that could then be accessed from script.

I feel like this could help a lot of people in creating very simple day/night cycles.

Not difficult if you have a cube map of the sky. See Cg Programming/Unity/Skyboxes - Wikibooks, open books for an open world for a simple skybox. What you want requires another property for the relative weight of the textures, another cube texture lookup and a lerp operation in the fragment shader.

Someone give this man a medal.

Could Strumpy do this? I know nothing about coding shaders, on Javascript. Strumpy is fantastic, so I figure it could be used for this, correct?

Thanks, but I have to admit that I’m doing this as part of my job.

I assume it can; however, I have no experience with Strumpy and currently I don’t intend to learn about Strumpy. (My experience with this kind of visual programming is that it is fun to play with it as long as the programs are small, but for more complex programs a textual approach with indentation is much more easy to read and understand. Approaches that try to solve this problem of visual programming by defining modules tend to include large libraries of modules which are hard to navigate such that it is difficult to find the module that you need. Without such libraries you have to define these modules yourself, which tends to become quite cumbersome; in particular from a debugging perspective. Add to these problems the problems that any additional programming layer introduces (e.g. bugs in the editor or compiler) and you end up with a quite frustrating experience. Again, I’ve no experience with Strumpy but enough experience with other visual programming languages to be quite skeptical.)

If I know enough about ShaderLab (don’t quote me because barely know it at all), all of the classes and members you need are already built in. Unity Tech. has had the better part of a decade or more to iterate the language. Strumpy is just a node-based graphical shader editor that compiles into Unity’s shader language. Found here

So this is what I’ve got so far. Two cubemaps, and a lerp to blend between them based on a range. It’s not the satisfactory effect, of course. I don’t know how to get the textures from a cubemap to the albedo, what lighting model the sky should use, or… anything really. I just guess the graph would be enough to show people what I actually have in mind. The two images show the range “_Blend” at 0 and 1.

So how to I actually get the textures from the cubemaps to the albedo? And what settings does the shader need to be used as a skybox?