Tampilkan postingan dengan label 3d textures. Tampilkan semua postingan
Tampilkan postingan dengan label 3d textures. Tampilkan semua postingan

Sabtu, 13 Februari 2016

UE4 Pickups

This tutorial is the fifth 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.

Step 1: Creating A New Blueprint 

UE4 Pickups

The first thing we need to do is create a new blueprint, to do this in the content browser, open the blueprints folder then right click on empty space and select blueprint from the pop up menu.


When you want to select blueprint, this window will pop up. We want to select actor.

Step 2: Creating The Collision



                                                 

Now that we have our actor created double click on the thumbnail, this will open the editor for that blueprint. We need to add a collision, so in the top right, it will say add component. Click this and select sphere collision.

If you are using a older version of Unreal Engine 4 you can select a sphere.
Then we need to add a static mesh, to do this we need to see both the blue print editor and the props folder in the starter content select the material sphere and drag it into the blueprint editor and drop it in the grey space under the add component section.
Scale widget 
Use the scale widget to scale the sphere down. To do this, select the ball, press the space key twice and locate the widget you are looking for.


We need to add a static mesh, to do this we need to be able to see both the blueprint editor and the props folder

As we see from the above picture the sphere has swallowed the collision

Step 3: Blueprints for rotation


Event graph shows up


The next thing we do is right click on the grid and search for event tick once this has been added, select the material sphere in the top left hand panel, then right click, open add event section, then select the collision drop down option and from there select begin overlap.




Right click on the grid again, this time type actor location into the search bar, select the green option that says get actor location. The next thing that we will add is an emitter, for this drag from the white arrow on the begin overlap node, in the search bar type emitter.


From the options you want to select spawn emitter at location. In the newly added node, under the emitter template drop down, select the explosion option.


The next pieces of code we are going to add are brought out from the begin overlap node. In this node select the blue other actor circle, drag this out and type cast character select my character from the options menu. Once this has been added hit save.


Then from the cast character node drag out the blue circle and search for character movement, you need to scroll down to the bottom of the results in order to find the variables section.

There will only be one option here and that is the one that we need. This time we will add three pieces of coding that will complete the coding that we need to gather in order to create to the floating pickup, just grab it and put it into the grid.

Next thing is to right click from the pop up scroll down to the bottom and select the timeline option, name this blueprint. The next piece is right click followed by a search for local offset add this beside the timeline. This piece is we are going to add in this section is a destroy actor node, right click search destroy and add to the grid.


This time we are going to add three pieces of coding that will complete the coding process. We need to gather in order to create the floating pick up. Now we will just grab it all and put it into the grid. First thing to do is right click, from the pop up scroll down to the bottom and select the timeline option, name this blueprint


The second piece is right click followed by a search for local offset add this beside the timeline. The last piece we are going to add in this section is a destroy actor node, right click search destroy actor and add it into the grid.

The last piece of coding that needs to be added is a set max walk speed node. Drag out from the character movement reference, right click and search walk speed, you may need to turn off the context sensitive option in order to find it. Select the node that says set max walk speed. Once you have added this piece of code, change the value to 1500, then connect all of the coding up.
   


Step 4: Creating The Hover Effect

Vector track
To add this select the timeline node in the blueprint and double click, this is the window that you will see, when this opens select the V option to add a vector track.

Now we are going to be adding our key frames on the z axis, because we want our bell to go up and down in the air. To do this we need to click the lock symbol beside the green, and red boxes in the top corner of our vector track, this will only leave the z axis available to work on.

Adding key frame to vector track 
Adding more key frames to vector track 
To add a key frame we go to the start of the animation on the blue line, where it says 0.00 hold down the shift key and left click in order to add a key frame.

Next we make sure to have the z axis only unlocked, and we do another key frame, this time at the 0.50 point, the values this time are .5 and 5.The next key frame will be added at the 1.00 mark. The values this time will be 1.00 and then -0.05. The final key frame will be added at the 1.50 mark. The values this time are 1.50 followed by 0.00. we are also going to need to tick loop option.

Now we can go back to the graph, we now have an extra option on our timeline node and this needs to be connected. Now that everything is connected and compiled.

Step 5: Adding A Material To The Pickup

To add a material to the sphere open the sphere in the blueprints folder.




From here if you look at the above picture you can see, on the left side of the screen, static mesh, double click on the thumbnail and it will open a new window.




Now we drag a material from the content browser into the section on the right side that the ball is in. The material will work once you save it,





As you can see this are the 3 pick ups we have made in our finished game the heart is for health, the lighting bolt is for a speed up to get away and the boxes are ammo creates. 

Next Up

Now it is time to add detail to our FPS game by adding custom static meshes such as trees, grass, rocks, crates, etc.


Baca selengkapnya

UE4 Custom Textures & Materials

This tutorial is the third 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.

Step 1

Download a Texture from www.textures.com. The texture needs to be a seamless texture.

UE4 Custom Textures & Materials
Sample textures available at www.textures.com

Step 2

Download the Nvidia textures tools plugin for Adobe Photoshop + install. :


Step 3

Open the texture in Photoshop and go to Image > Image Size and scale the texture to 512 x 512


Then go to File > Save As and save as a .Targa file. Give it a name such as "brick_DIFF.tga". Finally you will get a pop up asking about the resolution to save at, choose 32 bit.

Step 4

In Photoshop use the NVIDIA plugin to create the Bump map/normal of the textures. You will find the plugin at Filters > NVIDIA.  In the pop up window that opens choose the "Biased RGB" option and select "Add Height to Normal Map" if not already selected. Then click OK


The NVIDIA texture tools plugin

This will change the look of the texture to a blueish, purple colour like in the image below.


Open the NVIDIA plugin again and this time choose "Normalise only" and click OK.

Next, you can increase the "bumpiness" of the texture normal by unlocking the layer, duplicating the layer and changing the blend mode of the duplicated layer to overlay. You will notice an increase in the bumpiness of the texture. This step can be repeated as many times as you feel is needed.



Finally, go to File > Save As and save as a .TARGA file with a name like "brick_NRM.tga" and a resolution of 32 bits. You can now close the file and close Photoshop.

Step 5

Open up Unreal Engine 4 and in the Content Browser create a new folder, call the folder "Materials". Inside the Materials folder, create a new folder and call it "Brick" or something appropriate to the texture you are using.

Inside the "Brick" folder click import. In the pop up window, navigate to where you saved the textures we created in the previous steps, select them both and click open. This will import them into the "Brick" folder.



Step 6

We now need to create the material itself. To do this click the green Add New button and choose Material. Name the material "Brick_M" or something appropriate to the material you are making.
Double click on the material to open up the material editor. Next drag an drop the textures into the material editor and connect them up as shown in the image below.



Now, save and close the material. It can now be applied to any geometry surface in the level. As in the picture below.


Now that you know how to add textures to the game here are some examples that we have in our game. Some wooden texture and brick textures that we have put on the house.

 



Next Up

In the next tutorial we will create the main building in the FPS game using BSP brushes and geometry mode.



Baca selengkapnya

Rabu, 20 Januari 2016

Applying Multiple Materials to Single Objects in Blender

In this tutorial, we will be learning how to apply multiple materials and textures to single objects. In this example, we will be creating a building, using two materials, for the building walls, and the building’s rooftop.



Apply Multiple Materials to Single Objects in Blender
Multiple Materials applied in a Final Render

Step 1: Creating the shapes

Open a new Blender project.


New Project
Rather than the deleting the default cube that appears in new projects, we will be using it. Use scale on Z axis (‘S’, then ‘Z’) to make the cube slightly taller, then grab and move on z axis upwards, so as to sit on the grid.


Scaled cube
Add a plane (shift + A, in the ‘Mesh’ option) and scale wider than the cube, using the ‘S’ key.


Added plane

Step 2: Edit Mode

Enter edit mode (tab) and ensure the ‘Face Select’ option is selected. This button is located along the bar at the bottom of the screen.


Circled selection, click 'Face Selection'
Select each side of the building apart from the top (hold shift and right-click each side). The selected sides will appear orange.


When 'Face Selection' is on, faces should appear as above

Step 3: Adding Materials and Textures

Go to the Materials tab on the right-hand side of the screen and add a new material, then proceed to the textures tab, and add a new texture – ensure that the type is ‘Image or Movie’.


Materials Tab
Textures Tab
Once you have added the texture, click ‘Open’ underneath the ‘Image’ dropdown, and open your texture. You can choose whichever texture you require. Since we’re making a building in this tutorial, I’ll be using a residential building texture. In order to gain a more realistic textured object, you should use seamless textures.


Added Texture
Image dropdown

Step 4: Mapping and Assigning the Walls

Once you have added your texture, you may want to map it in order for it to appear more realistic and neat. In order to do this, remain in the Textures tab, and scroll down until you find the ‘Mapping’ dropdown. Underneath this, change the ‘Coordinates’ to ‘Global’, and the ‘Projection’ to ‘Cube’. If you want to increase or decrease the size of the texture, you can change the ‘X’, ‘Y’, or ‘Z’ sizes.


Image Mapping for Building
Go back into the Materials tab, and select the ‘Assign’ button. This will assign your selected material and texture to the faces you have selected – as long as they are still selected.


Assign button

Step 5: Adding the Second Material

Once you have assigned the material to the walls of your building, select the roof of it by itself, and proceed to add another material. 


Roof Face Selection
Second Material added

With this material selected, go back to the Textures tab and add a texture to it. For this, I’ll be using a concrete texture. Repeat the process of opening the texture underneath the ‘Image’ dropdown.


Add texture to second material

Step 6: Mapping and Assigning the Walls

Once you have opened your texture in the Image dropdown, you may want to map the roof as well. In order to do this, simply scroll down to mapping, just as described beforehand, however, set the ‘Projection’ to ‘Flat’ this time. Keep the ‘Coordinates’ at ‘Global’.


Image Mapping for Roof
Ensure that this texture is assigned to the rooftop. To do this, go back to your Material’s tab and ensure that the roof’s material is selected. Then make sure that your rooftop is still selected on the object onscreen. If both of these are selected, click the ‘Assign’ button again.


Assign button

Step 7: Rendering your Scene

As on now, your building should have two materials assigned to it, each with a different texture. You can view this by changing the object display from ‘Solid’ to ‘Rendered’, or else to get a full rendered view, simply press F12 on your keyboard. This will give you a rendered view through the camera on your screen.


Rendered project
Rendered through camera view

You can use the same technique of applying a material and texture to your roof, as the plane. 


Final Render

Sample Renders:

You could experiment by adding more materials to each surface or the building, or try another shape with more than two materials.
Sample Render - Cylinder

Sample Render - Monkey




Baca selengkapnya