« Posts under Rigging

[R&D] nHair Chain Strand Rig Part 2 of 2

This post is a continuation of my last post here (http://www NULL.terrymatthes NULL.com/maya/animation/maya-nhair-chain-strand-rig/). In the first post I explained that I was trying to create a strand of chain that was dynamic, but pinned at both ends like a strand of Christmas garland. At the time I wasn’t able to find any information on how to pin the loose end of the chain to an anchor pertaining to nHair. All tutorials I read/viewed were to do with the legacy hair system whose constraints don’t work on nHair curves. Well I’m here to report that I’ve found the solution I needed.

When working with nHair you need to make sure any objects you want it to interact with can also be seen by the nucleus solver. For my purposes this meant turning the polygon object representing my anchor at the end of my chain into a nMesh passive object. Once my polygon anchor was converted it could be used for a “component to component” nConstraint. I constrained the last CV in my dynamic hair curve to a vertex on my polygon anchor. Everything works great now and I can move either end of the rig around and it affects the chain as it should.

Time for bed *yawn*… well maybe a couple episodes of Full Metal Alchemist first. Damn you Netflix!

 

 

[R&D] nHair Chain Strand Rig Part 1 of 2

Rigging… It’s not my favorite aspect of 3D, but that’s probably because It’s also my least practiced. What better way to learn though than to jump right into nHair and IK Splines, right :D ? My end goal with this rig is to have several strands of chain that are strewn across a mirror ball attached at several points, think of garland on a Christmas tree if you need a visual. As always to start I researched how this could be accomplished in Maya. Every tutorial I read/watched mentioned IK splines and Maya’s hair system.

It took me the entire morning, but I was eventually able to produce a chain strand constrained on a single end. The biggest problem I ran into was constraining the far end of the chain to an object. Literally all the tutorials out there are using the old Maya hair System. With the copy of Maya I currently have (2014) you are forced into using Maya’s “nHair” system and the “n” stands for “Nucleus”. Nucleus if you’ve never heard of it is Maya’s new dynamic simulation system that unifies all your dynamic elements so they can operate in conjunction with each other. It’s Very similar to how Side Effect Software’s program Houdini works. So great, “yay”, everything works together, but all the constraints mentioned in the tutorials I watched are based on the old hair system and they do not work with nucleus hair. So this is as far as I have gotten today, and It will probably take another half day to find the proper type of constraint that acts in the same way a “stick” constraint does with legacy hair.

There are plenty of scripts out there that will do this task for you, but I try to avoid scripts when learning. I that find that; (A) it’s essentially letting someone else do the work for you which means you didn’t actually learn anything and (B) depending on how the script works, it could have unintended consequences immediately or down the road. For those of you who have never created anything like this before and are looking for answers here are the steps I used to create the rig and as always don’t be afraid to ask questions :)

  1. Model a chain link and then duplicate it over and over to create whatever length of strand you need.
  2. Use the joint tool to create a joint chain all the way down your strand putting a joint between each place where the pieces of chain meet up.
  3. One by one starting with the top chain link and the top joint use the rigid bind tool to bind each link to its corresponding joint. In the rigid bind options make sure you have the “Bind to: Selected joints” option activated.
  4. Draw an EP curve down the length of the chain adding a point over each of the joints you previously created. Press to “P” key to activate pivot snapping and your points will automatically center on the joints. Rename this curve something like “epc_original”.
  5. Make your curve a dynamic nHair curve through the nDynamics > nHair menu. You need to first make sure that the only option in the “Make Selected Curves Dynamic” option box that is selected is “Attach curves to selected surface”. This will now create a hair system and follicle system in your outliner.
  6. The last step is creating the IK spline and this is where most people make a mistake because they select the wrong curve. In the Animation > Skeleton menu select the option box for the “IK Spline Handle Tool”. Make sure the only option selected is “Root on curve”. With the tool active click in this order… the first joint of your joint chain then the last joint on your joint chain and now open your outliner and hold down ctrl(PC) or cmnd(Mac) and select the curve under the “hairSystem1OutputCurves” node. An IK node should now appear in your outliner.
  7. Lastly select the original curve and parent it to whatever piece of geometry you’d like to constrain the top of the chain to. Now if you use the interactive playback feature and drag that geometry around your chain will follow.

As soon as I figure out how to constrain the other end of the chain with nHair I’ll post an update, and if anyone figures it out before I do then please let me know. Bye for now :)

 

UPDATE!

Part 2 : The rig gets completed with moveable anchors at both ends. (http://www NULL.terrymatthes NULL.com/maya/animation/nhair-chain-strand-rig-part-2-of-2/)

Maya Fur Tips

Fur as grass

Fur as grass (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/04/furpic NULL.jpg)
Hey dudes, and dudettes. Here’s a few tips on dealing with Maya fur as it can be a little hairy… get it?! Seriously though, Maya fur can be confusing and a little tricky to work with, so if you don’t have cash to blow on some fancy plugin here are a few tips to help you guys out.

A) Triangulate your fur surface! Fur seems to like triangles. If you notice you’re getting odd bald spots this can be the reason.

B) UVs are KING. Maya fur is heavily dependent on the face distribution of your model’s UVs. Tiny faces on your UV sheet are going to have really really low fur density. More often than not you have to create a second set of UVs for fur to operate on. This is OK though as the fur menu lets you choose which UV set to base your fur on. To access this menu go to Windows > Relationship Editors > UV Linking > Fur/UV. Make sure you are giving an even face distribution on your new UV set.

C) You will NOT see textured colour in your fur even after hooking up the proper tip and base colour maps until you hit the “Bake” button at the top of the fur description. Anytime you add a new maps in you’re going to want to bake as well.

D) Fur colour is very sensitive. The maps plugged into your fur descriptions colour slots should be crushed down quite low. For the fur above my “Color Gain” values in the file node’s “Color Balance” roll out were set as follows: Base Color=0.130 Tip Color=0.310 Base Ambient Color and Tip Ambient Color =0.230

E) If you fur shadows aren’t showing up you will have to increase you “shadow density” in the fur description under the Mental Ray roll out.

F) Work in a linear fashion aka Linear Workflow (http://vimeo NULL.com/8119194).

That’s all for now. May the fur be with you!

[Game] Tombstone WIP 3 – Cloth

Maya Cloth Skeleton

Blowing Scarf (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2012/12/tombscarf NULL.jpg)Since my last update I’ve added a cloth skeletal mesh to the scene. Cloth inside the Unreal Development Kit is something I’ve always wanted to take a look at.  After watching a quick tutorial over at 3D Buzz (http://www NULL.3dbuzz NULL.com/vbforum/sv_showvideo NULL.php?v=3830) I was ready to start setting up my cloth in Maya. The video is good, but it skips the entire rigging process and starts with a pre rigged 3D plane brought into the UDK. I looked around on the internet for some Maya specific tutorials, but there weren’t any. The first thing that caught me while working this out was the use of the term “bone“. A lot of the tutorials instruct  the reader to add two bones to the mesh. In Maya you don’t really lay down bones. You’re laying down “joints” and what I would consider the bones are the shapes Maya creates between those joints. Before you start you’re probably going to want to jump into Maya’s Animation tab so all the rigging tools are on your shelf. The first step in Maya is to place two joints in a chain along the X axis fairly close together. The next step after you’ve created these joints is to use a “smooth bind” to pair the joint chain with your mesh. That command is under the Animation Menu > Skin > Smooth Bind. Now with the joint chain bound to your mesh you can begin to “paint” your vertex weights. After being bound each joint in the chain stores a separate value for each vertex. Every individual vertex value lets the joint know how much influence it should have over that particular vertex. A value of 1 means the joint would act upon that vertex with 100% of it’s influence (or movement). A value of 0 means that the vertex will not follow that particular joint at all. Below I have a diagram showing how your joints should be setup and named. UDK will later ask us which bone we want associated with the cloth movement.Maya Cloth Skeleton (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2012/12/bonesetup NULL.png)

Now that the mesh is rigged go into “Object Mode” and use the right click menu to access the “Paint Skin Weights Tool“. Make sure you have textures enabled in your viewport when you’re doing this. You also have to be in the “Default Quality Rendering” mode under your perspective views “Panel” menu to see the weights change as you paint. The first joint “bone1” is going to be associated with all the parts of your cloth mesh you don’t want to move. For my scenario I have painted all the vertices of the knot white and all the vertices of the two scarf arms black. I do this because I don’t want the knot to move at all.  I’ve included two diagrams below to show the weighting of my vertices to both bone1 and bone2.Bone one Weights (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2012/12/bone1 NULL.png)Bone Two Weights (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2012/12/bone2 NULL.png) After you’ve weighted your vertices you can export the mesh as a FBX for import into the UDK. On import the UDK should recognize your mesh as a skeletal mesh and give you a different window type when it’s opened up through the UDK Content Browser. After import there are a few properties you need to activate in your mesh.

First you need to open up your cloth mesh in the content browser. You should now have the AnimSet Editor open. This is because UDK is treating our cloth as a “Skeletal Mesh“. The first property we want to activate is “Force CPU skining” this will tell the UDK that we want our mesh to be treated as a cloth. It’s found under the “Skeletal Mesh” roll out in the “Properties” pane. The second and final property we need to change is under the “Cloth” roll out. When there expand the “Cloth Bones” roll out and hit the green cross to add an entry to the Cloth Bones list. Now click in the name space for that entry and call it whatever you named the second joint in Maya. In my case it was “bone2”. With this done you’re now ready to place your mesh into your game scene.Cloth UDK Mesh Properties (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2012/12/Scarf NULL.png)

Make sure your mesh is selected in your content browser and then right click in one of your views so that you may add your mesh to the scene. Once your mesh is in the scene you need to change a couple of it’s properties that we couldn’t access from the AnimSet Editor window earlier. Under the “Skeletal Mesh Actor” roll out there is a sub section called “Cloth” expand this. Under here we can Cloth In Game Mesh Options (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2012/12/Scarf2 NULL.png)see the first option “Enable Cloth” and a lower option called “Cloth Awake On Startup“. Enable both these options. As an optional step you can play around with the wind values to try and get your mesh to receive a constant blowing force. To now see your cloth in action you can rebuild your map and launch the level, or simply right click in the perspective viewport and chose “Play From Here“. Cloth doesn’t animate in the viewport’s “Game Mode“.

That’s it for this Tombstone project. I hope anyone following along found some cool tips to help them get a little more out of the UDK.

Cheers,

Terry Matthes

Flower Stem Rig

flower bent by dynamic hair deformation

I had problems. I talked to people. I now have less problems. This is generally how I like my troubleshooting to go. The last problem I had with my project was getting the animation deformers at the top of the flower to follow the stem when I bent it. In newer versions of Maya (2011+) there is a constraint type “point on poly”. This worked quite well. I grouped the flower head along with all its deformers and then parented that group to the top center vertex of the stem’s poly cylinder. One problem down, about a dozen more to go. I don’t mind running into walls, not being able to climb them is a different story :P

grouped Deformers following vertex modified geometry (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/07/stembend NULL.jpg)

My next challenge was getting the stem to grow and take the flower head with it. There was a few different ways I could have approached this. While figuring this problem out I had to keep in mind that the stem might be bending and curving while growing. At first I thought I could just increase the scale of the stem, but as the stem got bigger and the bend modifier curve grew larger the mesh started to lose shape because it’s resolution was too low. A quick Google search came up with a video (http://vimeo NULL.com/7420996) on how to rig a vine by Jordan Blit. In this video Jordan hooks up a simple connection between the vine’s “Y scale” and a “poly split ring” node’s “divisions” attribute. This seems to be a terrific way to grow the stem and maintain its shape no matter the length. There are a few other things Jordan sets up to make this error-proof and you should definitely check it out. I should mention that your construction history must be kept intact for this to work. If you clear your history the connection to the “poly split ring” node will be broken. When finished I added a constant variable via Mathematic Nodes Mental Ray (http://www NULL.creativecrash NULL.com/maya/downloads/scripts-plugins/rendering/other-renderers/c/mathematic-nodes-mentalray-support---2) plugin that multiplies the divisions by 2. This gives us a higher resolution mesh. Terrific :D Our stem now grows and deforms to our bend modifier, plus we’ve given ourselves a “hook” to grab via our math constant to increase our mesh resolution. Now I need to set up our stem so it can be affected by dynamic forces.

flower stem's "y scale" relationship with the poly split ring" node (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/07/stemscale NULL.jpg)

A friend and fellow 3D student mentioned rigging the stem up with a skeleton and using IK handles. He pointed me to this video (http://vimeo NULL.com/6044700) by Alex Villabon. In this video Alex gives a grass mesh a simple joint chain and then uses a Maya hair to deform the skeleton, which indirectly animates the mesh. I liked this method, but I didn’t want to use any joints in my flower rig. Keeping the rig “light” was important given the possible amount of flowers in my scene. Instead of controlling the stem indirectly with a joint chain I decided to make the hair directly control the stem by making the hair a “wire deformer’. A wire deformer is a curve which shapes the geometry it’s parented to. You can alter your curve and watch the geometry conform to its shape. This works out well because the hair is inherently affected by dynamics and it will control the shape of our stem. Now that the stem is set up correctly I have to start on the animation for the flower head. It has to transition from a bud into a fully bloomed flower.

flower bent by dynamic hair deformation (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/07/flowerhair NULL.jpg)

At this point I still don’t know whether I want to use blend shapes or modifiers to animate the bud opening. I’m thinking blend shapes might be overkill as the bud is really just a sphere with 5 sections that peel back to let the flowers petals grow out. What do you guys think? In case anyone is interested I have started a thread (http://forums NULL.cgsociety NULL.org/showthread NULL.php?f=88&t=989384) regarding this project over at CG Society (http://www NULL.cgsociety NULL.org/).

Here are links to the videos and plug-ins I mentioned throughout the post.

Alex Villabon
Animate Joints With Maya Hair (http://vimeo NULL.com/6044700)

Jordan Blit
Growing Vine Rig (http://vimeo NULL.com/7420996)

Creative Crash
Mathematic Nodes Mental Ray (http://www NULL.creativecrash NULL.com/maya/downloads/scripts-plugins/rendering/other-renderers/c/mathematic-nodes-mentalray-support---2)

Flower Update

Flower with bend modifier applied

So everything was going as expected. All was well in the land of flowers and Maya… well almost. I’ve run into a snag when it comes to bending the flower. My non-linear bend modifier controlling the stem don’t seem to be moving the rest of the modifiers associated with the petals and filaments. Only the geometry of the petals and filaments is moved. I have tried all sorts of different parenting and grouping methods. Nothing seems to make the modifiers move. I think that when moving objects with modifiers Maya doesn’t register the geometry moving in the same was as if you translated it. Since the translate is not updated the parenting structures seem to be of no use. The modifiers just say in place. Quite frustrating if you ask me.

I’m looking into parenting the modifiers to a vertex or face. I quickly came across this plugin: DJ Rivet (http://www NULL.djx NULL.com NULL.au/blog/2006/11/11/djrivetmel/). DJ Rivet creates a hair follicle and parents the follicle to a geometry face. It then parents your object to the hair follicle. This plugin looks to be exactly what I need, but I am having 2 problems with it. One; it doesn’t want to install properly for me. When I got to load the plugin it doesn’t show up in Maya 2011. I have placed it in the bin/plugins directory where all the other plugins are, but it doesn’t show up in the plugin list in Maya. Two; it has been said by a few people that this tool doesn’t parent well to geometry that is being deformed :(

I might have to write a custom script for this. I’ve never done that before and it’s actually a little daunting. I figure I can track the position of a face on the stem by averaging the world position of the 4 verts surrounding that face. I can then grab that faces normal orientation and use it to set the rotation of the grouped deformers. As long as the face referenced is one from the top cap of the stem cylinder I’m thinking this should work. Consequently if anyone knows a far easier way, or a script that’s already been developed please let me know. To better visualize the problem here are three pictures showing the static flower, the bend flower and the deformers themselves.

Flower unbent (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/06/flower_static NULL.jpg)

 

Flower deformers (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/06/flower_deformer NULL.jpg)

 

Flower with bend modifier applied (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/06/flower_bend NULL.jpg)

 

I think now is a good time to take a break from the rigging side of things and concentrate on the materials. I always like to switch gears when I become frustrated with a project. This way I can keep making progress without deterring myself from continuing on. For now I think I will just model a branch and manually place the flowers along it. When that is done I will get back to setting up the modifiers properly.

As always any comments, critiques or recipes for the best summer cocktails are appreciated :D

Flower Power

Flower geometry with non-linear bend modifiers

Hello. There’s been a little bit of a transition lately as I’ve moved to a new apartment and wow am I happy to be back in Osbourne Village. If you don’t have a car this is the best place to live in the entire city IMO. There are so many shops and I’m a five minute walk away from Safeway. On top of all of that my new bus to work takes 25 minutes and it’s an express. WUT! I’m almost entirely unpacked, but the most important part of the move (my computer :D ) is all setup and ready to go. I’ve wanted to do some kind of flower render for a long time and now I’m just getting one under way. I really like taking pictures of plants and flowers wherever I go and when I went to Nice a few years back I snapped a plethora of shots for inspiration. Here are a few thumbs.

Flower thumbs (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/06/flowers NULL.jpg)

I’ve modeled the main flower so far, but I still have to do the branch and buds. My plan is to model one flower and hook the petals and filament up to non-linear Bend modifiers. The petals have one running vertical as well as horizontal. This way I can control the petals cup shape on the fly. After I model one complete flower I will group the objects that make up the flower and then apply “Duplicate-Special” to the group and check the “duplicate input graph” section of the option box. If you don’t do this the non linear modifiers will duplicate, but they won’t control the duplicated geometry. The next part of this project is to animate the flower growing. These bend modifiers will help me control the movement and shape of each element through the diffrent stages of growth. If you’ve never used modifiers before they are located in the Animation menu set under Animation < Create Deformers < Non-Linear < TypeX. Each modifier has unique controls that are dependant on the type of modifier. A “‘Bend” modifier has a curve attribute as well as standard controls to extend or lessen influence of the modifier. A modifier such as “Sine” will have attributes such as frequency, which you would expect from a wave based tool. All of the modifiers are curves who’s shape modify the geometry much like a lattice (http://caad NULL.arch NULL.ethz NULL.ch/info/maya/manual/UserGuide/CharSetup/DeformLattice NULL.fm3 NULL.html). In fact pairing these tools can give you some great control over your objects and their animation. The only drawback to this method seems to be the duplication.

The only way I can duplicate the geometry and keep the modifiers working is to make the duplicates instanced copies of the original flower group. An instanced copy of an object references the source object for all properties, essentially becoming a copy cat object. This means when you pull on one of the bend modifiers it will control the same part of each instanced flower in the exact same way. I’d like to sprinkle some randomization into this, but I’m not sure how to at this point. Posted below are a few in progress shots of the flower with some of the non-linear modifiers applied. Like always if you have any questions post a comment and I will do my best to answer it :)

Flower geometry with non-linear bend modifiers (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/06/flower_rough NULL.jpg)

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)