Tampilkan postingan dengan label static meshes. Tampilkan semua postingan
Tampilkan postingan dengan label static meshes. Tampilkan semua postingan

Sabtu, 13 Februari 2016

UE4 Custom Static Meshes

This tutorial is the sixth in the 10 part series on how to create a first person shooter game using Unreal Engine 4. We recommend you read the previous articles first to get the maximum benefit from this tutorial.

Find a suitable mesh/model:

First off you need to find a suitable mesh or meshes for your game design project. We recommend www.blenndswap.com as the best place to find quality, free 3D models and meshes. The files are all compatible with blender (a free 3d modelling software) so it will be easy and free to edit/tweak them beforing exporting as an .fbx file to be compatible with Unreal Engine 4.

You need to create an account before you can download but it is all free, although there is an option to upgrade to a paid account you will hardly need it unless you are downloading a huge volume of models. The website has a huge collection of models all available under a variety of different creative commons licences. Just use the search function to find what you need then download it... simple!

Find free 3d models using Blendswap
Find free 3d models using Blendswap

Edit in Blender

Blender is a free software that can be downloaded from www.blender.org . If you are not familiar with it you can read and/or watch some of our tutorials here. Before you open the file in Blender be sure to unzip/extract the file as it will have downloaded as a .zip file from Blendswap.
The key thing in blender will be to unpack any textures that are used on the model. If you do this correctly the textures can then be imported automatically to UE4 along with the .fbx file and UE4 will even create the material automatically.

Blender windows

What you need to do is select the object in the outliner window, then select the material (there may be more than one) from the materials tab in the properties window and finally select the textures tab also in the properties window. In the textures section there may be more than one texture listed so you will need to unpack them all individually.

Blender Materials Tab Highlighted

Blender Textures Tab Highlighted

You can do this by going to the subsection title 'Image' and clicking on the little icon beside the file name. This will present you with 4 unpacking options - choose the first one. You will not notice any changes but what happens is a folder called 'textures' is automatically generated where the blender file is saved and the unpacked texture is place it in. This is an important file management step which  ensures the textures will import correctly to UE4.

Unpack a texture in blender

Repeat these step for objects in the scene outliner to ensure all textures get unpacked.

*In blender you may also want to, if necessary, remove any additional objects that you do not want to use in UE4. For example you might download a file which contains 3 trees but you might only want one of the 3. In cases like this simply select the object and press delete (or 'x') on your keyboard.


Export as an FBX

Once you have unpacked all the textures and made any other edits to the model that you want it is time to export it as an .fbx file so it can be imported to UE4. Simply click file > export > FBX (.fbx)

This will bring you to the export page. In the bottom left of the screen you will find the export options. There are a couple of key settings that you will want to change.

Firstly, in the main section, you only need to export the mesh so select only the mesh option. By default all options will be highlighted and will result in unwanted elements being imported as part of the mesh.

Select only the 'Mesh' option
Secondly, in the geometries sections, you will need to change the smoothing option to face, this is important for UE4 and will result in an import error if you do not do this step.

Set smoothing to 'Face'

Once you have completed these steps you can click the export button in the top right of the screen.

*Do not change the save location, the .fbx needs to be in the same folder as the original blender fil and beside the auto generated textures folder.


Import To UE4

Before importing the file to Unreal Engine you should first create a folder titled 'Meshes' or something similar and then inside it a sub-folder with a suitable title eg. 'Trees'.

Sample folder structure for Meshes

Once inside the folder click on the Import button and navigate to where you saved the .fbx file, select it and click open. This will bring up the Import options. Depending on the mesh you will choose different options but always be sure to select Import Materials and Import Textures. Choosing Auto Generate Collision is most likely something you will want but for meshes such as grass you should deselect it.

UE4 import settings

Once happy with your selected settings click 'Import All' and the mesh and textures will be imported and UE4 will automatically generate materials from the textures and apply to the mesh.

For textures that contain transparent or semi transparent areas you will need to edit the auto generated material in order for them to work correctly. To do this simply double click on the material to open the material editor. In the material editor select the large material node and in the details window on the left change the blend mode form opaque to translucent. This will activate the opacity channel on the material node. You can now plug in the alpha channel of the texture node to the opacity channel. Click save and this will update the material and the mesh to display correctly.

UE4 Material Editor
Click save and exit the material editor. Then click save all in the Content Browser to add the files to the project.

Add Using Foliage Mode (optional)

    All meshes can simply be dragged and dropped into the level but for meshes such as grass, trees, bushes etc. that may be used across a wide expanse of the level you should use the foliage editor.

    Select the foliage editor tab in the top left of your screen and then drag and drop your mesh or meshes into the area saying "Drag and Drop Foliage Meshes Here". You can then select a mesh and edit it's various settings so that it is applied in the way that you want. You can select and deselect a range of meshes to paint on the ones you want when you want.

    UE4 Foliage Editor Settings

    To learn more about the foliage setting click on the graduation cap icon and follow the in-built UE4 tutorial. Once the foliage and other meshes are added your level will be much more detailed and interesting for the player. Here is how it looks like in our game when placed in map.

    Next Up

    Now it is time to give our player something to shoot at! We will download and set up our custom enemy character and animations.



    Baca selengkapnya

    Kamis, 05 Maret 2015

    Importing Static Meshes into UE4

    Importing Static Meshes into UE4
    A Static Mesh Imported Into UE4

    WHAT ARE STATIC MESHES?

    Static meshes are polygon meshes which are an important in many game engines including Unreal Engine, Source and Unity. The word static refers to the fact that static meshes can’t be vertex animated as they can be moved around, scaled or reskinned.


    WHY USE STATIC MESHES?

    Static meshes are very useful for beginners who don’t have a lot of experience. Beginners can use static meshes to help create scenes in their game. There a fast and easy method of creating scenes. You can also use them to try and create your own unique mesh by adding on a new texture or changing the colour.

    IMPORTING A STATIC MESH

    STEP 1 

    The first step is to go on to blendswap and to find a subtle mesh for your game


    Make sure to get a static mesh for your game at blendswap. link is available above. 


    STEP 2

    You will then want to download a static mesh that you plan on using in your game. After the download make sure to extract the file.



    When your waiting for your download you should look at different static meshes that you could use in your game. 


    STEP 3

     When its done downloading make sure you extract file by clicking on the extract to.


    Make sure you extract your static mesh somewhere thats easy to find.


    STEP 4 


     After down loading it you will want to open it up in blender.



    When you bring in a static mesh you can scale it to suit your game

    STEP 5

    After bringing it in you will want to remove the background to your static mesh and change it to suit your game. You can try out putting different textures on your mesh.To delete a background select it by right clicking then press x to delete.


    The image above shows the static mesh in blender

    STEP 6

    Before bringing your static mesh into unreal engine you must export your mesh as an FBX
    file.

    The image above will help guide you exporting your meshes.


    After clicking export you will want to select the mesh option under Export FBX


    STEP 7

    Import the static mesh into your game and scale it down or up depending on the mesh. To import your static mesh go to your content browser then click the import button to bring in your static mesh. The default import options will suit most meshes but be sure to read through them and make any changes you feel are necessary.


    Finished Result








    Baca selengkapnya