Scrolling Skybox material in UE4?

Hi everyone!

I hope you’re all well! I’m using UE4 have been trying for a while now to implement this scrolling skybox material which @Keith and @Eben implemented in TLOU. Has anyone had success building this in UE4?

Cheers and all the best,

Sean

This is what I’ve ended up with so far but it… doesn’t seem correct…
I’ve piped the append into a flow map node. The result is quite strange. Is my bi-tangent math incorrect?

Hey Sean,
so first of, you are doing both of the calculations. The slides says OR. So you are layering two things on top. The Dot, how you use it, should give you wrong results on “the edges”. Also, the first calculation just works if the wind direction is world space (you used the tangent space).

Other than that, I think there is also a bunch of math missing from the talk. the calculations that are shown just give out the “hard edged” version that he show before. Not the smooth gradient. (But it may be that I have passed over something whilie skipping through… but there was not much else about the implementation).

Before I forget: bi-tanget calculation is correct. in code I would write:
vec3 bitangent = cross( normal, tangent.xyz ) * tangent.w;
The .w is something you do not need to worry about inUe4, because it is just there to normalize the scaling of the tangent. Most often it will be 1 nonetheless.

Hey @raytheonly,

Thanks so much for the reply. I really appreciate it.

If I’m not appending the two dots then how would I get “UV” to pass into a flowmap if I’m only using the red channel?

Have you ever done anything like this before and if so do you have any tips or things I should read/watch to get me on track?

Cheers again.

S

Hey,
so I may have worded that badly. You are right, the append needs to happen for creating a vector2 for the UV input in the texture sample.
What I meant, is that in the talk, there are to different “calculations” to achieve the basis, and it looks like you tried to apply them both.


Both of these are given in the talk and give out the same result. But these are not the smooth gradients that are shown in the video. These give UV coordinates, that are quite drastic and result in stretched textures. They also should have the same “cost” performance wise.

At the end it is a calculated flow map. I haven’t done this yet but I use texture based flow maps quite often. (a great unreal tutorial from Simon: https://www.youtube.com/watch?v=tEr3NE_XLbc).

You could just create a flow map and do it with that, but it will have more cost because of the texture lookup, than an mathematical approach like above.

Thanks so much for the clarification. I’ll continue to investigate further and post my findings. :grin:

1 Like