UE4 Cubemap in material. From reflection to ambient cubemap. How?


Hi guys :slight_smile:

Cubemap captured by Cubemap Render Target can be easilly using with ReflectionVector node.
But how to make uv coordinate to using that cubemap as ambient cubemap?

Difference between reflection/ambient cubemap work greatly shown in that article.

Unfortunately i cant find any information about how to make “that” sort of UV coordinates.


Cubemap UVWs are simply a world direction. The reflection vector is an incoming view vector reflected by the surface normal. For diffuse IBL it’s just the world normal. I don’t know if Unreal does automatic convolution of the mip maps (blurring), but choosing some constant low mip level should get you something that approximates IBL even if does not.


Yeah i understand that ) But real solution are more complicated.
Cube capture in UE4 create Longitude-Latitude format cubemaps so making 3 channel vector uv become more complicated task.
By default UE4 only have “reflection vector” node for handle cubemaps as reflection maps, but doesnt have anything for ambient light (more simplier world direction projection).
And i just cant find information about how to making calculations for create 3vec data and handle Longitude-Latitude cubemaps as ambient maps.


The long-lat layout should just be for convenient on-disk storage. Once imported it gets converted into an actual cubemap, which is a cube with 6 face maps, hence the name. And any texture being generated in real-time by Unreal is going to be an actual cubemap until it’s exported.

Presumably you have your cubemap as a texture property, and you’re feeding the output of the Reflection Vector into your Texture Sample node that’s using that cubemap texture, yes? Just don’t use that and use the output of a PixelNormalWS instead.

If instead you do actually have a long-lat texture you’re using straight, consider importing it as a cubemap. Or you’ll have to convert the xyz world vector into polar coordinates.


Maybe im just named it wrong way?

thats what we got by using scene capture cube in UE4.
At least it looks like typical long-lat cubemap, no?

I find solution: absolute world space - object position = UV for “that” cubemap.
But yes, PixelNormalWS gives absolutely same results! Thanks :slight_smile: