MAKING OF: MODULARE FLOR DE LIZ

Atualizado: 13 de Dez de 2018


My name is Arthô Pacini, I am the Unreal Engine 4 main developer at Fuel 3D and in this article we will share with you the MAKING OF 'Flor de Liz', a project from Modulare, all the softwares used and the general details.


THE PROJECT


The Flor de Liz project consists of 7 apartments, of these, 3 single and 4 duplex. The model chosen for the construction of this article was the first duplex.


The company served in this project is Modulare, located in Florianópolis (SC). Its concept, as its name suggests, is to offer modular apartments. These, in turn, are modified according to the customer's needs, allowing to increase, decrease and divide spaces for rental (airbnb) or commercial area (coworking / office).


The idea of using virtual reality arose from the difficulty faced by Modulare to present this concept to its customers.


MODELING



All modeling of the structure was built in 3DS Max Studio from a CAD plant. Our artists built the entire base of the design in Low-Poly, without bevels or modifiers that increase the amount of polygons - Mesh Smooth, Turbo Smooth. The reason for this is mainly performance: the amount of triangles impacts a lot, both the offline rendering (Lightmass) and the real-time execution of the program.


First floor.
FIRST FLOOR

Second floor.
SECOND FLOOR

This base structure contains about 310 objects, totaling 114.000 thousand triangles, a relatively low number for the entire structural base.


UVW UNWRAPPING OBJECTS FOR LIGHTMASS



Each static object that will be rendered by Lightmass must necessarily have a valid UV channel. It is common for every object to have a first channel, where materials can be applied, and a secondary channel, where Lightmap will be applied.


The rules for getting a good Lightmap are:


1. Use as much space as possible in the layout, wasting as little as possible.

2. Do not have overlapping faces.

3. Have a spacing between the islands (faces with different angles) of at least 2 pixels.


Let's take a look at the walls of the first floor:


It is possible to notice that the player will never see certain parts of the wall, for example the surroundings of the same, the top of the structure and part of the interior of the barbecue.


Wall sections never visible to the player (in red) [left]

and Wall sections visible to the player (in red) [right]


Knowing this, we have to leave only visible parts inside the UV.


LIGHTMAP UV
LIGHTMAP UV

The faces that will never be visible to the player are to the right, outside the UV layout, and the faces that will be visible to the player are left in the layout. Whatever opportunity we take we'll remove parts that are never visible, this applies to all objects in the scene.


The more space in use, higher the pixel density at lower lightmap resolutions, thus less render time and higher quality. If there are overlapping faces or the absence of 2-pixel spacing between the islands, there will be light errors in the geometry.


The Lightmap resolution values we use are as follows:


16², 32², 64², 128², 256² and 512² for small and medium sized objects such as chairs, tables, lamps, sofas and others.


1024², 2048² and 4096² for large objects such as beds, floors and walls.


Teapot with a small Lightmap resolution:

Result [left] and Lightmap density (32²) [right]


Since there is a low lightmap density it is not possible to store much information in the texture, notice that the corners of the islands are well marked, producing that dark cross in the lower left part of the teapot, exactly on the edge of the islands.


Teapot with overlapping faces:

Result [left] and Lightmap density (128²) [right]


UV Lightmap:

The same teapot with a large density of pixels in the lightmap continues with errors, since the faces (islands) are superposed one on top of the others.


Teapot without overlapping faces and with a correct lightmap density:

Result [left] and Lightmap density (128²) [right]


UV Lightmap:


ASSET SETUPS



Because we use offline renderers, our assets are composed mostly of assets ready for use in Vray and Corona, these assets are unfortunately not suitable for Unreal Engine 4.


The first reason is optimization, most assets for offline renderers have a huge amount of triangles to provide the highest quality possible, these need to be optimized to not overload the GPU when run on Unreal (heavy geometry greatly impacts real-time performance), so we have to adjust all the assets and decrease their geometric complexity.

103.016 thousand triangles [left] 40.372 thousand triangles [right]


The second model of this chair has 60% fewer triangles compared to the first model, which allows us to use two chairs at the computational price of just one. The visual dissimilarity is almost nonexistent, but the performance gained is immense. Imagine a scene where there are hundreds of instances of the same asset, optimization is a trivial process to achieve high FPS rates and ensure an uncomplicated run-time experience. We optimize about 450 objects by hand.


The second reason are in the materials and textures that accompany these assets. The materials are incompatible with Unreal and need to be rebuilt from scratch. The textures, in turn, rarely have the right dimensions for Unreal, these being 2 n, that is, the resolutions of the textures need to be in power of two, like: 16², 32², 64², 128², 256², 512², 1024², 2048² and 4096². Unreal does not like textures in which the resolution is not in power of two. The reason for this is due to the way graphic cards deal with images in memory. Using textures with different resolutions causes undesirable visual problems with the material. We use Photoshop to match the proportions of the images.


For example, a black and white zig-zag texture applied to a Utah Teapot:

511x511 [left] and 512x512 [right]


Apparently no problem right? But it is visible when we increase UV tiling:

511x511 [left] and 512x512 [right]


Even more apparent when we take a Screenshot from the Unreal Editor:

511x511 [left] and 512x512 [right]


The texture gets grainy at the corners.


MATERIALS

95% of all the materials in the scene are built from a Master Material, which can be instantiated and parameterized easily, in addition to being compiled much faster. Our Master Material simply parameterizes the Specular, Roughness and Metallic values, as well as parameterizing the textures for Albedo, Normal and Ambient Occlusion.


We used ShaderMap and Crazybump to create Normal Maps and Ambient Occlusion from the Albedo texture.


We do not use materials directly from Vray, Corona or 3DS Max Studio, conversions never show satisfactory results and always end up disrupting the creation process. Create your own materials within Unreal.


We will not show the Master Material here in this article because we plan to develop a tutorial focused only on it, but we will show some values for each type of material in the scene:


Fabric:



Roughness: 0.88 ≤ x ≤ 1.0, we used 0.9 in the material in the image.

Specular: 0.45 ≤ x ≤ 1.0, we used 0.5 in the material in the image.


1024x1024 Normal Map [left] and 1024x1024 Albedo [right]


Leather:


Roughness: 0.2 ≤ x ≤ 0.7, we used 0.375 in the material in the image.


In the leather of the brown chair we use as Base Color 170700FF (value in Linear Hex) and we multiply by a dirt texture, thus we create an irregularity in the color of the material.


Normal Map 1024x1024 [left] and Dirt Texture 2048x2048 [right]


Steel:



Base Color: 0.0 ≤ x ≤ 1.0, we used 0.75 in the material in the image.

Roughness: 0.15 ≤ x ≤ 0.4, we used 0.25 in the material in the image.

Metallic: 1.0, never under any circumstances use any value other than 0.0 or 1.0, the idea behind this parameter is just being a Boolean value, the material is metallic or the same is non-metallic.


Wood:



Roughness: 0.375 ≤ x ≤ 0.8, we used 0.5 in the material in the image.


Albedo 4096x4096 [left] and Normal Map 4096x4096 [right]


The Specular value for all materials is 0.5.


LIGHTING



The most important part to make a realistic scene is undoubtedly the lighting. For this we use a Skylight with an HDRI from VizPark, Skydome_14.hdr.


Skylight settings:


We increased the intensity of the skylight to 1.2 and the intensity of the indirect lighting to 2.0, so we were able to light up even the darkest parts of the scene.