Setting Up Landscapes (Killing Floor 2): Difference between revisions
Delta-ranger (talk | contribs) (Guide Added - Images Coming in next edit.) |
Delta-ranger (talk | contribs) (Warning Banner on Bugged Feature added) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{WarningBanner}} | |||
[[Category:KF2]] | |||
== Introduction == | == Introduction == | ||
This page will give a comprehensive guide to implementing landscapes into your map and editing them. It will also provide some workarounds for some of the limitations of the current system. | This page will give a comprehensive guide to implementing landscapes into your map and editing them. It will also provide some workarounds for some of the limitations of the current system. | ||
In this documentation we will be using 'Landscapes' instead of 'Terrains'. Although we can refer to them representing the same thing, they are actually completely different systems within the SDK. The Terrain system is an early UDK implementation and does not contain as many features as the Landscape system and should be avoided for KF2. | In this documentation we will be using 'Landscapes' instead of 'Terrains'. Although we can refer to them representing the same thing, they are actually completely different systems within the SDK. The Terrain system is an early UDK implementation and does not contain as many features as the Landscape system and should be avoided for KF2. You can toggle the Landscape on and off by pressing 'T'. | ||
Please refer to the technical documentation for further understanding of the system: https://api.unrealengine.com/udk/Three/Landscape.html | Please refer to the technical documentation for further understanding of the system: https://api.unrealengine.com/udk/Three/Landscape.html | ||
== Step 1 - Creating a Landscape == | == Step 1 - Creating a Landscape == | ||
{{Col-begin}} | |||
{{Col-break|width=70%}} | |||
Click on the Landscape Mode. This will prompt you with options for creating Landscapes, chose what size you want and plug the corresponding values into the prompt. '''See Figure 1.1'''. | Click on the Landscape Mode. This will prompt you with options for creating Landscapes, chose what size you want and plug the corresponding values into the prompt. '''See Figure 1.1'''. | ||
The UDK documentation provides us with optimal sizes to create a landscape for the best performance in your map. '''''You should use these and not custom sizes'''''. Below are the recommended sizes for KF2 maps: | The UDK documentation provides us with optimal sizes to create a landscape for the best performance in your map. '''''You should use these and not custom sizes'''''. Below are the recommended sizes for KF2 maps: | ||
{| class="wikitable" style="width: | {| class="wikitable" style="width:100%;" | ||
|- | |- | ||
! scope="col" | Size (vertices) | ! scope="col" | Size (vertices) | ||
Line 61: | Line 66: | ||
* From the documentation: | * From the documentation: | ||
<blockquote>''"Each component has a render-thread CPU processing cost and each section is a draw call, so try to keep these number to a minimum.''" [https://api.unrealengine.com/udk/Three/LandscapeCreating.html#Performance%20Considerations | <blockquote>''"Each component has a render-thread CPU processing cost and each section is a draw call, so try to keep these number to a minimum.''" [https://api.unrealengine.com/udk/Three/LandscapeCreating.html#Performance%20Considerations [Source]]</blockquote> | ||
{{Col-break|width=30%}} | |||
[[File:LandscapeCreation.png|500 px|thumb|'''Figure 1.1:''' Options for creating the Landscape - plug the corresponding values from the table into here.]] | |||
{{Col-end}} | |||
== Step 2 - Adding a Material == | == Step 2 - Adding a Material == | ||
{{Col-begin}} | |||
{{Col-break|width=70%}} | |||
Once the landscape is created you will need to give it a material. The materials that we use will be based off the ''LMAT_BlackForest_LandscapeMaterialBase'' Parent Material. Here are the following materials that are currently available for you to use from the official Maps: | Once the landscape is created you will need to give it a material. The materials that we use will be based off the ''LMAT_BlackForest_LandscapeMaterialBase'' Parent Material. Here are the following materials that are currently available for you to use from the official Maps: | ||
Line 89: | Line 100: | ||
***** '''''LMAT_ENV_ZedLanding_LandscapeMaterialBase_MIC''' (uses a different parent material - so some of the steps with Layers below will not apply)'' | ***** '''''LMAT_ENV_ZedLanding_LandscapeMaterialBase_MIC''' (uses a different parent material - so some of the steps with Layers below will not apply)'' | ||
Select the material that closest represents to textures you wish to use and assign it to the ''Landscape > Landscape Material'' property of your Landscape. '''See Figure 1.2'''. You will notice the Landscape turn black and distort funny in Lit Mode within the viewport. This is because | Select the material that closest represents to textures you wish to use and assign it to the ''Landscape > Landscape Material'' property of your Landscape. '''See Figure 1.2'''. You will notice the Landscape turn black and distort funny in Lit Mode within the viewport. This is because the Landscape has not been painted yet, and first we need to set it up so we can: | ||
# Within the Landscape Window, scroll down to the ''Target Layer'' and select the ''Edit'' radio button. | # Within the Landscape Window, scroll down to the ''Target Layer'' and select the ''Edit'' radio button. | ||
# Under the ''Add New Layer'' section there is a text field that you | # Under the ''Add New Layer'' section there is a text field that allows you to use a named layer to create paintable texture layer. The Landscape material uses 5 named channels to determine what texture to use. Type in one of the following below and then press the '+' Button. '''See Figure 1.3'''. | ||
##Layer 1 - '''Grass''' | ##Layer 1 - '''Grass''' | ||
##Layer 2 - '''Dirt''' | ##Layer 2 - '''Dirt''' | ||
Line 100: | Line 111: | ||
# Click on the 'None' radio button once you are finished. | # Click on the 'None' radio button once you are finished. | ||
We can now move on to | We can now move on to editing and painting our Landscape. | ||
If the Landscape materials provided do not offer what you are looking for, you will need to create a new Material Instance Constant (MIC) and edit it exactly the same you would with any other MIC. The layers you edit will correspond to the names listed above. It is recommended to make the MIC from the Black Forest material. | If the Landscape materials provided do not offer what you are looking for, you will need to create a new Material Instance Constant (MIC) and edit it exactly the same you would with any other MIC. The layers you edit will correspond to the names listed above. It is recommended to make the MIC from the Black Forest material. | ||
{{Important|Any modifications you make to your MIC AFTER you paint your Landscape may require you to repaint the ENTIRE Landscape again. Not doing so can result in your Landscape having the default checker pattern. This will only show up in the actual game, the SDK will not notify you of this. You may not need to do it if you are simply replacing textures, but if you adding and removing layers you will definitely need to repaint.}} | |||
{{Col-break|width=30%}} | |||
[[File:LandscapeMaterialAdd.png|500 px|thumb|'''Figure 1.2:''' Assigning a Material to Landscape Properties. The black trippy effect is normal, it will go away when we paint on to it.]] | |||
[[File:LandscapeLayers.png|500 px|thumb|'''Figure 1.3:''' Input Layer names here.]] | |||
{{Col-end}} | |||
== Step 3 - Editing == | == Step 3 - Editing == | ||
Make sure the ''Paint'' option is selected under ''Paint Tools'', then select one of the Layers we just created. Move over to your Landscape and press ''Ctrl + Left Click'' this will paint your Landscape with the desired layer. We can adjust the brush strength, size and falloff indicated in '''Figure 1.4'''. | {{Col-begin}} | ||
{{Col-break|width=70%}} | |||
Make sure the ''Paint'' option is selected under ''Paint Tools'', then select one of the Layers we just created. Move over to your Landscape and press ''Ctrl + Left Click'', this will paint your Landscape with the desired layer. We can adjust the brush strength, size and falloff indicated in '''Figure 1.4'''. | |||
Editing the height of the Landscape is done in the exact same manner, we just use the 'Height map' Layer instead of the ones we created earlier. ''Ctrl + Left Click'' will add | Editing the height of the Landscape is done in the exact same manner, we just use the 'Height map' Layer instead of the ones we created earlier. ''Ctrl + Left Click'' will add height and ''Ctrl + Shift + Left Click'' will subtract height. There are a number other tools here that we can mess with to 'Smooth' or 'Flatten' the edges and even tools to generate randomness in the ground.<br /><br /> | ||
This should be all you need to know to use Landscapes for your Map! | '''This should be all you need to know to use Landscapes for your Map!'''<br /><br /> | ||
{{Warning| One tool you should not use is the 'Visibility' tool. Although it will work in the Editor, when you go to the Content Browser and scroll through your map the SDK will crash. This is an issue with the public branch of the SDK. The internal branch does not have this issue and for whatever reason, the patch has not been pushed to the public branch. | |||
Nearly all official maps use the Visibility Tool, so it is uncertain why this has not been addressed. If you require your map to have cut-out parts of it (for things such as a hole, cave or just because otherwise it would intersect with the map), you will need to employ the tactics in the section below. | |||
Bug Report Thread: https://forums.tripwireinteractive.com/forum/killing-floor-2/technical-support-ae/the-bug-report-ae/2319227-sdk-content-browser-bugsplat-with-use-of-landscape-visibility-tool}} | |||
{{Col-break|width=30%}} | |||
[[File:LandscapeEditTools.png|500 px|thumb|'''Figure 1.4:''' Yellow - Tools to Edit our Landscape. Red - Brush properties we can edit. Do not use the Visibility Tool crossed out.]] | |||
{{Col-end}} | |||
== Working Around Visibility and Vertex Painting == | == Working Around Visibility and Vertex Painting == | ||
{{Col-begin}} | |||
{{Col-break|width=70%}} | |||
{{Warning|This section will be using some more advanced techniques that require some external prerequisites including how to use a 3D Modelling Program and basic understanding of Material creation. If you are just starting out in the editor it is recommended to avoid map design that is overly complex or the techniques discussed below.}} | |||
Basically, we are going to export the Landscape mesh, edit it in our 3D modelling program of choice (I will be using Blender here) and reimporting it as a StaticMesh back into the Map. We will then use Vertex Painting to paint the mesh. | Basically, we are going to export the Landscape mesh, edit it in our 3D modelling program of choice (I will be using Blender here) and reimporting it as a StaticMesh back into the Map. We will then use Vertex Painting to paint the mesh. | ||
Aside from just using it as a workaround for the Visibility tool bug, you can use it for small pieces of land in your map that would look more naturally formed. Eg: The snowy sections in Outpost and Krampus Lair, or the grass/courtyard in Manor. These are usually small enough to not require the extra processing used to calculate LOD for Landscapes. | Aside from just using it as a workaround for the Visibility tool bug, you can use it for small pieces of land in your map that would look more naturally formed. Eg: The snowy sections in Outpost and Krampus Lair, or the grass/courtyard in Manor. These are usually small enough to not require the extra processing used to calculate LOD for Landscapes. | ||
{{Col-break|width=30%}} | |||
{{Col-end}} | |||
=== Exporting from SDK === | === Exporting from SDK === | ||
We are going to start off assuming that you have already created a landscape and have sculpted the heightmap for it. You should make | {{Col-begin}} | ||
{{Col-break|width=70%}} | |||
We are going to start off assuming that you have already created a landscape and have sculpted the heightmap for it. You should make the sculpt as close as you can estimate it in its final form. Any edits to the Landscape will need be done in the modelling program of choice, or restarting the below process if major edits are required. | |||
The SDK will not allow us export the landscape as a .FBX unfortunately. We will need to export it as an .OBJ. This will likely mean that our mesh scale will be much larger when we import it into Blender. However when we export, we also want to export any boundary meshes or relevant meshes that give us and indication on what we will need to remove/edit on the Landscape.Select all relevant meshes and go to File > Export > Selected Only... and export as an .OBJ. | The SDK will not allow us export the landscape as a .FBX unfortunately. We will need to export it as an .OBJ. This will likely mean that our mesh scale will be much larger when we import it into Blender. However when we export, we also want to export any boundary meshes or relevant meshes that give us and indication on what we will need to remove/edit on the Landscape. Select all relevant meshes and go to File > Export > Selected Only... and export as an .OBJ. Do not include an textures/materials if it asks you, we wont need it. | ||
Afterwards just import the .OBJ into your | Afterwards just import the .OBJ into your modelling program. | ||
'''Figure 2.1''' shows the front courtyard of [https://steamcommunity.com/sharedfiles/filedetails/?id=1503129313 KF-Desolation], the Landscape was selected plus the additional meshes that aim to cover up parts of the Landscape. | '''Figure 2.1''' shows the front courtyard of [https://steamcommunity.com/sharedfiles/filedetails/?id=1503129313 KF-Desolation], the Landscape was selected plus the additional meshes that aim to cover up parts of the Landscape. | ||
{{Col-break|width=30%}} | |||
[[File:Blender_2018-10-20_16-51-48.png|500 px|thumb|'''Figure 2.1:''' Exported Landscape and boundary meshes into Blender]] | |||
{{Col-end}} | |||
=== Editing the Landscape to a Mesh === | === Editing the Landscape to a Mesh === | ||
{{Col-begin}} | |||
{{Col-break|width=70%}} | |||
If importing into Blender (might be the same for other programs), you will need to rescale all the meshes. Scaling it down by 0.01 gets it back into its actual mesh scale for KF2. | If importing into Blender (might be the same for other programs), you will need to rescale all the meshes. Scaling it down by 0.01 gets it back into its actual mesh scale for KF2. | ||
Take note, the exported Landscape will have it's pivot point set at the origin. This can be excellent in most cases, because we can instantly export it from Blender later, and when it is placed in the map we can set its Location to (0,0,0) and it will be in the exact same position we originally exported the Landscape from. You can of course can change the pivot point in case you want to align it with a mesh or specific position instead. | |||
Depending on the sort of Landscape you created you may need to remove any duplicate vertices and weld parts together. Go ahead and do that and do whatever you need to do to the landscape such as deleting the unneeded parts of the mesh or tweaking vertices. Once you have completed it. You will need to create 3 UV channels for the Mesh: | Depending on the sort of Landscape you created you may need to remove any duplicate vertices and weld parts together. Go ahead and do that and do whatever you need to do to the landscape such as deleting the unneeded parts of the mesh or tweaking vertices. Once you have completed it. You will need to create 3 UV channels for the Mesh: | ||
Line 147: | Line 178: | ||
* UV2 - Splatter Map | * UV2 - Splatter Map | ||
Most of time, these sections are usually flat and you can do perfectly well with a top planar projection for all the UVs. Just make sure to scale the UV0 so the textures will repeat appropriately. | |||
You do not need to create a collision mesh for this mesh as we'll change some settings | You do not need to create a collision mesh for this mesh as we'll change some settings after the import into UDK. | ||
'''Figure 2.2''' shows the final edited Mesh. When you are ready (in Blender) Select your edited Landscape only and go over to ''File > Export > FBX (.fbx)''. You can leave most the parameters default, however make sure you have set the following correct settings: | '''Figure 2.2''' shows the final edited Mesh. When you are ready (in Blender) Select your edited Landscape only and go over to ''File > Export > FBX (.fbx)''. You can leave most the parameters default, however make sure you have set the following correct settings: | ||
Line 158: | Line 189: | ||
When ready hit ''Export FBX''. | When ready hit ''Export FBX''. | ||
{{Col-break|width=30%}} | |||
[[File:Blender 2018-10-20 16-58-05.png|500 px|thumb|'''Figure 2.2:''' Edited Landscape. Left panel shows UV0 scale for texture]] | |||
{{Col-end}} | |||
=== Importing the new Landscape Static Mesh === | === Importing the new Landscape Static Mesh === | ||
Head back into the SDK and navigate to External > KF-YourMapName within the Content Browser (if it is not here, it is probably under NewPackages instead of External). Either right click the map name or within the Browser space and select Import..., find your exported FBX from Blender and import it in, you do not need to change any settings here (except maybe changing the name). You shouldn't get any errors when you hit OK (if a prompt says something along the line of smoothing groups make sure the export settings are set to Edge as mentioned previously). | {{Col-begin}} | ||
{{Col-break|width=70%}} | |||
Head back into the SDK and navigate to External > KF-YourMapName within the Content Browser (if it is not here, it is probably under NewPackages instead of External). Either right click the map name or within the Browser space and select ''Import...'', find your exported .FBX from Blender and import it in, you do not need to change any settings here (except maybe changing the name). You shouldn't get any errors when you hit OK (if a prompt says something along the line of smoothing groups make sure the export settings are set to Edge as mentioned previously). | |||
When the import is completed, you can open up the newly imported mesh and inspect to see if it is correct. To make sure we have collision for our new mesh, go to properties of the mesh and untick the following ('''See Figure 2.3'''): | When the import is completed, you can open up the newly imported mesh and inspect to see if it is correct. To make sure we have collision for our new mesh, go to properties of the mesh and untick the following ('''See Figure 2.3'''): | ||
Line 174: | Line 210: | ||
# Tweaking it in Blender and re-exporting using the same settings, '''''<u>NAME AND LOCATION</u>''''' (very important). | # Tweaking it in Blender and re-exporting using the same settings, '''''<u>NAME AND LOCATION</u>''''' (very important). | ||
# Right Clicking on the mesh in the SDK Content Browser and selecting Reimport Static Mesh. This will automatically reimport and update the mesh if the name and location didn't change, if not, you will have to relocate it. | # Right Clicking on the mesh in the SDK Content Browser and selecting Reimport Static Mesh. This will automatically reimport and update the mesh if the name and location didn't change, if not, you will have to relocate it. | ||
{{Col-break|width=30%}} | |||
[[File:CustomLandscapeCollision.png|500 px|thumb|'''Figure 2.3:''' Setting the collision for the imported Mesh]] | |||
{{Col-end}} | |||
=== Vertex Painting the Mesh === | === Vertex Painting the Mesh === | ||
Unfortunately we don't have the luxury of using the same Landscape materials to paint our new mesh, and creating a texture for it is not a realistic or sensible thing to do for it. | {{Col-begin}} | ||
{{Col-break|width=70%}} | |||
Unfortunately we don't have the luxury of using the same Landscape materials to paint our new mesh, and creating a texture for it is not a realistic or sensible thing to do for it. Our best and fastest option is to use Vertex Painting. Vertex painting is a technique where we paint Red, Green and Blue channels directly onto the mesh within the SDK. The R, G and B channels each contain their own texture/normal/look, and material simply blends them together based on their proximity to vertices; it works pretty much the same as Landscape painting with some additional limitations. The vertex painting also requires the mesh to be decently subdivided with vertices for better blending, luckily our landscape is already like this, so we do not need to change anything here. | |||
Here are some of the Vertex Paint materials in the SDK that you can use/base your material off: | Here are some of the Vertex Paint materials in the SDK that you can use/base your material off: | ||
Line 207: | Line 248: | ||
* Parent Materials [1] and [2] only use 2 channels for Vertex Painting, this is fine for small meshes that just need some slight texture variation like moss on stone or ruins | * Parent Materials [1] and [2] only use 2 channels for Vertex Painting, this is fine for small meshes that just need some slight texture variation like moss on stone or ruins | ||
* The [3] ''PM_Vertex_Paint_Complex'' has 3 channels for Vertex Painting, so it is more appropriate | * The [3] ''PM_Vertex_Paint_Complex'' has 3 channels for Vertex Painting, so it is more appropriate to use in Landscape meshes. | ||
Vertex painting works much the same as Landscape painting. | Vertex painting works much the same as Landscape painting. We first assign the material we want to use, then select the Mesh Paint Tool and in the prompt we have nearly the same options as Landscape painting. However, instead of working with Layers we now select a RGB channel to paint with. '''See Figure 2.4'''. We do not want to use the colour wheel, and instead just manually assign the channels instead. To correctly use Vertex Painting, use the settings also listed in Figure 2.4. | ||
You can turn on the Mesh Outline to help visualize where vertices are. Go to ''Flags Menu > Show > Advanced > Mesh Edges''. If your mesh is also very large, you can scale it down to make painting faster and reset it after you have finished. | You can turn on the Mesh Outline to help visualize where vertices are. Go to ''Flags Menu > Show > Advanced > Mesh Edges''. If your mesh is also very large, you can scale it down to make painting faster and reset it after you have finished. | ||
Vertex Painting will be saved per instance of the mesh that it is painted on to. However if you want to save it to the actual Static Mesh within the | Vertex Painting will be saved per instance of the mesh that it is painted on to. However if you want to save it to the actual Static Mesh within the Content Browser hit the button ''Copies instance vertex colors to the source mesh''. '''See Figure 2.5'''. | ||
{{Col-break|width=30%}} | |||
[[File:KFEditor 2018-10-20 17-26-13.jpg|500 px|thumb|'''Figure 2.4:''' Red - Mesh Paint Tool. Yellow - Keep these options. Blue - Only assign RGB values here to keep things simple. You usually stick with one full channel, but feel free to experiment]] | |||
[[File:SaveVPToMesh.png|500 px|thumb|'''Figure 2.5:''' Pressing the highlighted button will save the Vertex Painting to the Static Mesh object within the Content Browser]] | |||
{{Col-end}} | |||
{{KF2SDKNavBox}} |
Latest revision as of 01:08, 15 February 2022
The Landscape tool currently has a bug where Landscapes will not be able to use Custom MICs or even Official ones in Custom Maps. The only workaround is the one mentioned below: Setting Up Landscapes (Killing Floor 2)#Working Around Visibility and Vertex Painting
Bug Report Thread: https://forums.tripwireinteractive.com/index.php?threads/sdk-custom-landscape-mic-no-longer-working.2335317/
Introduction
This page will give a comprehensive guide to implementing landscapes into your map and editing them. It will also provide some workarounds for some of the limitations of the current system.
In this documentation we will be using 'Landscapes' instead of 'Terrains'. Although we can refer to them representing the same thing, they are actually completely different systems within the SDK. The Terrain system is an early UDK implementation and does not contain as many features as the Landscape system and should be avoided for KF2. You can toggle the Landscape on and off by pressing 'T'.
Please refer to the technical documentation for further understanding of the system: https://api.unrealengine.com/udk/Three/Landscape.html
Step 1 - Creating a Landscape
Click on the Landscape Mode. This will prompt you with options for creating Landscapes, chose what size you want and plug the corresponding values into the prompt. See Figure 1.1. The UDK documentation provides us with optimal sizes to create a landscape for the best performance in your map. You should use these and not custom sizes. Below are the recommended sizes for KF2 maps:
|
Step 2 - Adding a Material
Once the landscape is created you will need to give it a material. The materials that we use will be based off the LMAT_BlackForest_LandscapeMaterialBase Parent Material. Here are the following materials that are currently available for you to use from the official Maps:
Select the material that closest represents to textures you wish to use and assign it to the Landscape > Landscape Material property of your Landscape. See Figure 1.2. You will notice the Landscape turn black and distort funny in Lit Mode within the viewport. This is because the Landscape has not been painted yet, and first we need to set it up so we can:
We can now move on to editing and painting our Landscape. If the Landscape materials provided do not offer what you are looking for, you will need to create a new Material Instance Constant (MIC) and edit it exactly the same you would with any other MIC. The layers you edit will correspond to the names listed above. It is recommended to make the MIC from the Black Forest material.
|
Step 3 - Editing
Make sure the Paint option is selected under Paint Tools, then select one of the Layers we just created. Move over to your Landscape and press Ctrl + Left Click, this will paint your Landscape with the desired layer. We can adjust the brush strength, size and falloff indicated in Figure 1.4. Editing the height of the Landscape is done in the exact same manner, we just use the 'Height map' Layer instead of the ones we created earlier. Ctrl + Left Click will add height and Ctrl + Shift + Left Click will subtract height. There are a number other tools here that we can mess with to 'Smooth' or 'Flatten' the edges and even tools to generate randomness in the ground. This should be all you need to know to use Landscapes for your Map!
|
Working Around Visibility and Vertex Painting
Basically, we are going to export the Landscape mesh, edit it in our 3D modelling program of choice (I will be using Blender here) and reimporting it as a StaticMesh back into the Map. We will then use Vertex Painting to paint the mesh. Aside from just using it as a workaround for the Visibility tool bug, you can use it for small pieces of land in your map that would look more naturally formed. Eg: The snowy sections in Outpost and Krampus Lair, or the grass/courtyard in Manor. These are usually small enough to not require the extra processing used to calculate LOD for Landscapes. |
Exporting from SDK
We are going to start off assuming that you have already created a landscape and have sculpted the heightmap for it. You should make the sculpt as close as you can estimate it in its final form. Any edits to the Landscape will need be done in the modelling program of choice, or restarting the below process if major edits are required. The SDK will not allow us export the landscape as a .FBX unfortunately. We will need to export it as an .OBJ. This will likely mean that our mesh scale will be much larger when we import it into Blender. However when we export, we also want to export any boundary meshes or relevant meshes that give us and indication on what we will need to remove/edit on the Landscape. Select all relevant meshes and go to File > Export > Selected Only... and export as an .OBJ. Do not include an textures/materials if it asks you, we wont need it. Afterwards just import the .OBJ into your modelling program. Figure 2.1 shows the front courtyard of KF-Desolation, the Landscape was selected plus the additional meshes that aim to cover up parts of the Landscape. |
Editing the Landscape to a Mesh
If importing into Blender (might be the same for other programs), you will need to rescale all the meshes. Scaling it down by 0.01 gets it back into its actual mesh scale for KF2. Take note, the exported Landscape will have it's pivot point set at the origin. This can be excellent in most cases, because we can instantly export it from Blender later, and when it is placed in the map we can set its Location to (0,0,0) and it will be in the exact same position we originally exported the Landscape from. You can of course can change the pivot point in case you want to align it with a mesh or specific position instead. Depending on the sort of Landscape you created you may need to remove any duplicate vertices and weld parts together. Go ahead and do that and do whatever you need to do to the landscape such as deleting the unneeded parts of the mesh or tweaking vertices. Once you have completed it. You will need to create 3 UV channels for the Mesh:
Most of time, these sections are usually flat and you can do perfectly well with a top planar projection for all the UVs. Just make sure to scale the UV0 so the textures will repeat appropriately. You do not need to create a collision mesh for this mesh as we'll change some settings after the import into UDK. Figure 2.2 shows the final edited Mesh. When you are ready (in Blender) Select your edited Landscape only and go over to File > Export > FBX (.fbx). You can leave most the parameters default, however make sure you have set the following correct settings:
When ready hit Export FBX. |
Importing the new Landscape Static Mesh
Head back into the SDK and navigate to External > KF-YourMapName within the Content Browser (if it is not here, it is probably under NewPackages instead of External). Either right click the map name or within the Browser space and select Import..., find your exported .FBX from Blender and import it in, you do not need to change any settings here (except maybe changing the name). You shouldn't get any errors when you hit OK (if a prompt says something along the line of smoothing groups make sure the export settings are set to Edge as mentioned previously). When the import is completed, you can open up the newly imported mesh and inspect to see if it is correct. To make sure we have collision for our new mesh, go to properties of the mesh and untick the following (See Figure 2.3):
You should be able to place the mesh in the scene now and adjust its position accordingly (if you use the origin pivot point, you simple need to set the Location to (0,0,0)). At this point you should inspect the mesh in the scene to see if it lost any detail or if vertex positions had changed during the edits in Blender. You can tweak the mesh pretty easily now by:
|
Vertex Painting the Mesh
Unfortunately we don't have the luxury of using the same Landscape materials to paint our new mesh, and creating a texture for it is not a realistic or sensible thing to do for it. Our best and fastest option is to use Vertex Painting. Vertex painting is a technique where we paint Red, Green and Blue channels directly onto the mesh within the SDK. The R, G and B channels each contain their own texture/normal/look, and material simply blends them together based on their proximity to vertices; it works pretty much the same as Landscape painting with some additional limitations. The vertex painting also requires the mesh to be decently subdivided with vertices for better blending, luckily our landscape is already like this, so we do not need to change anything here. Here are some of the Vertex Paint materials in the SDK that you can use/base your material off: Material Instance Constant
Parent Materials
As with most materials, you can just choose what is best for you and edit accordingly. However some things to note:
Vertex painting works much the same as Landscape painting. We first assign the material we want to use, then select the Mesh Paint Tool and in the prompt we have nearly the same options as Landscape painting. However, instead of working with Layers we now select a RGB channel to paint with. See Figure 2.4. We do not want to use the colour wheel, and instead just manually assign the channels instead. To correctly use Vertex Painting, use the settings also listed in Figure 2.4. You can turn on the Mesh Outline to help visualize where vertices are. Go to Flags Menu > Show > Advanced > Mesh Edges. If your mesh is also very large, you can scale it down to make painting faster and reset it after you have finished. Vertex Painting will be saved per instance of the mesh that it is painted on to. However if you want to save it to the actual Static Mesh within the Content Browser hit the button Copies instance vertex colors to the source mesh. See Figure 2.5. |
|