Does UE4 support Imaged based lighting through HDRI panoramas?

I’d like to use my own HDR images for lighting scenes and environments in UE4.
Kinda like this:

Can I do that with UE4?
If so, what’s the typical resolution for the HDR map?

Yes, you can use .hdr Panorama Pictures in your Unreal Scene.
Create a Skylight and Put a .HDR into Cubemap.

Thanks. Is there a standard acceptable resolution?
For rendering in maya and such 4096 is considered low res and they can go up to 8k, 10k, 21k, 30k etc.

Unfortunately HDR cubemaps are downsized to 512 during game by default, regardless of the size they are imported in. As far as i know it can be increased via the source code but i dont know how.

The current max texture size in code is 16k, which requires D3D11 (D3D10 is 8k limit).

import the texture and apply it to a skybox using an unlit material (hook up cubemap texture sample to Emissive). Be sure to disable shadow casting on the skybox. Then place a skylight and it will automatically start lighting from your skybox.

Hey Daniel, can you elaborate on this please?
When you say "skybox " Do you mean an actual cube?
I shoot equirectangular/equilateral panoramas, and normally spheres are used, and I see in the clasees menu there’s “BP_Sky_sphere”
If you mean a skybox/cube, that means I’ll have to convert my panoramas to cube map layout, correct?
Or can I just import my own sphere and just apply the hdr texture to it?

Why not say “use specified cubemap” on the skylight? Does capturing from the dome provide any differences or benefits?

Like someone previously pointed out, it seems cubemaps in .hdr are limited to 512x512 in size? Atleast when I tried this it was downsized significantly in the game. And, what UV coordinates would you use for a setup like this? The custom reflection vector gives me distortion in the texture if I map it to a sphere?

Yeah…this is not really working as far as I know. About the .hdr image resolution…you can compile an engine version from source code to get all .cpp files. There is one for cubemaps or something like that (sorry dont remember which one it was, but I can check again at work^^) and there you can set the max allowed input resolution for .hdr images. I was able to set this to 4096 but havent tried more since I was quite pleased with the results^^

@DanielW- Every time I try to import in an HDRI file into UDK and use it as a texture it fails in the material editor and gives this error:

“Error [SM5] (Node TextureSample) Coercion failed: MaterialFloat2 Local0 = (Parameters.TexCoords[0].xy * 1.00000000);
: float2 -> float3”

Another user was getting the same error, they talk about it in this thread:

I even created a sug. about this and you even responded to the thread…

but I don’t think Epic is understanding how easy it is to set this up in other packages, especially Marmoset Toolbag, and I think that is where the competition lies, game artist are using that tool to display their work in and the look is great, I feel that UE4 can and should compete against this product and it should be just as easy for an artist to light their work in UE4 as it is in other tools.

The other thing is I keep seeing these explanations of how to do things from expert Epic users or staff and their simple instructions don’t translate very well for people who really need a step by step process. Case in point, I’m trying to follow your advise but I get an error when using an HDRI map as a color map for emissive. Did I do something wrong? I changed the compression type to default, changed my texture size in Photoshop to 2048X1024 and still the same problem. The other thing is once I convert the compression type isn’t that forcing the map to loose its HDRI range? And if so then it really isn’t lighting my scene in a HDRI way correct?

If UE4 can’t do it currently that is fine, I would love to see it on the road map, if it is possible to do, I would love to see a how to write up from someone from Epic or even a user that has this working correctly. Thanks for any help! :slight_smile:

P.S. Just to be clear… I’m not trying to troll this topic…I am just interested in learning an answer for the problem, so again…any help would be greatly appreciated!

You need to plug Reflection Vector to the UV input of the HDRI, like so:


1 Like

But then put the output of the cube in the Emissive Color slot of the material block

Exactly…the error you are getting is because a cubemap needs 3 coordinates and normal textcoords provide only 2. The reflection vector however is is also a 3dimensional vector so it works.

Regarding of what you wrote about UE4 should be as simple as Marmoset to set something like this up…I heavily disagree! Marmoset is a presentation tool for artists that, as you mentioned, doesnt need you to understand all the background of setting up materials and environments. You just put it in and it looks awesome. Thats okay, but Unreal 4 is a game engine! Its a tool to build worlds. Its not some presentation tool…plug and play style.

Honestly, and this is why I disagree and value Unreal 4 so much…exactly because it takes more effort and skill to achieve the same results in Unreal, I would consider someone who makes his stuff look as good there as somebody elses stuff from Marmoset, to be more skilled in engine handling and material and lighting setup. That teaches you more about what that guy can actually do in an engine than just using marmoset where everything works out of the box.

It tells you quite a lot about the guy you are having a job interview with if he build everything in engine by himself.

But yeah…thats just my 2 cents on this :wink:

Hi guys, could you help me out to solve one problem? What if I want to blur out HDR image or even make it more like a gradient? Something like on the reference image. How to achieve this effect? Thank you!

yes you can

Same question. If anyone can point out where to increase the cap limit of hdr in source code, would be great. Thanks.

A somewhat related question to this - has anyone figured out the material mapping of nodes for using both the ReflectionVector and TextureCoordinate (to flip/ mirror the texture)?

Would love some thoughts and advice on this.

is CognizanCe asking about image based lighting or skybox ?
for image based lighting part, only need to create a skylight and set the source type of the skylight to specified cubemap. Then plug HDR image to cubemap.

for the skybox, i think it only give a visualization of the background and it has nothing to do with the image based lighting.

am i right ? if i’m wrong, please correct me.

This thread is 2 years old. It did not need bumping.