Announcement

Collapse
No announcement yet.

Does UE4 support Imaged based lighting through HDRI panoramas?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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?
    3D Artist looking for work.

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

    Comment


      #3
      Originally posted by Gazu View Post
      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?
      2048?
      4096?
      For rendering in maya and such 4096 is considered low res and they can go up to 8k, 10k, 21k, 30k etc.
      3D Artist looking for work.

      Comment


        #4
        Originally posted by CognizanCe View Post
        Thanks. Is there a standard acceptable resolution?
        2048?
        4096?
        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.
        FREE VR Drum Kit Project
        FREE Color LUT Collection
        FREE Physics Driven Spacecraft Project
        FREE GTA Style Vehicle Interaction
        Dynamic DoF(Depth of Field)
        Camera Crossfade

        Comment


          #5
          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.

          Comment


            #6
            Originally posted by DanielW View Post
            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?
            Last edited by CognizanCe; 09-22-2014, 10:56 PM.
            3D Artist looking for work.

            Comment


              #7
              Why not say "use specified cubemap" on the skylight? Does capturing from the dome provide any differences or benefits?
              Check out UNREAL 4 Lighting Academy
              https://forums.unrealengine.com/show...ng-like-that-)

              Comment


                #8
                Originally posted by DanielW View Post
                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.
                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?

                Comment


                  #9
                  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^^
                  Check out UNREAL 4 Lighting Academy
                  https://forums.unrealengine.com/show...ng-like-that-)

                  Comment


                    #10
                    @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:

                    https://forums.unrealengine.com/show...php?16006-Hdri

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

                    https://forums.unrealengine.com/show...h-a-HDI-or-IBL

                    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!

                    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!
                    Last edited by NickZucc; 09-23-2014, 10:44 PM. Reason: added ps

                    Comment


                      #11
                      Originally posted by NickZucc View Post
                      @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"
                      You need to plug Reflection Vector to the UV input of the HDRI, like so:

                      Click image for larger version

Name:	HDR_Mat.JPG
Views:	1
Size:	48.8 KB
ID:	1057023
                      Last edited by Jacky; 09-23-2014, 11:13 PM.
                      FREE VR Drum Kit Project
                      FREE Color LUT Collection
                      FREE Physics Driven Spacecraft Project
                      FREE GTA Style Vehicle Interaction
                      Dynamic DoF(Depth of Field)
                      Camera Crossfade

                      Comment


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

                        Comment


                          #13
                          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
                          Check out UNREAL 4 Lighting Academy
                          https://forums.unrealengine.com/show...ng-like-that-)

                          Comment


                            #14
                            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!

                            Click image for larger version

Name:	ToL_Marmoset_HDR.png
Views:	1
Size:	567.7 KB
ID:	1065770
                            www.tracesoflightgame.com | @mihal_pigichka

                            Comment


                              #15
                              yes you can
                              https://www.youtube.com/watch?v=OjOhQ1DeQ8s

                              Comment

                              Working...
                              X