Saturday, June 25, 2011

Game Asset Pillar: UV Unwrap Part II

Okee-doke!  We're still working on unwrapping UVWs, manipulating them in an image editing software (read: Photoshop), bringing the newly edited piece back into 3DStudio Max, and applying this beautiful new texture to our object.  This week, the professor gave us a simpler object than a human figure with folds and bends in his clothing.  To get us started he gave us the type of object we might see as a game asset.  He called it an Avatar Pillar.  It's dirt-simple, yet kind of awesome-looking at the same time.

Pretty cool, right?




This kind of pillar is the sort of thing players might use during a game to gain power-ups or something like that.  Since they're going to be right up on it, we should make it look extra nice.  We got some more instruction on how to put textures on an object, go into the "Edit UVWs" window to flatten the verts and edges into a wireframe, and then use "Render To Texture" to get our flat piece of artwork.  Using the default materials (rusted metal on the ankh and stone on the base) I got a basic flat texture to export into Photoshop.




The program tries to be helpful by adding in shadows to your new diffuse map.  Looks awful.  No problem, though, that's what we've got Photoshop for.  Since I've got Photoshop (PS) on my Mac and 3DS Max is on my fiancee's Windows box, I have to send the file over to the Mac.  After using the Alpha channel to remove all the colored portions of the image I was ready to begin finding, massaging, and placing my chosen textures on the diffuse map.  The prof said he'd like us to have 4 distinct renders of this Avatar Pillar, representing earth, air, fire, and water.  Cool!  A few hours PS work and I had my four diffuse maps.  The Earth map looked like this:

I can fix that seam on the base later and re-import it, I suppose
I used a regular white and gray marble for my base.  I was then able to use the adjustment tool in PS to change the color to suit each element: green for earth, yellow for air, red for fire, blue for water.  These are the same colors that many neoPagans use for candles in their ceremonies.  (You never know when random trivia will come in handy.)  For the earth, I even made a second map with the marble base texture removed and the stone of the ankh desaturated to black and white so I could use it as a bump map.  So far so good.  Then all I had to do was assign the diffuse map to each slot in my material editor (ankh and base), assign the bump map to a third material editor slot, apply them to the image and then I could...



What the...  That didn't look right at all!  The textures were much too small and left blank gray areas visible on the object!  Maybe if I tried it again I'd figure out what went wrong.


No, that didn't work.




Ah, come on!

YOU GOTTA BE $#!**!# ME!

Ten hours of work and this is what I end up with?!  Really?  This is the tough guy assignment all over again.  I did everything I was supposed to do.  I made sure the "render to texture" was 1024x1024.  I thought that was supposed to ensure that it fit exactly the same way the original "rendered to texture" diffuse map did before I dragged it into Photoshop.  What changed?  I don't know.

It's less than four hours until class, I'm tired, angry, and confused.  I'm sure there's some tiny obscure detail that I'm missing that's causing this mess, just like everything else in 3DS Max.  I've gotta get behind the wheel of a car in about three hours and I can't think clearly.  I think I'll just take a nap and bring everything with me to class so I can see what I did wrong.  Oh, and there's a midterm on this stuff in 3 and a half hours, too.  Yay!

Friday, June 17, 2011

Surfacing the professor's Tough Guy

The professor dove into the meat of the class last week.  He spent the class explaining unwrapping UVWs.  He also explained and demonstrated pelt mapping, just to show us how it works.  It doesn't seem to have any real advantages over mapping in a planar, cylindrical, spherical, etc. way.  This lesson was super-complicated.  I was following him through, about, the first half of the class.  After that I started to fall behind.  Once I started that downward slide it accelerated throughout the rest of the class.  By the time we were ready to leave I was totally lost.

Uh oh.
So, we got a model of a guy in a jacket and jeans.  We also got a JPEG of the guy's outfit and face all flattened out.  So far so good.  As I understand the process, we are to take each part of the model, display it's planar faces in the "Edit UVWs" window.

Something like this.
We then clean up the vertices and edges and make them, somewhat, fit the flattened out pictures of each item.  At this point my brain says, "a wizard walks into the room, waves a wand, and the images are properly wrapped around the model."  I say that because that's as far as my understanding of the subject has gotten.

Take a look at the "Edit UVWs" window on the right half of the screenshot below.  The irregular green box with the hole in the top is the flattened representation of the body of the model's jacket.  The picture of the model on the right shows a patchwork of the flattened out JPEG as it actually mapped onto the jacket.  What a horrid mess!!


It's worth noting here that, before I made this screenshot, I had gotten the jeans in the "Edit UVWs" window to match the JPEG image of the jeans.  Look at the leg of the model.  Another patchwork disaster.  What happened?  I don't know.


I collapsed the modifer stack, hoping that I could just hold onto what I'd done and start working on another piece of the model.  Maybe I'd have more luck with the jacket sleeve.  Collapsing that stack seemed to completely reset the "Edit UVWs" window.  All that work I did on the verts and edges for the jeans and jacket.  Lost!
And the mapping on the model is still a trainwreck.

I then went right into selecting all the faces on the sleeve.  I applied the UVW Modifier to the stack on top of "Unwrap UVW" which, itself, was on top of "Editable Poly".  Under "Parameters" I made the mapping "Cylindrical".  As I adjusted the size of the cylinder, I noticed that the map on the rest of the model was changing.  I hadn't even selected the rest of the model.  Why was it changing.  I don't know.
What the frak?




The "Edit UVWs" window for that step looks like so.


I can't seem to figure this stuff out no matter how hard I fight.  There are so many details he went over in class and I couldn't write fast enough to get them into my notes.  I tried reading the Help file's chapter on the UVWs Modifier.  It told me about the fantastical, magical things this tool can do but didn't give enough of the step-by-step visual instructions a right-brained artist like myself needs to figure out how to make it do these things.  To top it off, when it seems like I'm starting off correctly, the program throws away half an hour of work without even explaining why.

I don't know what to do, and class is only nine hours away.

New Class, New Challenges

This summer semester I'm taking 3D Lighting and Surfacing 1.  We learned to make basic models in the previous class (3D Modeling 1).  We now need to learn how to cover them in textures that make them look real and light them realistically as well.  I did some of this in the previous class.  This semester's class specializes in that.

Remember that Ammo Room from last class?  We used it again for this one.  This first class assignment I just used the basic shapes as a way to show how my lights would bounce around objects in a scene.  For this I used the basic gray objects instead of the textured objects from last class.  We were asked to use lighting to create 4 different atmospheres or moods.


This first one was just a basic yellowish light with shadows turned on.  I left the windows dark outside.  You can see how the stark single light casts shadows from objects in the room.  That's not all I had to do, though.  You see, these objects don't bounce light off themselves the way things in the real world do.  The overhead lamp was a directional spotlight placed in the same location as the bulb.  I then put an omni at the floor level, the same color as the overhead light to simulate that light bouncing off a white concrete floor.   There's another weak omni light hovering at ceiling level to fill the room a bit more.



The next one was almost the same except I changed the color of the light to red.  I think this turns the Ammo Room into a sort of darkroom.  Whoever works in here is either developing photographic film, or he's going out immediately into the night and he doesn't want to compromise his night vision.  The light bouncing off the floor is red but the shadows are slightly bluish.


This next one is an afternoon scene.  I accidentally made the lamp shade slightly transparent, but that's fine.  I added a yellow-orange directional light outside the window to simulate a sunset.  I also placed a plane outside the window with a desert sky simulating that sunset.  For some reason the map didn't render.  you see the reflection of the sunset on the boxes in the room but not the light out the window.  Frustrating.  I also added a faint omni light just in front of that box.  It's the same color as the sunset light and you can see it reflecting off the barrel next to the box.



Fourth one was meant to be an underwater scene.  To enhance that feeling I made the lamp shine a kind of washed out teal color.  The directional light from outside was changed from sunset orange to underwater blue.  Again, there was supposed to be a plane with the underwater seascape but it didn't render.

This was a decent exercise for helping us think about how light bounces around in the world and what reflected light does from object to object.