UE4 – Technical model visualization tips

Software:
Unreal Engine 4.25

This post is a summary of the tips given by Epic Games technical-artist Min Oh in his GDC 2017 lecture about improving photo-realism in product visualization, more specifically, how to render high quality surfaces.
I recommend watching the full lecture:

  1. Render sharper reflections by increasing the Cubemap resolution of reflection captures:
    Project Settings > Engine > Rendering > Reflection > Reflection Capture Resolution
    * use powers of 2 values i.e. 256, 512, 1024….
    Annotation 2020-07-06 195120
  2. Improve the accuracy of environment lighting by increasing the Cubemap resolution of the Skylight:
    * use powers of 2 values i.e. 256, 512, 1024….
    Annotation 2020-07-06 202415
  3. Improve screen space effects accuracy like screen space reflections by setting the engine to compute high precision normals for the GBuffer:
    Set Project Settings > Engine > Rendering > Optimizations > GBuffer Format to:
    High Precision Normals
    Annotation 2020-07-06 204022
  4. Use a high degree of tessellation (subdivision) for the models pre-import.
    Simpy put:
    Use high quality models.
  5. Improve the surfaces tangent space accuracy, and as a result also the shading/reflection accuracy by setting the model’s static mesh components to encode high precision tangent basis:
    Static Mesh Editor > Details > LOD 0 > Build Settings > Use High Precision Tangent basis
    Annotation 2020-07-06 210030
  6. Creating materials with rich dual specular layers by enabling material clear coat separate normal input:
    Project Settings > Engine > Rendering > Materials > Clear Coat Enable Second Normal
    Annotation 2020-07-06 211152Set the material Shading Model to Clear Coat and use a ClearCoatBottomNormal input node to add a normal map for the underlying layer:
    Annotation 2020-07-06 221027

 

Related:

  1. UE4 – Lighting calculation tips
  2. UE4 HDRI lighting
  3. UE4 – Enable DXR ray-traced reflections 

UE4 – Lighting calculation tips for Archviz

Software:
Unreal Engine 4.25

The Static Lighting calculation in UE4 is performed by the Lightmass module (UE4’s integrated GI* engine), and the result of this calculation is stored in each object’s Lightmap, an extra texture map used for storing static light and shadow information.
This post provides a list of useful tips and techniques for improving your UE4 scene setup for an efficient light calculation.

Annotation 2020-07-04 223338

Notes:

  1. The following tips are aimed at achieving a good lighting calculation/solution but they don’t include optimization methods for high performance projects.
    Namely, we don’t get into manual Lightmap UV optimizations here.
  2. The following tips don’t take into account the now real-time ray-tracing options that have become available with Nvidia Geforce RTX / DirectX DXR.

 

Scene Setup:

  1. Delete unseen polygons from your mesh, so they wont waste Lightmap resolution.
    * For example, in an interior Archviz project, delete the outer polygons of the walls.
  2. Set the architectural surfaces to cast shadows from both sides:
    Details > Lighting > Shadow Two Sided
    Annotation 2020-07-04 231158
  3. Place “light blockers” around the structure to avoid light licks.
    * Wrap the structure on all sides with scaled cubes that have an absolute black material:
    Annotation 2020-07-04 194647
  4. Set the “light blockers” to be invisible in rendering:
    Annotation 2020-07-04 194713
  5. Scale the Lightmass Importance Volume fit around the structure tightly.
    Annotation 2020-07-04 185623

 

Lightmap Resolution:

  1. Optimize the architectural surfaces (static meshes) Light map resolution.
    A higher resolution will allow the Light Map to store more detailed lighting.
    The Static Mesh resolution setting is found in:
    Static Mesh Edior > Details > General Settings > Light Map Resolution:
    * This setting can also be overriden at the actor settings by selecting the actor in the map/level and activating:
    Details > Lighting > Override Lightmap Res
    Annotation 2020-07-04 214810
  2. Use the Lightmap Density optimization display mode to inspect the actual Lightmap texel density.
    The Lightmap Density display mode also color codes the display to indicate the efficiency of the Lightmap resolution per object (green color being optimal, and warm colors being too dense)
    * Note that in many cases of Archviz you may want a higher density than the editor displays as optimal.
    Annotation 2020-07-04 195909

 

Lighmass Settings:
The Lightmass setting are found in:
World Settings > Lightmass

  1. Decrease the Volumetric Lightmap Detail Cell Size to increase the light calculation accuracy:
    * This will increase the calculation time
    Annotation 2020-07-04 214102
  2. Decrease the Indirect Lighting smoothness to get more detailed shadows:
    Annotation 2020-07-04 232028
  3. Disable Compress Lightmaps to avoid banding artifacts in the shadow gradient:
    Annotation 2020-07-04 214102b
  4. Use the Lighting Only display mode to evaluate the lighting solution:
    Annotation 2020-07-04 200645
  5. For final quality, set the Light Quality to Production:
    Build menu > Lighting Quality > Production
    Annotation 2020-07-04 222201

 

* GI – “Global Illumination” is a term referring to indirect light simulation, namely a calculation of how light reflects and bounces between surfaces.

 

Related posts:

  1. 3ds max & V-Ray to UE4 using Datasmith
  2. “Cleaning” the UE4 FPS template for Archviz
  3. UE4 – HDRI Lighting
  4. UE4 – Activate DXR ray-traced reflections

UE4 – HDRI Environment & Lighting

Software:
Unreal Engine 4.25

Annotation 2020-05-20 162811

Creating HDRI environment backgruond and lighting* in UE4:
Note:
Lighting using a panoramic HDRI background is also referred to as IBL – Image Based Lighting.

* The example HDRIs in this post are from www.hdrihaven.com

  1. Import HDRI environment file.
    Note:
    The file must be saved as a *.hdr file and not *.exr because AFAIK that’s the only way UE4 will recognize it as an HDRI environment and encode it as a Texture Cube (cube map)
  2. Enable the HDRIBackdrop plugin:
    Go to Edit > Plugins
    Type “HDRI” in the search field to locate HDRIBackdrop and enable it.
    * You’l have to restart the UE Editor before using the plugin
    Annotation 2020-05-20 153925
  3. Drag a Lights > HDRI Backdrop object to your level:
    Annotation 2020-05-20 154657
  4. In the HDRIBackdrop details, select the wanted Cubemap:
    Annotation 2020-05-20 155212
  5. > Set the HDRIBackdrop‘s Intensity (self explanatory..).
    > Rotate the HDRIBackdrop around its Z axis to set the environment’s direction.
    > Set the HDRIBackdrop‘s Size.
    * Make it larger than your whole scene,
    And if Use Camera Projection is unchecked make it also large enough so that noticeable objects in the HDRI image will be distant enough as to not move incorrectly when you strife.
    * When Use Camera Projection is activated the Size property has no effect.
    > If Use Camera Projection is unchecked, set the Projection Center Z value to define the background image height below which it is projected as a flat ground.
    > Lighting Distance Factor defines ground projection area that will appear to receive shadows from your scene objects.
    * Set this attribute to 0 in-order to turn off the ground projection shadow.
    > Use Camera Projection:
    Activate this option to get a traditional infinitely far background with no flat ground surface projection.Annotation 2020-05-20 160338

 

Related:

  1. Sun & Sky link
  2. UE4 Architectural Glazing
  3. 3ds max & V-Ray to UE4 Datasmith workflow
  4. Preparing an FPS project for archviz
  5. UE4 – Archviz Light calculaion tips

UE4 – Connect a Directional Light to an Atmospheric Fog effect

Software:
Unreal Engine 4.21

UE4‘s Directional Light mimics sun lighting and shadow fairly realistically,
And the Atmospheric Fog visual effect produces a realistic clear sky background that includes the sun’s disk image in the sky.
> The Atmospheric Fog produces a result similar to an implementation of a Preetham physical sky model in common rendering software.

Combined together, these two elements can produce an effective day-light system,
But inorder for this to work the sun’s direction should be controlling the time of day simulated by the Atmospheric Fog.

For the Directional light to control the Atmospheric fog:
In the Directional Light’s details, under light, expend the settings and enable:
Atmosphere / Fog Sun Light

Note:
There is a limitation to this setup’s realism because the sunlight’s color shouldn’t be pure white, but rather yellowish, to orange, depending on the time of day (you can find tables of the sunlight’s color temperature for various time of day on the web)
There is no problem setting the sun’s color, but the problem is that it causes additional coloring of the Atmospheric Fog which isn’t needed since it already is simulating the sky’s color correctly.
The result of this limitation is that we can see a sunset sky with a white sunlight which is wrong.
I didn’t find a workaround for this yet, can’t find a way to set the Atmospheric Fog‘s sun vector without connecting it to a Directional light and can’t find a way to make the Directional Light‘s color not affect the Atmospheric Fog‘s color.

Update:
It seems this limitation can be overcome by disconnecting the Atmospheric Fog from the Directional Light and using the Atmospheric Fog Object’s rotation to control it.

Directional_light_Affect_Atmo_Fog
atmo_fog.gif

Related:

  1. UE4 HDRI Lighting
  2. 3ds max & V-Ray to UE4 Datasmith workflow
  3. Unreal – Architectural glass material
  4. Unreal – Camera animation