Friday, January 24, 2014

A bit of 3D

There' has been a bit too much stuff to do besides FMP work, but I believe I've managed to get quite a bit of work done. The building modules were remade to fit CryEngine grid, and some actual details have been modelled. Main issue with these is to make all the pieces fit together without gaps. In the beginning I defined standard size of the individual modules of the house. However, it causes issues with roof, curb and road pieces, as they don't necessarily fit the building in the end. All because of the underlying measurement issues.
In any case, after making some compromises everything fits, and quite a lot of building shapes can be achieved with this kit.


Modelling process is not especially challenging, but rather... tedious? There is quite a lot of repetitive work. It should become much more fun once I get to make decoration elements.

← Previous post Next Post

Friday, January 17, 2014

Engine troubles

I've spent some time trying to make the dynamic lighting work in UDK. Well, it does work, but the quality makes me want to tear my eyes out. I tweaked the various settings of the lights and objects in editor, I tried disabling end enabling features in the .ini file, but all this resulted in choppy, pixelated shadow.
Tired of all this, I exported my pieces into CryEngine. Interestingly enough, I ran into a lot of the same issues with the shadows there - some of them are simply incorrect, some are choppy, and the draw distance quality decrease is very obvious.. But still, everything looks much, much better - modules stick together seamlessly, and there is no chopping of the shadows. And I did not ven tweak the quality yet.


I'm losing the amazing material editor, but lighting is quite important after all. I'm also not that familiar with the editor, so I'll have to catch up. Luckily, I'm not going to have to use the terrain features, as most of my work will consist of importing models in and sticking them together.

← Previous post Next Post

Wednesday, January 15, 2014

FMP update

So, here's what I've been doing in the past couple of days.
I've made some 20-30 modular pieces of a building, all aligned to UDK grid. Stuck them together to make a rough layout of the district.

Here's the problem. Originally, I intended to have dynamic global illumination in order to be able to get various lighting settings for different moods. I remember seeing Mike's FMP last year, and shadows looked quite good there.
Generally dynamic shadows look horrible in UDK. I tweaked the light settings in the editor, and they still looked awful. Some setting did not affect the quality at all. So then I went and changed certain settings in the UDKSystemSettings.ini, and while the shadow quality improved tenfold, they still looked weird up close. And even such an improvement comes at a cost of performance.


So I spoke to Mike about that, and he told me that actually nothing else can be done. Shadows look okay ish in his scene because of the irregular surfaces and textures with a lot of detail variation. They kind of mask the choppy irregular shadows.
I spoke to Mitch, and got similar response.
Then I though - screw that, it'll do with static lighting just fine. So what if I can't move the lighting, I'd rather go for smooth and beautiful shadows. What can go wrong?
Turns out - a lot. In order to create this rough whitebox I used almost 2000 individual pieces. Instances, obviously. Baking the lighting for the whole scene on the lowest quality takes about an hour, and UDK crashes during the lighmap encoding.
Merging the assets into one object using the Simplygon solution would be a cool workaround, but the issue with it is that it also compiles the horrible shadows into the diffuse map. So in order to combine the building into one mesh to decrease light baking time, I have to bake the lighting first. Not even mentioning that merging a small building into one mesh takes about 5-8 minutes.


So, my options are, currently:
a) Stick to the improved dynamic shadows, and hope that they will be less apparent on textured surfaces. Or maybe I'll find a setting combination that looks better.
b) Combine the pieces of the objects in 3ds max. Which defies the purpose of the modular approach.
c) Switch to CryEngine. Which I used a couple of times, but know nothing about some advanced stuff I'll need.

I doesn't look very pretty at the moment.
← Previous postNext Post

Monday, January 13, 2014

Reference and assets

Last week I walked around Riga to take some photos of Art-Nouveau buildings. There are quite a lot of images, so I'm not going to post them all. However, the full album can be found here.


Most of my other reference is collected from various sources on the internet.

I've decided to figure out the best layout of the old building first, then build the futuristic elements on top of that. At least, this is what would happen in a real life scenario.
After briefly analysing the building structure, I noticed some similarities. Most of them can be divided into roof, top window row, middle double window row, and bottom window/door row. There is also usually a central extruded bit, and sometimes a corner.


Based on this, I've decided to make 2-3 variations of basic elements, plus roughly the same amount of façade elements such as statues, columns, patterns. Combine that with several types of tileable textures, and the amount of possible variations is pretty impressive. At the moment, the asset list looks like that:

top_reg x3
top_ctr x3
top_cnr x2

mid_reg x3
mid_ctr x3

bot_reg x3
bot_mid x3
bot_cnr x2

roof_reg x1
roof_cnr x1

window x2

balcony x2

statue_head x2
statue_standing x2

facade_elmt x3

column x2

I may add or get rid of stuff depending on how much time I will have.

Another very interesting thing I noticed while walking around is that buildings in poor condition are covered in mesh to protect the street from falling stucco and dust. The ones that are being renovated have their façades completely covered by scaffolding. All of this can be used to add variety to the level, and maybe block the players path to restrict the area available for exploration. They should be pretty easy to make as well, helping me to conserve time.

Next post

FMP timetable

A rough timetable for my FMP work. I do not intend to stick to dates, but rather use them as guidelines.

Friday, January 10, 2014

Character project

The goal of this project is to create a fully textured and rigged 3d model of a female warrior from any of the following areas:- Africa
- China
- Japan
- India
This can be a real person originating from any point in history up until now, or it can be a mythical character. In the latter case, their body structure and proportions must be close to that of a real person.

Budget:
15,000 Triangles (Excluding background elements / pedestal)
1 x 1024 x 1024 Diffuse, Normal, Specular
1 x 512 x 512 Diffuse, Normal, Specular (for the head)
1 x 512 x 512 Alpha (if required)
Texture format – targa.

Final result must consist of a textured mesh, rigged and posed to produce presentation renders. Rendered images can be produced either in 3ds max, using real-time viewport shaders, or standalone programs such as Marmoset Toolbag.

Software used:
3ds Max 2013
Adobe Photoshop CS6
Knald
Marmoset Toolbag 1.10

Idea
During planning stage I went through quite a bit of information on prominent historical and mythical female figures of the cultures specified by the brief. However, most of them didn’t have enough visual reference, or they weren’t that impressive.
In the end I stumbled upon some interesting photos of female pilots of Chinese Air Force. Since the brief mentioned that the character can be modern, and pilot is technically a warrior, I decided to go for it. After all, it is much more original than another Asian lady in armor, Indian goddess or African tribeswoman. I’ve gathered some pictures from various websites that covered jet pilots getting new suits several years ago. Interestingly enough, it’s easier to find these photos of female pilots than male pilots of Chinese Air Force. In addition, I’ve gathered some separate images of anti-g suits and helmets that MiG jet pilots wear in order to better understand their structure.




Work
I decided to go with the workflow that I think works best for tight schedules.
1. Low poly mesh modeling
2. High-poly sculpt based on low poly
3. Low poly adjustment to better fit changes in made during sculpting
4. Unwrapping, map baking
5. Normal map adjustment, image and height map based additions
6. Diffuse, specular creation
7. Rigging
8. Export, rendering

1. Low-poly
I started off with a drawing of female proportions to use as a reference in the scene. Some additional images off the internet besides the initial pilot photos were used to get Asian proportions more accurately. Her proportions were intentionally made to be not overly feminine since she, after all, has to be quite a strong to withstand physical challenges of fast acceleration during flight.
The scene was set up to use centimeters as a primary measurement unit. Height of the character was set to be roughly 160cm, an average height for Chinese women. Basic biped was modelled to fit the reference. Arms positioned at ~30°, legs slightly apart, some initial joint and topology loops. To get the topology right, I mainly looked at the pages on Polycount wiki throughout the project.
The main idea I’ve got from the limb topology page is that minimum of two loops are required for proper deformation of the joint. Preferably with a slightly wider gap between the two on the inner part of the bend.
This page also has some amazing reference on hand topology. My initial attempts weren’t very close to real life, both in positioning of the fingers and topology, but I think I got it right in the end.
The general character topology page was quite useful as a reference for breasts, abdomen and behind. I didn’t know exactly how to position the loops properly on those parts of the body, so it helped me out.
Another thing that I used as a proportion reference is an in-game model of Faith from Mirror’s Edge. She’s a small, physically strong Asian lady in modern clothing, so it was a perfect fit. This model helped me realize that since I drew the proportion reference for an undressed person, my biped is too flat. I needed to make the hips slightly wider, and the buttocks more round. Chest area had to be made slightly bigger around the armpits to make for the cloth that is dragged up by the arms. Breasts had to be readjusted slightly. I also added a small bend to the arms to make for a more natural pose. A lot of fabric fold geometry was added as well.
But the best thing about that in-game model is the facial topology. It is the best reference I could ask for. Luckily for me, most of the head is covered by the helmet, so I didn’t have to spend too many triangles on the scalp and hair.

2. Sculpt
When I felt that the mesh is more or less everything I could do at the moment, I spaced individual parts apart, and gotten rid of symmetrical parts of the body. Then I exported the scene to Mudbox. I prefer Mudbox over ZBrush mainly because of the interface. It is much closer to a standard 3d modelling software and much less cluttered. Interface and general interaction in ZBrush seems to be designed by an alien to me. Another reason is that I simply do not need nor do I know how to use all the functionality of ZBrush.
In any case, this allowed me to sculpt most of the medium to large details. Clothing folding was observed on reference photos and in real life with the actual clothes I wear. However, I think that they are still slightly off in most places.
Certain bits like the boot leather and helmet lining were sculpted separately a bit later into production.
Several things in high-poly mesh were made entirely in 3ds max. Face, for instance, was just turbo-smoothed, and screws were placed on the helmet using the Graphite mesh paint tool.


3. Low poly adjustment
After importing the high-poly mesh back into 3ds Max, I still had 8 or so thousand triangles left in the budget of the low-poly. So I’ve spent them generously to smooth out the round bits that were too angular. This includes edges of the g-suit that stick out over the main pants, limb joints, clothing folds, but mainly the helmet and the face. That potato-shaped Asian nose has to have quite a lot of triangles to look smooth.
I have to admit, however, that I realized later during the texturing stage that I’ve made several mistakes in the face topology, that cause some weird shading around the nose, on the jaw, and above the bridge of the nose.
The budget was high enough to allow to model such details as holes on top of the helmet, or hooks for the chin strap, while normally they would be made with normal maps. After fully modeling the mesh, there is still almost a 1.5k triangles left. This is a pleasant change from the usual university projects that normally have budgets slightly higher than that of an iPad game.


4. Unwrapping and baking
The model is pretty much symmetrical which allows for decent UV space reusability. Exceptions are the pocket on the right leg and the inflation hose attached to the right hip. Unfortunately, since the texture budget is very low, I had to reuse texture space for symmetrical parts. As a result attached bits have no folds around them, which is a pity. Unwrapping both parts of the pants separately would not help because the small folds would not be visible in the pixelated mess of a low res texture.
Other than that, there are only some slight issues like folds being too obviously mirrored on the front and the back of the model.
Normal maps and some shadow maps were baked in 3ds Max. For some reason the xNormal result was slightly pixelated.
Unfortunately, only after the unwrapping and baking was done, I noticed that the suits are supposed to have zippers on their sleeves. But it was already too late to change the geometry and UVs, so I had to skip those.

5. Normal map edit and addition of image-based normals.
Unfortunately, I did not manage to get small details into the sculpt, so they had to be generated from the height maps. Pretty much all the seams, some smaller folds, zippers, belt and pouch details, helmet hinge details - all were created this way using Knald.
Original bake was not ideal as well, so it had to be edited manually. Some larger folds ended up pixelated because of the high poly being stretched in these places. There were some issues with how they baked out inside of the sleeve, so they had to be painted over. Mirroring seam issue had to be solved as well.
Channel orientation was a bit of a hassle. 3ds max has this glitch when in the viewport it displays normal map with inverted green channel on a mirrored part, but render comes out fine. It is incredibly annoying to not see the proper result straight away. Also, 3ds max uses inverted green by default, while Marmoset uses normal green, so that is easy to forget sometimes.


6. Diffuse and specular
For textures I usually use the following pipeline:
1. Definition of plain colours
2. Overlay with rendered ambient occlusion, cavity and convexity maps
3. Adjusting the colours, adding tonal variation.
Working resolution of .psd files is double that of the end textures – 2048p for body and 1024p for the head.
Since the final normal maps were created using a combination of rendering and height maps, ambient occlusion and other maps cannot be baked for those image-based bits. For this reason I used Knald to generate those maps from a normal map.


In addition to that, certain photos were used as overlays to add to the texture. I’ve used a fabric texture (sourced from a piece of cotton fabric) for all the clothing, leather texture (sourced from a pair of leather gloves) for the belt and pouch. Backpack fabric texture (sourced from my backpack) was used for a chin strap and gray upper belt.
All stitching textures were made by painting dotted lines and using a dark 1px semi-translucent stroke effect.
Insignias (coat of arms?) were originally intended to be cropped out from the photos of the pilots, but the resolution was too low, so they had to be painted by hand. Head texture proved to be a bit of a problem. It is four times smaller than the body texture (understandably, but quite often it is the other way around), so after laying out the UVs, turned out that the face is too low res. I think there is only a pixel or so used for the lips. Thinking about it now, I probably should have moved the helmet to the body texture and devote the whole texture space to the face to make the texture resolution more even across the model.
In any case, diffuse texture, again, was a combination of pre-rendered maps, and plain colours. To create the face itself, however, I used various samples of skin cropped from the photos of my sister. They were overlaid on top of the plain colour, stitched together and painted over with a brush. To finish it off, I used a shadow map overlay. Admittedly, I did not do the best job of it, but luckily it is mostly covered by the goggles anyway.
Hair alphas were painted this time. If a larger texture resolution was available, I would render the strands out either using external software or standard 3ds Max functionality. But in this case it would not matter, since it all blends together in a monotonous mess.
Specular maps were created by copying the diffuse group and layer structure, getting rid of hue, and then tweaking the brightness level of each individual plain colour layer. Overlays were getting care of most lightness variations, however some bits required manual tweaking – face, leather boots and belt, metal bits, etc.

7. Rigging
This is the part I’m not very good at. I think it’s a combination of slightly incorrect joint loops and my inability to weight vertices properly.
This rig uses a standard biped with one additional bone in the head to control the goggle up and down movement. Also, this time I decided to rig all fingers individually instead of making a mitten hand. This was a nightmare, but I think it all turned up well in the end. One of the issues with finger bones is that the rotation axis is not locked as it is with all other bones, so during positioning they always twisted unnaturally.

8. Rendering
The brief specified that use of standalone rendering software like Marmoset Toolbag is allowed. I never used this software before, so I wanted to give it a go. Also, 3ds max doesn’t not process specularity in a way that most game engines do, so the result is a bit disappointing. Real time shaders such as Xoliul have their own issues I’d rather not deal with after spending previous project battling with them.
The first problem with Marmoset is that it does not support material IDs for a solid mesh. Multiple materials can be used in a scene, but they have to be applied to individual chunks of a model that is separated into multiple meshes. Because if that I had to go back and export the .fbx again with head and body as separate objects.
Second issue popped out during tweaking the specular parameters of the materials. Turns out the specular sharpness, intensity and Fresnel don’t work well on the material as a whole. So I had to go back to 3ds Max again, and separate clothing, plastic, metal, leather and skin into their own objects so that the materials could be adjusted for them individually.
A very small issue that was mentioned above was normal map green channel orientation, solved easily by checking a tick box.
A pedestal was modelled very quickly to give the character a ground to stand on.
Finally, I rendered out a series of full-height renders with goggles down and close up of the head with goggles up. Additional renders with no diffuse texture and wireframe were made as well.