I’d like to layer multiple skies by using transparency in the sky textures. Unfortunately I’m not up to speed on how the pipeline works and I haven’t figured out by myself how to do this.
What I want to achieve is to have multiple, layered skies (basically just multiple spheres, like an onion), with alpha in the textures being considered and the further away skies being visible. Additionally I’d like to fade single sky layers by making them more transparent.
Is that possible with the default sky system or do I have to role my own?
Hello @RobertZenz, it is possible to create several sky maps. Basically, a sky is just a box geometry with queue bucket set to SKY. What have you tried yet?
For the fade in effect you might have to write your own control I think.
I’ve created multiple skies through the SkyFactory and assigned the inner-most a texture which has an alpha channel/transparent parts but the transparent parts just render as black.
I tried to change some of the properties of the sky spatial (changing the bucket, setting the material to transparent, …) but that either changed nothing or the sky did not render at all.
Alright, did you try to create 2 (or more) materials, one for the transparent sky and another one for the “back” sky. I am not sure which parameters you can set in the sky material definition, but have a look if you can set blend mode to alpha.
In the case really nothing works, I would create the sky boxes in blender or in code and use the unshaded material definition.
That makes sure that the alpha of the image is correctly rendered, with the skies behind it being visible. Now there are only two questions left, if I can set arbitrary transparency on a layer and for some reason the radius of the sky does not define the draw order, the creation order does…or at least that’s what my quick test showed.
Thanks so far, I’ll try some more things tomorrow.
I’ve actually figured the ordering out. You have to attach the sky spatials to a node, and the one that is going to be rendered in front is the first in the list. The radius of the sky isn’t considered when being rendered. Like this:
What I could not find is how to make it transparent as a whole. I tried setting a different material (like to Unshaded) but without any success, it would not render correctly at all when changed. Does somebody know how I could make the complete sky transparent (as in half transparent)?
Also, I’m seeing a graphical glitch when I set the BlendMode to Alpha (kinda hard to see because of the colors):
Just in case somebody else wonders, it was the obvious answer, the textures were broken. They had a line of two near transparent pixels at the corner which yielded these black lines.
Additionally for the transparency, I ended up writing my own shader implementation which allows me to combine a color with the set texture, including transparency. This implementation will be open source and available in the next iteration of Quadracoatl.