How to move cubemap of fake skybox on z axis? (Can't understand camera vector manipulation)

Hi everyone, I’ve been looking to make a fake skybox material and this is my set up (top pair of images). I’d like to have the option of sliding this image up or down as needed (i.e. moving the fake horizon). Normally, for a regular texture you’d add to the X or Y of the texture coordinate and plug that into the UVs.


But since I’m pulling from the camera vector, adding only creates a zoom effect instead of a sliding effect. This does squeeze the image downwards and move the horizon for me, but the zooming leads to upper portion (the stretched out part) appear pixellated. So I’d just like to be able to slide it, move the image downward and have the bottom row loop back from the top.
This is the cubemap, for reference:

I tried adding a texture coordinate node (with the addition setup for Y, and an extra vector added to make it a 3vector) to this but that really did not get me what I needed. This vector math isn’t very intuitive for me, I’m having a lot of trouble figuring this one out.

Thanks a lot. This is a useful tutorial and add some additional functionality that my simpler one didn’t have. Good reference for later.

Having said that, I am still stuck with the issue of how to recreate the sliding effect we can get by adding a scalar to the texture coordinate on texture samples. I tried adding a scalar parameter to the B of the World Position node in this tutorial. It still does the zoom in/out, squash and stretch thing instead of sliding. I think I sort of understand why this is happening now (I imagine it’s like moving an imaginary camera up and down inside a room; you would zoom in or out depending on the height of the camera, this is what all my attempts to add a scalar have been so far). But I’m no closer to resolving it.

You want it to go up or down on Z?

Yes. So I hope these gifs can better explain.

This is what happens when I add a scalar value to Z of the the fake skybox material (both my own and the tutorial).
WhatHappensEdit

But what I want is this effect, which you’d normally get by adding a scalar parameter to the Y of the texture texture coordinate:

WhatIWantEdit

But of course this one above is just a regularly mapped material and doesn’t have the same parallax type effect of the skybox material.

Edit: I just realized the tutorial version doesn’t actually do what I need and is different from what I had been doing. Either I didn’t notice it yesterday or I’ve broken something today.
But anyway, my point about slide vs stretch still stands.

This is how the material I had originally made behaves, and what I meant by that parallax effect:
FakeSkyboxEdit

1 Like

I get it. I’ll come back later…

Ok, I have no answer.

What’s wrong with doing it with a normal sky texture, like you have in your 2nd GIF?

Yes, it’s not an HDRI, but you’re only using half the sphere anyway.

Is it just that you want to move the horizon down, or do you want to create some sort of cloud moving effect?

Hello, thank you very much for the follow up.

The camera setup in the game is such that the player will never see the poles of the sky sphere (never directly up or down enough to see it), but a range of space above and below the “horizon” will be visible. Eg. let’s say from B1 to E1 is all that’ll ever be visible. I would like to be able to move this horizon chunk up and down for various levels to give a stylized illusion of altitude (eg. If you are in a high area, the horizon appears lower down).

So I could recreate that by simply using the regular setup (second gif) and scaling up the sky sphere to be massive, recreate that parallax effect through actual distance. But there are certain effects I’m using in the game for which it’s more ideal for the sphere to be smaller and just outside the bounds of the gameplay space, just big enough to fit everything. But here, since it’s a regular texture and a smaller sphere, moving around closer to the walls of the sphere has no parallax and it breaks the illusion of a far away horizon. That’s the problem.

I’ll try to fix other things (eg. edit the texture and make different versions with horizon at different heights) as a workaround to this.

Thank you though!

1 Like

I just hopped back in to mention that I rececntly came across the HDRI backdrop plugin for Unreal. I had no idea earlier that this existed, it’s great! Though I could never solve the actual issue I had with the material setup, the HDRI backdrop plugin is a good replacement for the whole thing anyway. Just plugging this in here in case anyone else comes across this issue.