Mental Ray Linear Workflow Tests

So, I’ve decided to take a better look at using a proper linear workflow within Mental Ray and part of that seems to be learning Global Illumination and Final Gather. These lightning systems have always seemed scary and complicated to me, but after some great tutorials at Lester Banks.com (http://www NULL.lesterbanks NULL.com)and Stuart Christensen (http://www NULL.youtube NULL.com/user/deepfriedectoplasm)‘s YouTube channel I am starting to see the light :) I would also like to thank Brandon from Backwards8.com (http://www NULL.backwards8 NULL.com)for sitting down with me the other day to explain some of the different GI and FG settings.

Labatt Beer with ice (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/04/beer_ice NULL.jpg)I dug up a scene I had modeled a few months back of my old apartment. This is lighting s a test to see how I would like to take the render further. The render itself is black and white and the few textures and colours in it were added in Photoshop. I should mention that I’m not using the mia_roundCorner node. There are 5 area lights in the scene being controled by a mia_portal_light. Right now the large windows are emitting 1,000,000 photons per light and the smaller windows are emitting 500,000. The portal lights are all connected to the same mib_blackbody node which is outputting a colour temperature of 5500K. This is in an effort to simulate mid-day sun. The render camera is set up so that the film back is the same ratio as the resolution gate (960×540 px) and I added the lens shader mia_exposure_photographic to even out the gamma. I am still getting a bit of blotchyness around the corners, but part of that is due to the area light samples being set at 16. Overall I am really happy with this as a test and I will keep posting updates as my work progresses. I’ve also done a small linear light test with a beer can model and I will post that shot when I get off of work. If you have any questions about settings or the process as a whole post a comment below or shoot me an email (terry null@null terrymatthes NULL.com).
.
Global illumination and final gather rough render. (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/04/apt_test NULL.jpg)
.

Sprite Channel Controller

Channel Controller Network

Introduction

Prerequisites

Maya opticalFX Sprite Textures (http://www NULL.terrymatthes NULL.com/particles/maya-sprite-textures/)

In our past lesson we created 3 different sprites and a gradient mask. Then we put them all into one texture using channels. This lesson will use that texture as a base for a material network. This material network will let us create instances of our base material that will have variables we can change. We will be able to change the inside colour, outside colour, saturation, core brightness, and sprite textures themselves. We’ll start by importing our texture into the Unreal Development Kit. If you don’t have a texture ready to go please run through our last lesson (http://www NULL.terrymatthes NULL.com/particles/maya-sprite-textures/) to get one setup.

Unreal Development Kit

Importing Texture

Let’s bring up the Content Browser (ctrl+shift+f) inside of the UDK and click the import button at the bottom right to bring in our texture. Under the import options for our texture we want to select “TC_SimpleLightmapModification” as the “Compression Settings” and label the group “Texture”. I find that  TC_SimpleLightmapModification is the only section that doesn’t degrade the sprite texture channels. Now that we have our texture imported lets go ahead and create a new material. Right click in an empty area of the Content Browser and select “New Material” name it whatever you wish and call it’s group “Material”.

Below is the network we are going to create. We’ll break down each node grouping and explain the elements one by one. You’ll notice that in place of regular constant vectors we have placed scalar parameters and vector parameters. This will let us manipulate these values outside of the Material Editor. All “Parameter” nodes have a “Value” this is what identifies them in the material instance we will create later. You must fill the Value names in and make sure they are unique or you will get nodes sharing values and that isn’t good.

Channel Controller Network (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_channelController_network NULL.jpg)

Before we jump into the individual node groupings I just want to drop down a copy of our sprite texture. Select the sprite texture in the Content Browser, hold down the “t” key and click in the Material Editor.

Material Properties (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_channelController_matprop NULL.png)The material we are creating is going to be partially transparent and double sided. We need to change some options in the materials properties to reflect this. First click on the material body and then click the “Material” rollout to expand it’s options. Change the “Blend Mode” to “Blend_Translucent” and check the “Two Sided” option.

Make sure you add descriptions to your nodes inside the Material Editor. You can do this inside the node’s properties under “Description”. You’ll want to do this to most nodes along the way so you don’t end up with a mess of nodes later on and have no idea how each functions.

Inside Colour

Inside Colour Setup (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_channelController_inside NULL.jpg)To build this grouping we are going to drag out the following nodes onto our canvas: Vector Parameter” Scalar Parameter, Add (“a” key) and Multiply (“m” key).

Hookup the output on both the Scalar Parameter and the Vector Parameter to the input of one of the Add nodes. Label this add node “Colour Mixer Inner”. The Vector Parameter will help you choose your inner colour. The Scalar parameter will control how saturated the colour is. 0 will leave the colour at full saturation while 1 will wash it out to white. If you want any white at all in the highlight you’ll want to set this to at least 0.1.

Take the output from the Add node we were using and plug it into one of the inputs on our Multiply node. Now plug the alpha channel (white tab) from our sprite texture into the remaining input. This will mask the inner colour off so it fades towards the edges of the sprite image.

Outside Colour

Outside Colour Setup (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_channelController_outside NULL.jpg)The outside colour is setup almost the exact same way as the inside colour setup except we are going to reverse the alpha channel gradient of our texture using a “One minus” node. Ctrl+alt drag over the entire inner colour setup and Copy it (ctrl+c), then Paste it (ctrl+v). Now drag out a “One Minus” node from the “Math” section of our Material Expressions menu on the right. Connect the One Minus node in between the Multiply node and the Alpha channel(white tab) of the sprite texture.

The last thing we are going to do with colour is hook these two systems up to the “Emmisive” input on our material. Drop an Add node down and connect the output of both system’s Multiply nodes into either input. This will add the outside and inside colours together by blending the two gradient masks.

Core Brightness

The core brightness will be controlled by a single Scalar Parameter. I suggest using a brightness value of 0-50. Your range might vary though. It really depends on the overall brightness of your channel images.

Channel Chooser Setup (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_channelController_chooser NULL.jpg)Channel Chooser

Our channel choosing system will revolve around an “If” node. The “If” node allows us setup a greater than, less than, equal to statement that we can use to choose our texture channel. Drag out an “If” node, a Constant1Vector (“1” key), a Scalar Parameter, and an extra copy of our sprite Texture (“t” key).

Set the Vector1Component’s value to 1 and connect it to the “B” input of the “If” node. Connect the Scalar Parameter to the “A” input and set it’s value to “1”.

Connect the red green and blue channels of your sprite texture node to the “If” node as follows:

  • red = A>B
  • green = A=B
  • blue = A<B

Now that our “If” node is setup we can switch between channels. A Scalar Parameter value of 2 will give us the red channel, 1 gives us the green channel, and 0 gives us the blue channel.

Edge Masking

Our last section will consist of two Multiply nodes. Drop 1 down and connect the Scalar Parameter output from our core brightness into input B. Connect the output of the “If” node into input A.

Drop down a second Multiply node and connect the first Multiply node into input B. Now connect the alpha channel (white tab) of our sprite texture into input A. Lastly plug the output of this Multiply node into the Opacity input of our material. Be sure to save your material by pressing the green check mark at the top right now that everything is complete.

Material Instances

Material Instance Options (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_channelController_instance NULL.jpg)Material instances are a good thing. They save us resources by changing materials already stored in memory. The more resources we have the more cool things we can show people :) Let’s create a material instance of our Sprite Material by right clicking on our material in the Content Browser and select “Create Material Instance (Constant). Rename the instance if you wish. Next to our original material you should now see the instanced version of our material. Double click it to open it. On the right hand side you can now see the Vector and Scalar parameters we setup in our material. Click them on to make them active. Now you can change them and from Kismet as well :)

Conclusion

As you can see instances can give us a lot of control over the look of our materials. By just inserting some “Parameter” nodes in the place of Constant Vectors we can change the look of our sprites quite considerably. You can take this network a lot further by adding if nodes and Scalar Parameters to overlay channel images. If you feel up to it go ahead and try playing with the “Sin” node and “Time” node to make your sprite glow! I’ll give you a hint: fluctuate the core brightness :D

Further Reading

Hourences Intro to Cascade (http://www NULL.hourences NULL.com/tutorials-ue3-cascade)

Program Shortcuts Used

Unreal Development Kit
Copy (ctrl+c)
Paste (ctrl+v)
Content Browser (ctrl+shift+f)
Add node (“a” key+mb1)
Multiply node (“m” key+mb1)
Texture node (ctrl+t)

Maya opticalFX Sprite Textures

Sprite Texture Thumb Image
Introduction
Prerequisites

Appreciation for all things shiny.

Magic effects in video games are sweet, but do you know what’s even sweeter? Knowing how they work so you can make your own. That’s what we’re going to do here. We are going to learn how to make awesome looking sprites in Maya so we can bring them into the Unreal Development Kit for our own special effects. First we’ll take a look at what sprites are, followed by how to render optical effects using a spot light in Maya. Next Photoshop will be used to touch up and save out our images for import into the Unreal Development Kit. Follow me and we’ll “get our learn on”.

Sprites are single polygon planes who’s surfaces are mapped with an image. For visual effects these sprites are usually programmed so they always face the active camera. This means however you look at a sprite in 3D space it will Sprite Based Tree (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_tree NULL.jpg)always be facing directly towards you no matter where it’s positioned. Sprites give an accurate enough representation for a variety of visual effects. Things like snow, muzzle flashes, and small pieces of flying debris look the same no matter what angle you view them from. Even visual effects such as lightning are so quick that you wouldn’t even notice that the effect isn’t truly “3D”. If this is the case then why would we bother giving these effects any extra dimensionality?

Sprites are also simple to render. If all your sprites are single polygon planes you can afford to have a lot of them on-screen at the same time. Throw enough of them together and you can get some pretty realistic looking effects for a lot cheaper then pre-rendered graphics. The picture to our left shows a tree who’s leaves are made of a few larger sprites. No matter which way the camera looks at the tree the leaves appear to be full of volume.

Maya

Point Light Optical Effects

The optical sprite we are creating will be based off a point light. Once created the point light will be manipulated via the “Optical Effects” node to give our light different properties. To do this access the “Create” menu at the top of the screen. Navigate to Lights>Point Light and select it. You should now have a point light at the origin of your axis. The optical effect we are after is not visible by default on our point light. We have to turn it on in the Attribute Editor (ctrl+a). Select the point light and access the Attribute Editor. Under the “pointLightShape1” tab we are going to expand the “Light Effects” section. In this section the last option is “Light Glow”. Turn this on by clicking the checker board button on the right of the text field. If you’ve done this correctly you will see a circle around your light and the Attribute Editor will have jumped to the properties for the “opticalFX1” node you just created. Our point light is now set up to cast some great looking optical effects.

Render Camera Setup

opticalFX Render Setup (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_scene NULL.jpg)Go back to the “Create” menu and navigate to Cameras>Camera and select it. You should now have a new camera also sitting the axis origin. Select your new camera and Move (“w” key) it away from the origin. Now that we’ve finished placing our new camera we will go ahead and look through it. Select the new camera and in your view port menu navigate to Panels>Look Through Selected Camera. You should now be looking straight at the point light we created. The last thing we want to do to our camera is make the “Resolution Gate” viewable. This will let us see the bounds of our render. To do this we will use our view port menu and select View>Camera Settings>Resolution Gate.

By default your resolution is probably not square. We need to make it square so we can use the images we create in the Unreal Development Kit. To change this let’s go ahead and navigate to the “Render Settings” through Window>Rendering Editors>Render Settings. Change your settings to match these options (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_renderSettings NULL.png). With that setup we are now ready to start rendering out some optical effects.

Rendering Optical Effects

The optical effects we are using render out very fast. This will enable us to view near real-time previews while changing the visual settings. To view our render we are going to open up the “Render View”. This can be accessed through the main Maya menu: Window>Rendering Editors>Render View. In the Render View menu select IPR>IPR Render>camera1. This will setup interactive rendering on the camera we created earlier. The last step to setting up IPR is to marquee drag over the entire renderable area. When you do this the edges will become red. Any changes you make to the opticalFX node will now be instantly seen.

Important Note: Maya’s opticalFx are only viewable in “Maya Software” render mode.  Make sure this is selected as your render mode in the Render View window

opticalFx Node Properties

If at anytime you loose focus of the opticalFX node you can access it by clicking on your point light, bringing up the Attribute Editor, and navigating the tabs at the top to find “opticalFX”. Right now you want to have your Render View open as well as your Attribute Editor with the opticalFX node tab viewable. The following section is a visual comparison of the basic opticalFX  properties we will be dealing with in this lesson. There is a lot more you can do with this node than the sections listed below, but this is a beginner lesson so I want to keep things simple for now. Try experimenting on your own after to see what some of the other settings can do.

Optical FX Attributes

opticalFX Radial Frequency Comparison (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_Radial NULL.jpg)

opticalFX Star Points Comparison (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_StarRadius NULL.jpg)

Glow Attributes

opticalFX Glow Intensity Comparison (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_GlowIntensity NULL.jpg)
opticalFX Glow Spread Comparison (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_GlowIntensity NULL.jpg)
opticalFX GlowNoise Comparison (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_GlowNoise NULL.jpg)
opticalFX Glow Radial Noise Comparison (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_GlowIntensity NULL.jpg)
opticalFX Glow Star Level Comparison (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_GlowIntensity NULL.jpg)

To save a render in the Render View you need to use the File>Save Image option. don’t get caught up colouring your optical effect as we will be stripping the colour from within Photoshop. When you are making your effects don’t forget that we can’t have parts of the star breaking the edge of our render. The images are going to be put on flat square sheets in the Unreal Development Kit. If the sprite images extend past the edge of the render they will give away our effect showing its 2D nature. When you have saved three renders that you are happy with move on it the next section.

Photoshop

Saving Sprites For The  Unreal Development Kit

First let’s go ahead and create a New File (ctrl+n) if you haven’t already. Make sure it’s a square 512px file just like the images we rendered out of Maya. We want these to match up as we’ll be exporting this file for use in the Unreal Development Kit. Open (ctrl+o) all three of the sprite files you rendered out and change each of them to grey scale. We can do this by dropping the saturation of each file down to zero. While the layer in each file is selected access Hue/Saturation (ctrl+u). Now drag the “Saturation” slider all the way down to the left and this should drain the colour from your image. Before we jump into the next step I want to take a moment to explain what “Channels” are and how we can use them to our advantage.

Channels

Channels Setup (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_channels NULL.jpg)Each digital image is made of 3 different colours. You probably know what they are if you think hard… red, green, and blue. Photoshop stores this information in “Channel” layers. You can access these through the Channel tab in your layers window or through the “Window” menu. Each of these channels stores 8 bits of information. That means the value for each pixel in a channel is stored as a number from 0-255. As the value gets higher the pixel’s channel value becomes stronger.

In the “Layers” tab all these values are added up for each pixel and you get the full colour view you see as the image. A pixel with a value of 255 in each category would be represented as a compiled colour of pure white. A pixel with channels values of R(255) G(0) B(255) would compile as purple. So what does this have to do with what we’re doing? We’re just saving out pictures for sprites, right? Yes, that’s correct, but we’re saving black and white versions of our sprites, as we will be manipulating the colour from within the Unreal Development Kit in our next lesson. This means that the actual compiled colour of our texture doesn’t matter. This is going to let us store 4 different sprites in one file! Yes that’s right I said “four”. We can add an “alpha” channel to our Photoshop file and get one extra channel.

So now that we know all about what channels are and how we can use them let’s start putting our sprites in our new file’s channels. Go ahead and Copy (ctrl +c) one of the desaturated sprite images from your open files. Navigate (ctrl+tab) to your “new document” and access the channels information. In your new document all the channel information should be blank as you haven’t pasted anything in the layers section. Paste (ctrl+v) the sprite you just copied in a channel. The process is the same for all your other channels. Go ahead and copy the other two sprites you saved into the remaining red, green or blue channels. Remember: our final texture image isn’t important here.

Circular Gradient (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_gradient NULL.jpg)The alpha channel in our texture will not have a sprite. We are instead going to insert a circular gradient that will help us control the look of our sprites from within the Material Editor. Select your Gradient Tool (“g” key) and make sure your foreground colour is black and your background colour is white. Also be sure that the “radial gradient” option is selected atop Photoshop. Navigate to your channels tab and press the “Create new channel” button. This will give you an alpha channel to drag out our gradient in. Select this channel and from the middle drag out to the edge and let go to create your circular gradient. When you have finished save your Photoshop document as a Targa file under the “Save As” section of the “File” menu. When presented with your options for the Targa format select “32 bit”. This will save the file with the extra alpha channel. Remember that each channel is 8 bits so a 24 bit Targa holds 3 channels and a 32 bit will hold 4.

Conclusion

Don’t those sprites we made look awesome? Maya’s optical effects node can get you a lot of different looks so have fun an experiment to see what you can come up with. Try mixing multiple sprite images together within Photoshop and using their combined values in a single channel. Now that we know how to make magic sprite shapes and have saved them out in an efficient format we can take them into the Unreal Development Kit. In our next lesson we’ll use our sprite texture as a base for controlling the look of our sprites through a material network.

Here are the three sprites I will be using in the next lesson about our material controller. Just for fun I thought I would add some colour to them in Maya :)

My Sprite Textures (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/01/p_101_spriteTex_mine NULL.jpg)
.

Further Reading

Sprite Material Controller
Make a Particle Explosion Effect by Mike McClelland
Sprite Rendering Fundamentals The Gnomon Workshop
Pixie Dust Using Sprites The Gnomon Workshop

Program Shortcuts Used

Maya
Move (“w” key)
Attribute Editor (ctrl+a)
Photoshop
New File (ctrl+n)
Open File (ctrl+o)
Hue/Saturation (ctrl+u)
Navigate Documents (ctrl+tab)
Paste (ctrl+v)
Copy (ctrl+c)

Icy Material

Introduction
Prerequisites

Creating Seamless Textures in Photoshop (http://www NULL.terrymatthes NULL.com/articles/seamless-textures-in-photoshop/)

Hi, thanks for stopping in. This lesson will be a basic introduction to creating a material for use inside the Unreal Development Kit. If you’ve never created a material from scratch before than this is a good place to start. Our final texture will be an ice sheet with a nice smooth finish.  The base for our material will be a photo we found off the internet. We will make this seamless (http://www NULL.terrymatthes NULL.com/articles/seamless-textures-in-photoshop/)and then us it as the base for our specularity, bump, and normal maps. To create the normal map for this texture we will be using CrazyBump (http://www NULL.crazybump NULL.com/). The most complex material nodes we touch upon are the reflection vector and the vector mask node to enable reflections in our ice. So now that you know what we’ll be doing let’s get started by looking at some examples of ice and snow I gathered from my favorite reference site CG Textures.com (http://www NULL.cgtextures NULL.com).

Reference

Ice Ground Reference (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_icy_Reference2 NULL.jpg)

It’s always important to get good reference when building materials. Even if you are doing something cartoony great shots are about more than colour. Good reference tells you how the material acts. Ask yourself questions like: how does it reflect light? Are there any colour commonalities between all photos? Are some parts of the material giving of no specular highlights? My ice material is going to act as floor or wall material as it won’t be translucent. All of the ice in our reference looks patchy and that’s what I want. White is visible all the time as there is white noise all over these photos. These also all seem to be lit me a fairly bright source. You could have just grabbed any photo of ice and started looking at it for reference, but that’s not a good idea. You should think about the scale and the surrounding environment. Is this ice going to be seen far away, or close up? Ice looks really different at varied distances. If you took the properties of the middle shot and tried to use them for a floor in a fps game it might look odd. This is a really zoomed in shot of ice. If you were standing on top of it looking down you wouldn’t see close to that amount of detail. Especially the fine edge lighting on the cracks. So scale is important because It helps us to suspend belief. If the scale is off and the player notices they will immediately become disengaged and that’s no fun :( So decide how you want your ice to look and jump into Photoshop. We’re now going to setup the our material.

Photoshop

Within Photoshop we will create the diffuse, reflection, and specularity textures. We will be saving all of our images in the  Targa (TGA) format. Each channel in a TGA file has 8 bit’s of information. When you go to save a TGA in Photoshop you will get an option to select 24bit or 32 bit. Each colour of RGB is saved as one 8 bit channel. When you save a 32 bit Targa you get to include an extra channel. We will be using this feature to include our specularity texture in our diffuse file. I mention this because I don’t want you to just start saving files as 32 bit thinking they are better quality as there is no difference. From this point forward we want to be working in a new Photoshop file with a seamless texture as the base.
Diffuse and Specular maps (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_icy_diffuse_spec NULL.png)

Diffuse Texture

Let’s Duplicate (ctrl+j) our base diffuse layer and remove it’s saturation by accessing Hue/Saturation (ctrl+u) and pull the saturation all the way to the left. This will make the layer gray scale. To create some variation in the light we are going to choose the Magic Wand tool from the menu and start making multiple selections (shift+mouse1) across the layer. We want to pick chunks of the texture out so we can change their brightness and contrast. When you have a selection you like go ahead and access the Brightness/Contrast under the image >adjustments menu. Let’s change the brightness and contrast so these selections stand out more than the rest. To help you see the adjustments you’re making better try Hiding Selection Border under the view>show menu. When you’re happy with your results Unselect (ctrl+d) your selection and go back into the Brightness/Contrast function. We want to lower the overall brightness and contrast of our specular map. If things are too bright they will shine too much and your material will look like a white sheet. The final step is to Select Everything (ctrl+a) on our specular layer and Copy (ctrl+c) it. Now we want to look at our documents “channels”. These are under the “Windows” menu in Photoshop. If you click on this you will see 4 different “layers” in a window labeled “Red”, “Green”, and “Blue”. They represent the colour information for your entire texture. Click the “new layer” button at the bottom of the panel to create a new channel. By default it will be labeled “Alpha”. Select this channel and Paste (ctrl+v) your specular layer into it. Now your specular map will be saved in your alpha channel. Click back on the layers window and make sure make sure your diffuse layer is the visible layer.  Now we will save the file using “save as” and select TGA as our file type. When you hit “save” Photoshop will give you the option to save as a 32 bit file. We need to do this or we will loose that specularity map sitting in our Alpha channel.

Reflective Texture

The reflective texture you use really depends on the environment you want to display your material in. For this example I don’t want a distinct reflection as much as I want a wash of colour to pass over the material. Find a picture you wish to use and paste it above your diffuse layer. Select your reflection layer and use Gaussian Blur (ctrl+alt+shift+g) to make any distinct forms unrecognizable. If you’re happy with your reflective texture go ahead and save it out as a 24 bit TGA. That’s 24 not 32. We don’t need that extra specular channel in this texture.

Crazy Bump

Normal and Reflection Maps (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_icy_reflection_normal NULL.jpg)Normal Texture

If you haven’t installed CrazyBump get to to their website (http://www NULL.crazybump NULL.com) and download the free trial. When you’ve got the program up and running click the Folder button at the bottom left and choose the diffuse texture we saved out earlier. You will be presented with two choices after opening your file. The choices are just inverted height maps. Choose the one that best represents the contour of your diffuse material. When doing so remember that white is the high point and black is the low point. After choosing  you will be presented with a normal map and a set of sliders. These represent the different detail forms that will be present in your normal map texture. You want to move the sliders around until you get an accurate representation of your diffuse material form. When you’re finished click the save button and choose to save out only the normal map as a TGA. At this point it’s a good idea to copy this normal map into your Photoshop file containing the other maps. You always want to keep your assets for a single material in the same file. If you begin to run out of space, buy another HDD. Yes that’s right, you might have to spend some money. Who doesn’t like HDD shopping though? Honestly? If new computer parts don’t turn your “geek” on I’m curious as to why your reading a blog dedicated to video game technology tutorials. You’ve got “nerd” in you, it’s OK.

Unreal Development Kit

Setting Up Our Package

After launching the Unreal Development Kit Editor we want to open the content browser (ctrl+shift+f) and click the “Import” button at the bottom left of the content browser window. Now select all the files you want to import.  When you hit the “OK” button the UDK will start to import the textures one by one. For each texture you choose to import you have to set it’s import options in the dialogue box. The only thing I want you to keep an eye out for here is your normal map. When it comes time to choose it’s options change the “Compression Settings” from “TC_Default” to “TC_Normalmap”. Once complete you should be looking at a layout of all the textures you have imported. The last thing we want to do is go ahead and create a new material. To Do this right click in the empty space of your package and select “New Material”. An import dialogue box will appear again, but this time change the group name from “Texture” to “Material”. This will help keep your package organized. Now that you’re looking at your empty material we will start bringing our texture samples into it.

Unreal Development Kit Texture Import Options (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_icy_importOptions NULL.jpg)Material Editor

To add a texture into our material we’ll first make sure it’s highlighted in the content browser then hold down the “t” key and click with our mouse in the empty space of our material. You will need to do this for each node so lets go ahead and finish that. Below is a picture of our final node network for our ice material. If you’re new to the material editor it might look a little scary, but don’t worry I’m going to explain the network one node grouping at a time as we build this material. One quick note before we start: You can view the output of almost every node by clicking it’s black box in the upper left hand corner. It’s a nice feature for troubleshooting.
Icy Material Network Unreal Development Kit (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_icy_MatNetwork NULL.jpg)

Diffuse Input

Part 1: Reflection The diffuse input is going to contain the reflection for our material and since it’s the most complicated part of our network I’d like to do it fist and get it out of the way. There will be two parts to this group, the reflection and  a contrast boost added after the reflection has been mixed with the diffuse texture. To set up the reflection we are going to need four nodes. So lets grab them all and place them on our canvas. the fist node is one already here, it’s our reflection texture sample. The second is an “Add” node. Hold down the “a” key and click on the canvas to drop one down. This node can also be found under the “Math” section on right right hand tree menu. The third node is a “Reflection Vector”. Drop one of these down by holding the “r” key and clicking on the canvas. This node can also be found under the “Vectors” section. Our last node is called a “Component Mask”. This node will help us hook up the Reflection Vector to the UV input of our Reflection texture sample.

If you become lost just refer back to the diagram of the node network posted above. Our Reflection Vector output will plug into the input on our Component Mask. Next the Component Mask output will plug into the “UVs” of our Reflection Texture Sample. Plug the top tab of our Reflection Texture Sample output into one of the Add node inputs. The top tab of any Texture sample represents all three colour values as opposed to just red, green, blue, or alpha as the ones beneath it do. Finally drag the top output of our Diffuse Texture Sample into to the 2nd Add node input. Now marquee drag a box around this group while holding down ctrl+alt. When you let go right click in empty space and choose the “New Comment” option in your menu. This lets you add a comment box around your selection.

Part 2: Contrast Boost The contrast boost is just a “Power” node. You can use Power nodes to increase or decrease the contrast of a network. This node has two inputs. The first is the Base and the second is the Exp or exponent. Drag a Power node onto the canvas from the “Math” section in the right hand menu. For a base input we will plug the output of our Add node created above. As for our Exponent we will use a Vector1Constant (“1″+mouse 1). A Exponent value of 1 will not change the texture. Going down from one will decrease the contrast and (you guessed it) going up will increase the contrast.

Emissive Input

For the Emissive channel we will Copy (ctrl+c) our Diffuse Texture sample and Paste (ctrl+v) it next to our diffuse input. Now drag the RGB tab (top) output into the Emissive input of our material. There wasn’t that easy :)

Specular Input

We want to add some colour to our specular and to do this me need to multiply it by a colour value. Luckily we have nodes that do just that. Hold down the “m” key and click to drop down a” Multiply” node. Next hold down the “3” key and click to drop down a “Constant 3Vector” node. The three values of the Constant 3Vector node can be used to represent RGB and when you put those together you get a colour.  Plug the output of the Constant3Vector node into one of the inputs of the multiply. In the other Multiply input connect the white tab of our diffuse texture. This is where our specular texture was stored when we saved it as a 32bit Targa in Photoshop. Lastly plug the output of the Multiply node into the Specular input of the material. Don’t forget you can view what the result of the Multiply node will look like by clicking the black box in it’s upper left hand corner.

Specular Power

The specular power controls the size of the highlight that is cast on your material. There is no hard and fast rule for this number as your lighting is affected by all the different components that make up your material. What worked for my material may not work for yours. Hold down the “1” key on the keyboard and click to get a Constant1Vector on your canvas and plug this into the Specular Power input of the material.

Normal Input

The last grouping of nodes we have to put together is our Normal Input. Lets start by connecting the RGB tab of our Normal Texture Sample to the Normal input of our material. Now we are going to “bump” those normals of the surface of our texture a bit to give the ice a translucent look. If you go to your menu on the right and scroll to the “Utility” section you will see a node called “Bump Offset”. Drag this node onto your canvas. Now drag the Alpha(Specular) output of your Diffuse Texture Sample into the “Height” input of our Bump Offset node. Connect the output of the Bump Offset to the Normal Texture Sample’s UV’s and then connect the RGB output of the Normal Texture Sample into the Normal input of the material. Increasing the Bump Offset values give the illusion of surface depth which lets you “look into” the ice. At any time you can hold down the “l key” and drag your mouse over your material preview to drag a light around and get a better feeling for how your material behaves when lit.

Conclusion

Final Ice Material With Alternate Versions (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_seamless_finaltotal NULL.jpg)I hope you had as much fun creating your ice texture as I did writing this tutorial. If your not happy with your outcome try again. The material I’m showing as my final was the fifth one I had created. A lot of creating materials is just getting a handle on all of the different settings and knowing what to expect when you combine different networks inside the material editor. If you have any questions email me or post them below. As always I’d love to see your work so post a link or drop me a line. Before I go I just wanted to show a couple other ice textures I created along the way.

Further Reading

Seamless Textures In Photoshop (http://www NULL.terrymatthes NULL.com/articles/seamless-textures-in-photoshop/)

Program Shortcuts Used

Photoshop
New Layer (ctrl+shift+n)
Duplicate Layer (ctrl+j)
Hue/Saturation (ctrl+u)
Burn (ctrl+shift+b)
Dodge (ctrl+shift+d)
Unselect (ctrl+d)
Select Everything (ctrl+a)
Gaussian Blur (ctrl+alt+shift+g)

Unreal Development Kit
open the content browser (ctrl+shift+f)
Copy A Node (ctrl+c)
Paste A Node(ctrl+v)
Add Node (a+mouse1)
Multiply Node (m+mouse1)
Vector1Constant (1+mouse1)
Reflection Vector (r+mouse1)

Seamless Textures in Photoshop

Diagram of How To Copy Seam Edges
Introduction
Prerequisites

None.

Creating seamless textures is an important skill if you want to make your textures cover a large area and tile. Luckily for you the process is actually quite simple. From within Photoshop we’ll look at the Offset function and how to create custom brushes that are unique to the texture we’re working on. Well also be using the tried and true method of clone stamp to get rid of the seams the Offset filter creates.

Photoshop

Document Setup

When creating any texture you want to make sure you’re keeping it square. The dimensions should be the resultant of 2 to any power. That is: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 or 4096.
You also want to make sure your file’s DPI setting is set to 72. The only time you ever want to change the DPI is when you are producing something for print, in which case it would be set to 300. Everything else can be left alone.

Original Texture vs. Adjusted Texture (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_seamless_split NULL.jpg)Prepping Texture For Tiling

When creating any texture that will be tiled you want to make sure that there are no obvious patterns. Take a look at your texture and see if there are any spots that really stand out above the rest. These will give away the pattern as you will be able to spot their repetition. Our entire texture should have a uniform level of detail and colour. That’s not to say the whole texture has to be bland, just make sure that no one part grabs your eye’s attention more than another. Something else you need to watch out for are highlights and shadows. If there are any shadows that are to dark you can lighten them up with the Dodge tool (alt+shift+d). Alternatively you can darken highlights with the Burn tool (alt+shift+b). The texture I wanted was also a fair bit darker so I went ahead and adjusted the over all brightness of the texture as well. Once you’ve removed all outstanding detail from your texture we’ll look at how to create some custom brushes that will let us add less obvious repetitive detail.

Marquee Selection For Brush Preset (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_seamless_selection NULL.jpg)Custom Brush Creation

We are creating custom brushes because we want our cloning process to look as natural as possible. These brushes will be made from features in our texture and will help to hide seams that offsetting the texture will create. Our first step is to grab our Magic Wand tool and use it to select a part of our texture. The selection chosen will be the base for our brush. The selection size is up to you as is what you select. Try to keep the selection smaller so that if used a few times over the detail it creates won’t pattern too much. If you find your selection is too large or too small you can change the “Tolerance” in the tool settings atop Photoshop. The higher the tolerance the more the tool will select. Make a selection you are happy with and choose your Selection Tool (“v” key) from the tool menu. Now navigate to Edit > “Define Brush Preset”, select it, and give your brush a name. There you go, you can now make your own brushes. Feel free to make a few different custom brushes for your texture. The more you have the less obvious the tiling will be :)

Newly Offset Texture With Settings (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_seamless_offset NULL.jpg)Offset

We want to use the Offset filter to align the border edges of our texture. The only downside to using offset is that it leaves 2 major seams that cross our texture at the center. You can see this in the picture to the left. The Offset filter can be found under the Filter>Other menu. When you use the Offset filter you’ll want to change two options. The Vertical and horizontal sliders let you choose their respective pixel distances. We want to set both of these to half the pixel width of our texture. For a square 512px texture that means setting them both to 256. Go ahead and apply the Offset filter to our texture layer. We’re almost done now, but what can we do about these seams?

Clone Stamped Texture With No Seams (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_seamless_stamped NULL.jpg)Clone Stamp

Your texture is Offset now, but we have to get rid of those seams. Let’s start by selecting the Clone Stamp (“s” key) and then picking the custom brush we created from the Brush Menu(“F5” key). Hover over a section of your texture holding down the alt key and then click to set that area as your cloning source. Now you will be able to click anywhere on the canvas and stamp down a section of that image in the shape of your custom brush. Do this to cover all the seams in your texture. Try to do this just as much as you need and don’t stamp over the image edges except where the seams cross the edge. You should also be choosing different clone sources as you go along so you don’t clone the same area over and over.

Diagram of How To Copy Seam Edges (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_seamless_marquee NULL.jpg)Our last step in removing seams is to copy the pixels from the four points where the seams crossed the edges of our document. We want these points to be mirror copies of each other. To do this we’re going to make a semi circular selection at the top, Copy (ctrl+c) the pixels, Paste (ctrl+v) them on a New Layer (ctrl+shift+n), flip them vertically (Edit > Transform > “Flip Vertical”) and move them down to the bottom edge. The same will be done mirroring the left edge’s pixels to the right, but we will flip the pixels horizontally. Once this is done use the Eraser (“e” key) with your custom brush shape to blend the edge of the pasted layers into your base texture. When that is done make sure your layer with the brush pattern is hidden and Merge Visible Layers (ctrl+e) to get a single layer. If you’re a little foggy on the process check out the diagram to our left. We are simply copying pixels from the darker hues, flipping them, and putting them in the place of thier respective lighter hues.

Final Seamless Texture (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2010/12/m_101_seamless_final NULL.jpg)Defining a Pattern

To Test out our texture. We will turn it into a pattern and then fill a new larger file with our custom pattern. To create our pattern we will Select All (ctrl+a), make sure our Select Tool (“v” key) is active, and go the the Edit menu and select “Define Pattern”. Give your pattern a name and create a new document that is at least twice the size of your current canvas. In your new file create a New Layer (ctrl+shift+n) and go to the Edit menu again and hit “Fill”. In the dialogue box that appears under the “Use” rollout select “Pattern”, choose your pattern, and then click “OK”. Your document should be tiled with your custom texture like our example above.  Take a moment to view this and make sure you can’t spot any seams. If you spot any go back and fix them; look close. If there are none you’re done and have added a new skill to your toolset :D

Conclusion

If you’re new to creating seamless textures this tutorial might have been a lot to take in, but that’s OK. Go over it again, send me questions, post a query. I don’t mind lending a hand if you need some help. You will get good at this; trust me.

Further Reading

Hourences – Texture Tricks (http://www NULL.hourences NULL.com/tutorials-texture-tricks)

Program Shortcuts Used

Photoshop
Marquee Selection Tool (“m” key)
Burn Tool (alt+shift+b)
Dodge Tool (alt+shift+d)
Deselect (ctrl+shift+d)
Clone Stamp (“s” key)
Paste (ctrl+v)
Copy(ctrl+c)
Select Tool (“v” key)
Select All (ctrl+a)
New Layer (ctrl+shift+n)
Merge Visible Layers (ctrl+e)
Contextual Menu (“F5” key)

A Few Good Sites…

Links

Here are some sites I honestly think you will benefit from if you haven’t visited them yet.  Yes you do have to pay for a lot of the training in the “3rd party training” section, but those sites produce content worth saving your pennies for.  This post is checked on a regular basis so all of the links should be live. This isn’t one of this “hit it and quit it” link pages. I don’t roll that way.

Social Networking Sites

  • Twitter (http://www NULL.twitter NULL.com/terrymatthes)Catch news about upcoming tutorials and projects.
  • YouTube (http://www NULL.youtube NULL.com/delightningvfx) All video tutorials are hosted here.

Community Links

  • Games Industry Mentor (http://gim NULL.acanaday NULL.com/)Aaron hosts a pod cast with game industry professionals.
  • CG Society (http://www NULL.cgsociety NULL.org/) Thousands of threads to search for solutions to your 3D woes.
  • Concept Art.org (http://www NULL.conceptart NULL.org/)Inspiration by the boat load. Want to improve your drawing skills?
  • Gamer Artists.net (http://www NULL.game-artist NULL.net/forums/)The monthly challenges here will keep you sharp.
  • Polycount (http://www NULL.polycount NULL.com/forums) A great place to go for advice. Thin skinned be warned.
  • Unreal Developer Network (http://udn NULL.epicgames NULL.com/)Anything and everything to do with the Unreal engine.
  • Unreal Development Kit (http://www NULL.udk NULL.com/) A great site to introduce users to the UDK community.

Unreal Artists

  • Hourences (http://www NULL.hourences NULL.com/) Unreal tutorials covering a variety of topics. We all owe Hourences a “Thank you”.
  • Email me to get your site here. (theauthor null@null terrymatthes NULL.com)
  • Dave Prout (http://www NULL.daveprout NULL.com/) Lighting tutorials you can really use.
  • Arcadia Vincennes’ Level Design (http://www NULL.avld NULL.org) Konfused by Kismet? Also has some good level design tutorials.

3rd Party Educators

  • Gnomon Workshop (http://www NULL.thegnomonworkshop NULL.com/) On the Internet? Into 3D?  What are you waiting for? Amazing tutorials.
  • Eat3D (http://www NULL.eat3d NULL.com) Some really great Unreal related Lessons sets.
  • Digital Tutors (http://www NULL.digitaltutors NULL.com) Friendly, bright and upbeat 3D tutorials that are very easy to follow.
  • 3D Motive (http://www NULL.3dmotive NULL.com) A ton of beginner to intermediate 3D game tutorials.

Tools / Programs

  • nDo (http://quixel NULL.se)Create your normal maps in Photoshop with this free tool.