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.
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.
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.
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.
Set the architectural surfaces to cast shadows from both sides: Details > Lighting > Shadow Two Sided
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:
Set the “light blockers” to be invisible in rendering:
Scale the Lightmass Importance Volume fit around the structure tightly.
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
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.
The Lightmass setting are found in: World Settings > Lightmass
Decrease the Volumetric Lightmap Detail Cell Size to increase the light calculation accuracy:
* This will increase the calculation time
Decrease the Indirect Lighting smoothness to get more detailed shadows:
Disable Compress Lightmaps to avoid banding artifacts in the shadow gradient:
Use the Lighting Only display mode to evaluate the lighting solution:
For final quality, set the Light Quality to Production: Build menu > Lighting Quality > Production
* GI – “Global Illumination” is a term referring to indirect light simulation, namely a calculation of how light reflects and bounces between surfaces.
The UE4 First Person template is a good way to start an Architectural virtual tour project, but we first need to “clean” it up, namely, get rid of all the unnecessary objects and settings.
Start with the obvious:
Delete all the cubes and blocks. (Simply select them and press delete)
The quickest way to select all these objects is through the World Outliner window.
Select all the unneeded objects (see image below) and delete them. Note:
I’m intentionally keeping the 4 surrounding wall objects because I want them to serve as invisible barrier objects that will stop the player from wondering of the platform.
So now our level looks like this, with weird static shadows left by the “BigWall” objects that were deleted.
It’s not really critical to fix this at this stage, but if you want to get rid of the weird left-over shadows, simply press the Build button to re-build the lighting, and they will be gone.
Making the walls invisible:
Select the 4 wall objects, and in the Details window, in the Lighting Settings uncheck Cast Shadow,
And under Rendering uncheck Visible.
The level is now clear, and when we press play, we can free roam on the empty stage until we hit the invisible walls.
* You can re-build the lighting to get rid of the walls static shadow.
Time to get dirty!
We now have to get rid if the FPS rifle and shooting setup….
Select the FirstPersonCharacter actor, and in the World Outliner window click Edit FirstPersonCharacter to open the actors Blueprint:
In the FirstPersonCharacter Blueprint, navigate to the Viewport tab so you’l be able to see the mesh components clearly,
And in the actor Components Window on the left, select all the unneeded components, delete them and press the Compile button.
* make sure you don’t select the FirstPersonCamera or any of the inherited components
A list of reported errors will now be displayed in the Compile Results window, because we deleted objects that are referenced by the Blueprint, we will fix this in the next step:
Navigate to the Construction Script tab, Select the AttachComponentToComponent node (currently displaying an error) and delete it.
Navigate to the Event Graph tab, locate the first Event Graph at the top of the Blueprint, this is the Event BeginPlay graph.
Select the 2 Set Hidden in Game nodes (currently displaying an errors) and delete them:
Locate the Spawn projectile node graph at the bottom of the Event Graph,
Select this whole section, delete it and press Compile.
The Event Graph should now look like this, and compilation should be without errors because we deleted all the Blueprint parts that were referencing the deleted actor components:
It’s time to remove the small red targeting cross-hair icon displayed on the screen when playing.
The cross-hair icon is defined in the level’s HUD (Heads Up Display) Blueprint class.
The easiest way to remove it is to simply remove the HUD class from the level.
The FirstPersonHUD class can be useful to an Archviz project for displaying branding and architectural data on screen so it’s good to keep it in the project. it can later be modified to suit our needs used again (doing that is beyond the scope of this article).
If you wish to edit the HUD Blueprint instead of disconnecting it from the level, you’ll find it in Content > FirstPersonBP > Blueprints > FirstPersonHUD:
To remove the HUD from the level, navigate to the World Settings window,
If it isn’t displayed open it from Settings > World Settings:
In the World Settings window, under Game Mode > Selected GameMode, open the HUD Class drop-down and instead of FirstPersonHUD, choose None.
This will remove the HUD from the level but wont delete it from the project:
Software: 3ds max 2020 | V-Ray Next | Unreal Engine 4.25
This post details basic steps and tips for exporting models from 3ds max & V-Ray to Unreal Engine using the Datasmith plugin.
The Datasmith plugin from Epic Games is revolutionary in the relatively painless workflow it enables for exporting 3ds max & V-Ray architectural scenes into Unreal Engine.
Bear in mind however, that Datasmith‘s streamlined workflow can’t always free us from the need to meticulously prepare models as game assets by the book (UV unwrapping, texture baking, mesh and material unifying etc.) (especially if we need very high game performance).
That being said, the Datasmith plugin has definitely revolutionized the process of importing assets into Unreal, making it mush more convenient and accessible.
Make sure all materials are VRayMtl type (these get interpreted relatively accurately by Datasmith)
Make sure all material textures are properly located so the Datasmith exporter ill be able to export them properly.
In Rendering > Exposure Control:
Make sure Exposure control is disabled. Explanation:
If the Exposure Control will be active it will be exported to the Datasmith file, and when imported to Your Unreal Level/Map a “Global_Exposure” actor will be created with the same exposure settings. Sounds good, right? So what’s the problem?
The problem with this is that these exposure setting will usually be compatible with photo-metric light sources like a VRaySun for example, but when imported to Unreal, the VRaySun does not keep its photo-metric intensity. (in my tests it got 10lx intensity on import). the result is that the imported exposure settings cause the level to be displayed completely dark.
Of-course you can simply delete the “Global_Exposure” actor after import, but honestly, I always forget its there, and start looking for a reason why would everything be black for no apparent reason…
* If your familiar with photo-metric units, you can set the VRaySun to its correct intensity of about 100000lx, and also adjust other light sources intensity to be compatible with the exposure setting.
Select all of the models objects intended for export,
And File > Export > Export Selected:
* If you choose File > Export > Export you’l still have an option to export only selected objects..
In the File Export window,
Select the export location, name the exported file,
And in the File type drop-down select Unreal Datasmith:
In the Datasmith Export Options dialog,
Set export options, and click OK.
* Here you select whether to export only selected object or all objects (again)
Depending on the way you prepared your model,
You may get warning messages after the export has finished: Explanation:
Traditionally, models intended for use in a game engine should be very carefully prepared with completely unwrapped texture UV coordinates and no overlapping or redundant geometry UV space.
Data-smith allows for a significantly forgiving and streamlined (and friendly) workflow but still warns for problem it locates.
In many cases these warnings will not have an actual effect (especially if Lightmap UV’s are generated by Unreal on import), but take into account that if you do encounter material/lighting issues down the road, these warnings may be related.
Note that the Datasmith exporter created both a Datasmith (*.udatasmith) file, and a corresponding folder containing assets.
It’s important to keep both these items in their relative locations:
In Unreal Editor:
Go to Edit > Plugins to open the Plugins Manager:
In the Plugins Manager search field, type “Datasmith” to find the Datasmith Importer plugin in the list, and make sure Enabled checked for it.
* Depending on the project template you started with, it may already be enabled.
* If the plugin wasn’t enabled, the Unreal Editor will prompt you to restart it.
In the Unreal project Content, create a folder to which the now assets will be imported:
* You can also do this later in the import stage
In the main toolbar, Click the Datasmith button to import your model:
Locate the the *.udatasmith file you exported earlier, double click it or select it and press Open:
In the Choose Location… dialog that opens,
Select the folder to which you want to import the assets:
* If you didn’t create a folder prior to this stage you can right click and create one now.
The Datasmith Import Options dialog lets you set import options:
* This can be a good time to raise the Lightmap resolution for the models if needed.
Wait for the new imported shaders (materials) to compile..
The new assets will automatically be placed into the active Map\Level in the Editor.
All of the imported actors will be automatically parented to an empty actor names the same as the imported Datasmith file.
In the Outliner window, locate the imported parent actor, and transform it in-order to transform all of the imported assets together:
* If your map’s display turns completely dark or otherwise weird on import, locate the “Global_Exposure” actor that was imported and delete (you can of-course set new exposure setting or adjust the light settings to be compatible)
Thinking we must “cheat” about the real-world lighting conditions of an architectural interior in order to render an aesthetically pleasing image of it is a common misconception in the field of Architectural Visualization.
I have been a professional in the field of digital 3D Visualization and Animation for the past 17 years, and the technologies we use to create synthetic imagery have developed dramatically during this period. The profession that is traditionally named “Computer Graphics”, can today rightfully be named “Virtual Photography”.
At the beginning of my career, photo-realistic rendering was impossible to perform on a reasonably priced desktop PC workstation. Today things are very different. In the early years, the process of digital 3D rendering produced images of a completely graphic nature. No one back than would mistake a synthetic 3D rendering for being a real-world photograph.
About 12 years ago, the development of desktop CPU performance and the advent of 3D rendering software that use Ray-Tracing* processes have made possible a revolution in the ability to render photo-realistic images on desktop PC’s. The term “photo-realistic” simply means that an uninformed viewer might mistake the synthetically generated image for a real-world photo, but it doesn’t mean the image is an accurate representation of the way a photograph of the subject would look if it were really existing in the world. For a computer generated image to faithfully represent how a real-world photo would look, it’s not enough for the rendering to be photo-realistic, it also needs to be physically correct and photo-metric.
“Physically correct” rendering means the rendered image was produced using an accurate virtual simulation of physical light behavior, and “Photo-Metric” rendering means that the virtual light sources in the 3D model have been defined using real-world physical units and and the rendered raw output is processed in a way that faithfully predicts the image that would result from a real-world camera exposure.
Most contemporary rendering software packages, have the features I described above, and therefore are capable of generating photo-realistic images that are also physically correct and photo-metric, and so faithfully predict how a real world photo of the architectural structure would look.
So what’s the problem?
The problem is that when we virtually simulate the optics of a scene using real world physical light intensities, we come across the challenges that exist in real world photography, mainly the challenge of contrast management, or in more geeky terms, handling the huge dynamic range of real-world physical lighting, simply put, we encounter the common photography artifacts like unpleasing “blown out” or “burnt” highlights, light fixtures and windows.
Trying to solve the problem by lowering the camera exposure simply reveals more details in bright areas at the expense of darkening the more important areas of the image. traditional photo editing manipulations don’t do the trick, they might serve as a blunt instrument to darken areas of the image selectively but the result looks unnatural and fake and the traditional approach in interior rendering is to simply give up the realism of the visualization by drastically reducing the intensities of visible light sources and adding invisible light sources, a solution that might produce an aesthetic image but not one that faithfully reflects how a real photograph of the place would look and can be said to be physically correct.
Fortunately today we have tools and processes, that allow for a much more effective development of physically accurate renders, somewhat similar in approach technologies incorporated into professional digital photography. these techniques involve processing the rendered images using specialized file formats that contain a very high degree of color accuracy and can store the full dynamic range of the “virtual photograph”, a process called “Tone mapping” designed to display an image in a way that mimics the the way are eyes naturally see the world, optically simulated lens effects that mimic the way a real lens woulds react to contrast and high intensities of light.
Incorporating this workflow requires taking a completely different approach to creating and processing 3D rendered images than the traditional methods used in the past decades. we give up some of the direct control we’re used to in computer graphics, but in return we are able to produce physically correct visualization that are both aesthetically pleasing and have a naturally feeling lighting.
In conclusion, with effective usage of today’s imaging technologies, it’s possible to produce 3D visualization that will serve both as a faithful representation of a possible real world photograph of the architectural design, thus aiding the creative design and planning process, and at the same time provide a photo-realistic basis for producing highly aesthetic marketing media.
Thank you for reading! I would love to hear your opinion, discuss the subjects in the article and answer any questions that you may have about it.
* “Ray-Tracing” is a process that simulates the physical behavior of light by tracing the directions it travels as it hits surfaces, reflects of them and refract though them. Ray-Tracing calculations are a key ingredient in photo-realistic rendering.
The author is Oded Erell, photo-realistic rendering specialist and instructor, the 3D visualizations displayed in this article have all been produced CG LION Studio.
Your’e welcome to visit our portfolio website and see more examples of our work.