Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Custom Mesh Import Guide: Difference between revisions

How to import custom meshes into DL2
m removed content as this was more or less a showcase, will revise it today
Tag: Blanking
mNo edit summary
Tag: Manual revert
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
This guide explains how to import meshes into Dying Light 2's C Engine, set up materials, add skins, and optimize complex meshes for better performance.
=== Prerequisites ===
<big>{{Font color|red|Before we start, you need the following prerequisites in order to import meshes:}}</big>
* {{Font color|yellow| Dying Light 1 Developer Tools }}
* {{Font color|yellow| Dying Light 2 Developer Tools}}
* {{Font color|yellow| Textures that are in .png image files and have a power of 2 (for example, 1024 1024, 2048 2048 etc, all must be perfectly divisible by the number two without resulting in decimals)}}
* {{Font color|yellow| A text editing program, for example the default windows notepad or notepad++}}


=== Step one ===
For the first step we will be importing our mesh into Dying Light 1's Chrome Engine 6
Open up Dev-Tools of Dl1 and head to this section in order to import meshes</big>
[[File:Import meshes teo guide.png|700px|frameless]]
Once you click the import assets button, this window will greet you
[[File:Import meshes window teo guide.png|700px|frameless]]
You need an .fbx model file in order to import meshes into this engine, and from this window you can select the one that you want to import.
<big>{{Font color|red|Some things to keep in mind:}}</big>
In blender you must make sure that there are no dots anywhere in the material name.
You '''must''' also give the material a unique name just incase so that it '''does not''' collide with in game materials.
[[File:Blender window teo guide.png|700px|frameless]]
A '''good trick''' to do this is to follow a naming convention of your own, for example you can see how this shield material is called "dl_gt_heatershield_a", the "dl_gt" part is simply a short form of my project name which is Dying Light: Gothic.
After you click open on the .fbx file this window will appear
[[File:Window teo guide.png|700px|frameless]]
You don't have to do anything here, just simply click the ok button at the bottom.
After that you can search up the name of your mesh and find it in the browser like this.
[[File:Window teo guide mesh browser.png|700px|frameless]]
'''Right click''' on it and select '''"Show in Explorer"'''
The steps to do in Dying Light 1's CE6 are complete, now we can focus on setting up materials of the mesh inside Dying Light 2's C Engine.
=== Step two ===
Now you must select these three files of your mesh from the explorer.
[[File:Teo guide1.png|frameless]]
the .dmt file, .msh file and .skn file.
Copy and paste this in your Dying Light 2's project folder, for example
[[File:Teo guide2.png|700px|frameless]]
I suggest adding a folder here for your custom meshes in order to keep things organized, however its not a necessary step.
[[File:Teo guide3.png|700px|frameless]]
Once this is done, copy paste your .dmt, .msh and .skn file into the folder
[[File:Teo guide4.png|700px|frameless]]
now you '''must''' change the .dmt file by renaming it to .mat
[[File:Teo guide5.png|700px|frameless]]
Open your .mat file, '''delete all contents''' inside it and then open one of these mat file templates that I created, copy the contents of them into yours:
{{Font color|orange|MATERIAL FOR WEAPONS OR ITEMS THAT PLAYER HOLDS IN HANDS}}
{{CustomFileWrapper
| filename = Dl gt heatershield a.mat
}}
{{Font color|purple|Supported texture sets for this one:}} Diffuse/Base Color, Normal, Roughness, Specular
<big><big>OR</big></big>
{{Font color|orange|MATERIAL FOR WALLS OR VERTICAL SURFACES THAT SUPPORT REPEATING TEXTURES}}
{{CustomFileWrapper
| filename = Dl ren archbasewall red.mat
}}
{{Font color|purple|Supported texture sets for this one:}} Depth (or heightmap that can be used for Parallax Occlusion Mapping to fake displacement)Diffuse/Base Color, Normal,
Roughness, Specular
<big><big>OR</big></big>
{{Font color|orange|MATERIAL FOR HIGH QUALITY GROUND SURFACES THAT HAVE DISPLACEMENT}}
{{CustomFileWrapper
| filename = Dl ren archbase wall white.mat
}}
{{Font color|purple|Supported texture sets for this one:}} Depth (or heightmap that can be used for Parallax Occlusion Mapping to fake displacement)Diffuse/Base Color, Normal,
Roughness, Specular
<big><big>OR</big></big>
{{Font color|orange|MATERIAL FOR MESHES THAT HAVE OPACITY OR CLIPPING TEXTURES }}
{{CustomFileWrapper
| filename = Dl ren shield deco.mat
}}
{{Font color|purple|Supported texture sets for this one:}} Clp(Black and white texture, should only have black and white information and no greyish texture), Diffuse/BaseColor, Normal,
Roughness
Once you have selected the type of material you want and have copy pasted the templates it '''should''' look like this:
[[File:Teo guide6.png|700px|frameless]]
Please '''note''' that you don't have to do anything to the mat file at this point, leave the template as it is and follow the next steps where we directly edit the file through C Engine's Material Editor.
At this stage you must also add your textures of the mesh into the meshes folder, I have done it like this:
[[File:Teo guide7.png|700px|frameless]]
<big>{{Font color|red|Important note:}}</big>
For your textures you must follow Techland's naming convention of textures in order for them to appear inside the material editor easily. For example, Diffuse textures will have _dif at the end, normal textures will have _nrm at the end etc. And it must be a .png file.
Once this part is done, open up your C Engine project and search for your mesh. As you can see here, it is currently invisible, this is normal.
[[File:Teo guide8.png|700px|frameless]]
To make the material work, go to windows and add "Asset inspector"
[[File:Teo guide 9.png|700px|frameless]]
Your asset inspector should look like this while your mesh is selected:
[[File:Teo guide 10.png|700px|frameless]]
Double click on your mat name in order to open the material editor
[[File:Teo guide 11.png|500px|frameless]]
Inside the material editor simply click the plus icon to make your material work
[[File:Teo guide 12.png|700px|frameless]]
Now we must add textures in this stage
[[File:Teo guide 13.png|700px|frameless]]
Click the 3 dots icon to browse for your textures and add them one by one
[[File:Teo guide 14.png|700px|frameless]]
As can be seen, now the mesh and the material is perfectly working.
[[File:Teo guide 15.png|500px|frameless]]
If you have clp textures you have to copy paste its name over here in the "Mask" section
[[File:Teo guide 16.png|500px|frameless]]
Note that not all of the features work inside the material editor as of the time this is being written. Only this section here is somewhat functional.
[[File:Teo guide 17.png|700px|frameless]]
Now we will move onto how we can add skins to our custom meshes and how we can optimize the meshes for more performance.
{{Font color|red|POTENTIAL BUGS WITH MESH IMPORT AND HOW TO FIX THEM }}
{{Font color|yellow|Invisible meshes while playtesting:}}
Click the red "Needs Build" button and select these options, start building.
[[File:Teo guide 18.png|700px|frameless]]
[[File:Teo guide 19.png|700px|frameless]]
Now the meshes should be visible and working during play testing. 
{{Font color|purple|ADDING SKINS:}}
This section is still being worked on, due to some bugs it is a bit difficult to make this guide)
{{Font color|purple|OPTIMIZATION:}}
Still being worked on, but very in depth as well
[[Category:Dying Light 2]]
[[Category:DevTools]]
{{CustomDescription|How to import custom meshes into DL2}}

Latest revision as of 23:23, 5 March 2025

This guide explains how to import meshes into Dying Light 2's C Engine, set up materials, add skins, and optimize complex meshes for better performance.

Prerequisites

Before we start, you need the following prerequisites in order to import meshes:

  • Dying Light 1 Developer Tools
  • Dying Light 2 Developer Tools
  • Textures that are in .png image files and have a power of 2 (for example, 1024 1024, 2048 2048 etc, all must be perfectly divisible by the number two without resulting in decimals)
  • A text editing program, for example the default windows notepad or notepad++

Step one

For the first step we will be importing our mesh into Dying Light 1's Chrome Engine 6

Open up Dev-Tools of Dl1 and head to this section in order to import meshes

Once you click the import assets button, this window will greet you

You need an .fbx model file in order to import meshes into this engine, and from this window you can select the one that you want to import.

Some things to keep in mind:

In blender you must make sure that there are no dots anywhere in the material name. 
You must also give the material a unique name just incase so that it does not collide with in game materials.

A good trick to do this is to follow a naming convention of your own, for example you can see how this shield material is called "dl_gt_heatershield_a", the "dl_gt" part is simply a short form of my project name which is Dying Light: Gothic.

After you click open on the .fbx file this window will appear

You don't have to do anything here, just simply click the ok button at the bottom.

After that you can search up the name of your mesh and find it in the browser like this.

Right click on it and select "Show in Explorer"

The steps to do in Dying Light 1's CE6 are complete, now we can focus on setting up materials of the mesh inside Dying Light 2's C Engine.

Step two

Now you must select these three files of your mesh from the explorer.

the .dmt file, .msh file and .skn file.

Copy and paste this in your Dying Light 2's project folder, for example

I suggest adding a folder here for your custom meshes in order to keep things organized, however its not a necessary step.

Once this is done, copy paste your .dmt, .msh and .skn file into the folder

now you must change the .dmt file by renaming it to .mat

Open your .mat file, delete all contents inside it and then open one of these mat file templates that I created, copy the contents of them into yours:

MATERIAL FOR WEAPONS OR ITEMS THAT PLAYER HOLDS IN HANDS


Download: Dl gt heatershield a.mat


Supported texture sets for this one: Diffuse/Base Color, Normal, Roughness, Specular

OR

MATERIAL FOR WALLS OR VERTICAL SURFACES THAT SUPPORT REPEATING TEXTURES


Download: Dl ren archbasewall red.mat


Supported texture sets for this one: Depth (or heightmap that can be used for Parallax Occlusion Mapping to fake displacement)Diffuse/Base Color, Normal, Roughness, Specular

OR

MATERIAL FOR HIGH QUALITY GROUND SURFACES THAT HAVE DISPLACEMENT


Download: Dl ren archbase wall white.mat


Supported texture sets for this one: Depth (or heightmap that can be used for Parallax Occlusion Mapping to fake displacement)Diffuse/Base Color, Normal, Roughness, Specular

OR

MATERIAL FOR MESHES THAT HAVE OPACITY OR CLIPPING TEXTURES


Download: Dl ren shield deco.mat


Supported texture sets for this one: Clp(Black and white texture, should only have black and white information and no greyish texture), Diffuse/BaseColor, Normal, Roughness

Once you have selected the type of material you want and have copy pasted the templates it should look like this:

Please note that you don't have to do anything to the mat file at this point, leave the template as it is and follow the next steps where we directly edit the file through C Engine's Material Editor.

At this stage you must also add your textures of the mesh into the meshes folder, I have done it like this:

Important note:

For your textures you must follow Techland's naming convention of textures in order for them to appear inside the material editor easily. For example, Diffuse textures will have _dif at the end, normal textures will have _nrm at the end etc. And it must be a .png file.

Once this part is done, open up your C Engine project and search for your mesh. As you can see here, it is currently invisible, this is normal.

To make the material work, go to windows and add "Asset inspector"

Your asset inspector should look like this while your mesh is selected:

Double click on your mat name in order to open the material editor

Inside the material editor simply click the plus icon to make your material work

Now we must add textures in this stage

Click the 3 dots icon to browse for your textures and add them one by one

As can be seen, now the mesh and the material is perfectly working.

If you have clp textures you have to copy paste its name over here in the "Mask" section

Note that not all of the features work inside the material editor as of the time this is being written. Only this section here is somewhat functional.

Now we will move onto how we can add skins to our custom meshes and how we can optimize the meshes for more performance.

POTENTIAL BUGS WITH MESH IMPORT AND HOW TO FIX THEM

Invisible meshes while playtesting:

Click the red "Needs Build" button and select these options, start building.

Now the meshes should be visible and working during play testing.

ADDING SKINS: This section is still being worked on, due to some bugs it is a bit difficult to make this guide)

OPTIMIZATION: Still being worked on, but very in depth as well


Cookies help us deliver our services. By using our services, you agree to our use of cookies.