New iteration with materials

This commit is contained in:
sergi-e 2020-04-28 19:19:06 +02:00 committed by bernat
parent e4601a6d73
commit d018039e0d
20 changed files with 166 additions and 52 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -1,46 +0,0 @@
# How to link Epic's Automotive Materials
!!! important
Since version 0.8.0 CARLA does not use Epic's _Automotive Materials_ by
default. However, you can still enable them if you compile from source.
Epic Game's provides a set of realistic _Automotive Materials_ free to use. In
this document we explain how to download and link these materials to our
vehicles for a more realistic car paint.
---
## Download from Marketplace
Epic Games' [Automotive Materials][automatlink] package can be downloaded for
free from the Unreal Engine Marketplace.
!!! note
Unfortunately Linux based machines don't have official support for Epic Game Store / Unreal Marketplace. In order to access the purchased assets download [this Java Package](https://github.com/neutrino-steak/UE4LinuxLauncher).
1. Install Epic Games Launcher from [www.unrealengine.com](https://www.unrealengine.com).
2. Buy the [Automotive Materials][automatlink] package for $0.
3. Create a new dummy project and add the Automotive Materials package to it.
4. Inside the "Content" folder of the newly created project, you can find the
"AutomotiveMaterials" folder. Copy this folder to the CARLA project
- `{NewProject}/Content/AutomotiveMaterials` --> `{CARLA}/Unreal/CarlaUE4/Content/AutomotiveMaterials`
[automatlink]: https://www.unrealengine.com/marketplace/automotive-material-pack
---
## Manually link the materials
Right after opening the project, you should link the automotive materials you
just downloaded.
In the content browser, go to
"Content/Static/Vehicles/GeneralMaterials/MaterialRedirectors" and open
"RedirectorInstance".
![Unreal Engine Screenshot 1](img/materials_screenshot_00.png)
Under the "Details" pane, search for the "Parent" material, and replace
"DummyCar" material by "M_Carpaint" material.
![Unreal Engine Screenshot 2](img/materials_screenshot_01.png)
Now save "RedirectorInstance", and you are ready to go.

View File

@ -38,7 +38,7 @@ The blueprint __BP_RepSpline__ adds __individual__ elements along the path defin
* __Offset translation__ — Set a range of random locations along the different axis.
* __Max Number of Meshes__ — Set the maximum amount of elements that will be place between nodes of the curve.
* __World aligned ZY__ — If selected, the elements will be vertically aligned regarding the world axis.
* __Place Mesheson Points__ — If selected, an element will be added in the ending node of the curve.
* __EndPoint__ — If selected, an element will be added in the ending node of the curve.
* __Collision enabled__ — Set the type of collisions enabled for the meshes.
![bp_repspline_pic](img/map_customization/BP_Repspline.jpg)
@ -101,11 +101,10 @@ These key meshes can be percieved as pieces of the building's structure. They ca
* __Base__ — The ground floor of the building.
* __Body__ — The middle floors of the building.
* __Roof__ — The highest floor of the building.
* __Top__ — The highest floor of the building.
* __Roof__ — Additional mesh that used to fill the spaces in the middle of the top floor.
For each of them, there is a mesh to fill the center of the floor, and a __Corner__ mesh that will be placed on the sides of the floor. Additionally, the __Roof__ mesh will be the center piece on top of the building.
The following picture represents the global structure.
For each of them, except the __Roof__, there is a mesh to fill the center of the floor, and a __Corner__ mesh that will be placed on the sides of the floor. The following picture represents the global structure.
![bp_procedural_building_visual](img/map_customization/BP_Procedural_Building_Visual.jpg)
<div style="text-align: right"><i>Visualization of the building structure.</i></div>

View File

@ -0,0 +1,161 @@
# Material customization
The CARLA team prepares every asset to run under certain default settings. However, users that work in a build from source can modify these to best suit their needs.
* [__Car materials__](#car-materials)
* [Customize car materials](#customize-car-materials)
* [Exterior properties](#exterior-properties)
* [__Building material__](#building-material)
* [__Customize a building material__](#customize-a-building-material)
!!! Important
This tutorial only applies to users that work with a build from source, and have access to the Unreal Editor.
---
## Car materials
In CARLA, there is a set of master materials that are used as templates for the different parts of the vehicle. An instance of these is created for each vehicle model, and then changed to the desired result. The master materials can be found in `Content/Carla/Static/GenericMaterials/Vehicles`, and these are the following.
![materials_master](img/material_customization/Materials_Master.png)
<div style="text-align: right"><i>Master materials applied to cars.</i></div>
* __M_CarExterior_Master__ — Material applied to the body of the car.
* __M_CarInterior_Master__ — Material applied to the inside of the car.
* __M_CarLightsGlass_Master__ — Material applied to the glass covering car lights.
* __M_CarWindows_Master__ — Material applied to the windows.
* __M_CarLicensePlate_Master__ — Material applied to the license plate.
* __M_CarVehicleLights_Master__ — Material applied to the base the car lights.
* __M_CarVehicleLigthsSirens_Master__ — Material applied to the sirens, if applicable.
For each of these materials, a texture is used, designed using the following references.
![materials_references](img/material_customization/Materials_References.png)
<div style="text-align: right"><i>References to create car textures.</i></div>
Additionally, texture used for vehicle lights follows also a specific reference.
![materials_vehiclelights](img/material_customization/Materials_VehicleLights02.jpg)
---
## Customize car materials
Create instances of the master materials and store them in the corresponding folder for the new model. Here is an example of the instances created for the police car available in the blueprint library, *vehicle.dodge_charger.police*.
![materials_instances](img/material_customization/Materials_Instances.png)
<div style="text-align: right"><i>Instanced materials for the police car blueprint.</i></div>
Generic documentation for materials and how to work with them can be found in the [UE Docs](https://docs.unrealengine.com/en-US/Engine/Rendering/Materials/index.html). All the materials can be modified to a great extent, but only the exterior one has properties worth mentioning. Others have certain properties that can be changed, such as opacity and color in glass materials, but it is not recommended to do so, except for specific purposes.
### Exterior properties
The exterior material is applied to the body of the car, and it is the one that can be customized the most.
* __Base color__ — Base color of the bodywork.
* __Tint shade__ — Tint color which visibility varies depending on the angle of visualization.
![materials_Tint](img/material_customization/Materials_Tint.jpg)
<div style="text-align: right"><i>Red car with pink tint. On the left, tint is disabled, on the right, enabled.</i></div>
* __Dust__ — A texture of dirt applied to the car. Dust is mean to pile on top of the car, and it is barely noticeable in the bottom parts.
* `Amount` — Opacity of the texture.
* `Color` — Base color of the dust texture.
* `Tiling` — Size and repetition of the dust texture pattern.
* `Thickness` — Density of the dust.
* `Roughness` — Decrease of the car's metallic reflections due to dust.
![materials_Dust](img/material_customization/Materials_Dust.png)
<div style="text-align: right"><i>Dust property in a car's material.</i></div>
* __Flakes__ — Sparkling flakes to the metallic paint of the ca.
* `On/Off` — Enables or disables the feature.
* `Scale` — Size of the flakes.
* `Brightness` — Intensity of the sparkle.
* `Color` — Base color of the particles.
![materials_Flakes](img/material_customization/Materials_Flakes.png)
<div style="text-align: right"><i>Flakes property in a car's material.</i></div>
* __Gain__ — Noise to the base paint of the car.
* __On/Off__ — Enables or disables the feature.
* __Scale__ — Size of the gain.
* __Color__ — Base color of the gain.
![materials_Gain](img/material_customization/Materials_Gain.png)
<div style="text-align: right"><i>Gain property in a car's material.</i></div>
* __Mud__ — A texture of mud applied to the car. Mud appears from the bottom to top of the car.
* `Height` — Portion of the car where mud appears.
* `Mud_Color` — Base color of the mud texture.
* `Mud_Tiling` — Size and repetition of the mud texture pattern.
* `Mud_Thickness` — Density of the mud.
![materials_mude](img/material_customization/Materials_Mud.png)
<div style="text-align: right"><i>Mud property in a car's material.</i></div>
* __Noise__ — Noise applied to the normal of the material. Creates an orange peel effect.
* `On/Off` — Enables or disables the feature.
* `Scale` — Size of the bumps created by the alteration of the normal map.
![materials_noise](img/material_customization/Materials_Noise.png)
<div style="text-align: right"><i>Noise property in a car's material.</i></div>
* __Surface__ — Gloss and transparent coating applied to the vehicle's paint. This last step in [automotive paint](https://en.wikipedia.org/wiki/Automotive_paint).
* `ClearCoat` — Opacity of the coating.
* `ClearCoat_Brightness` — Glossiness of the resulting material.
* `ClearCoat_Metallic` — Reflection of the resulting material.
![materials_Surface](img/material_customization/Materials_Surface.png)
<div style="text-align: right"><i>Visualization of the Surface coating applied to a material.</i></div>
---
## Building materials
The materials applied to buildings are made of four basic textures that are combined to determine the basic properties of the material.
* __Diffuse__ — Contains the basic painting of the material.
* `RGB` — Channels with the base colors.
* `Alpha` — This channel defines a mask that allows to modify the color of the portions in white. This is useful to create some variations from the same material.
* __ORME__ — Maps different properties of the material using specific channels.
* `Ambient occlusion` — Contained in the `R` channel.
* `Roughness` — Contained in the `G` channel.
* `Metallic map` — Contained in the `B` channel.
* `Emissive mask` — Contained in the `Alpha` channel. This mask allos to change the emissive color and intensity of the portions in white.
* __Normal__ — Contains the normal map of the material.
* `RGB` — The normal map information.
* __Emissive__ — If applicable, this texture is used to set the emissive base colors of the texture.
* `RGB` — Mask that sets emissive colors for portions painted with other than black.
---
## Customize a building material
Similarly to car materials, a building material can be greatly changed if desired, but it is only recommended if the user has some expertise with Unreal Engine. However, there is some customization available for the two main shaders that buildings use.
* __Glass shader__ — Who uses this??? .
> Properties???
* __Material shader__ — Who uses this???.
* `Change Color` — Enable color changes on the white area on the __Diffuse__ `Alpha` texture.
* `Color` — Tint to be applied based on the white area on the __Diffuse__ `Alpha` texture.
* `Emissive Texture` — Enable the usage of an __Emissive__ texture.
* `EmissiveColor` — Tint to be applied based on the white area on the __ORME__ `Emissive mask` texture.
* `Emissive atenuance` — Intensity of the emissive texture.
* `RoughnessCorrection` — Changes the intensity of the roughness map.
* `MetallicCorrection` — Changes the intensity of the metallic map.
* `NormalFlatness` — Changes the intensity of the normal map.
---
That is a wrap on the most remarkable ways users can customize the materials of vehicles and buildings.
Any doubts that may arise are more than welcomed in the forum.
<div class="build-buttons">
<p>
<a href="https://forum.carla.org/" target="_blank" class="btn btn-neutral" title="Go to the CARLA forum">
CARLA forum</a>
</p>
</div>

View File

@ -54,7 +54,7 @@ nav:
- 'Add new props': 'tuto_A_add_props.md'
- 'Create standalone packages': 'tuto_A_create_standalone.md'
- 'Map customization tools': 'tuto_A_map_customization.md'
- "Use Epic's Automotive materials": 'tuto_A_epic_automotive_materials.md'
- "Material customization": 'tuto_A_material_customization.md'
- 'Vehicle modelling': 'tuto_A_vehicle_modelling.md'
- Tutorials (developers):
- 'Contribute with assets': 'tuto_D_contribute_assets.md'