Friday, 27 September 2013

Normal Mapping the Time Device + basic Normal Mapping tips

Normal mapping in Blender always seemed such an awkward thing to accomplish. After reading into "mesh exploding" something finally clicked! If you want to know more about normal mapping I made a mini tutorial at the end of this article.

Now about the Time Device prop. I started modelling using the subdivision method as described in the scientist character modelling overview. This allowed me to make it look as nice as possible and not worry about re-topologising it later.
Image showing the high poly mesh before exploding

Image showing the mesh after optimisation

Once a Low poly mesh was produced, I removed the parts that can be duplicated and unwrapped it as efficiently as possible.

Next, and this is important, I made a copy of the low poly mesh and moved it far away from the original meshes. I then "exploded" both the high poly and original low poly meshes as described on some other sites. This essentially consists of taking all the parts that can be separated (anything that's a separate mesh, or can be made separate) and moving them far from their original positions.

Note: This is done for both high poly and low poly meshes making sure each corresponding high poly and low poly parts overlap.

Image showing how the high poly mesh was exploded. The low poly mesh was then matched as closely as possible.

Image shows how the high poly and low poly meshes are overlapped ready for baking

This may seem crazy but remember that mesh copy I made? The non-exploded and exploded versions share the same UVs. This means that a normal map baked on the exploded version, will work on the non-exploded version and be glitch free! The original low poly mesh is left untouched and baked map can be applied to it!

Image showing how the baked normal map on the exploded mesh applies fine on the non exploded mesh

Exploding the mesh reduces the interference between all the components and seems to produce much cleaner results.

Hope someone found this informative. Read on for more normal map related stuff!

Mini tutorial - Normal mapping Distance and Bias settings

This is something I only recently understood.

Lets make a normal map for this object (the picture shows the low poly and the high poly models):
Image shows the high poly model that will be projected into a normal map

I have identified the parts which will cause issues with the baking. In this case it happens to be the corners because the low poly deviates a lot from the high poly. 

The distance value represents an imaginary "cage" around every mesh comprising your model (or Object). This cage is both on the outside of the mesh and on the inside. The Distance value can only be made positive. Nevertheless the cage extends the same distance in the oposite direction. This ensure that no matter if the high poly extends outside or inside the low poly, the cage will still pick it up. The Bias is another imaginary cage, around your meshes, inside the first cage. The values are in Blender units (Bu).

So for each separate mesh in your model (within the same Object), you will get a separate cage with the same settings. You may need to explode your model as I explained above if this causes problems.

Anything outside the Distance (or cage) will not be baked. So when you get some solid colour artefacts in your bakes, this happens because the high poly mesh has polygons that extend beyond that distance. They intersect with the cage. You simply need to increase the Distance value until the cage is large enough that no intersections occur.

Distance, in Blender units required for the bake to work

You can see that in order to resolve the detail of the high poly mesh, we need to set the distance parameter to be as close to the maximum distance between the high poly and low poly mesh. In this case, the maximum distance between the low and high poly models occurs at the corners and is around 0.1 Bu. So that's the minimum Distance value I can use for this low poly mesh.

The Bias value functions in a similar way. Anything inside the Bias cage will be projected onto the mesh to which that cage belongs to. Anything that extends beyond the Bias will not be baked.

 The first picture has a Bias of 0 and even though the cube is still within the Distance, it doesn't get baked to the normal map. This shows why the method above works .

The second picture shows that with some tweaked values you can project the cube onto the map. It also shows the Distance and Bias cages and clarifies what the Bias value does (please ignore the fact that I forgot an edge loop resulting in the corner of the main mesh being a little screwed up).

By making the Bias 0, the cube was totally ignored. Setting the Bias to the correct value (the distance from the surface of the main mesh, to a point beyond the cube) allowed the cube to be projected on the surface.

Note: in order for this to work, you need to increase the Distance value so as to include the cube within the Distance cage (see the previous picture).

In most cases the Bias value is not needed unless you want to project some objects onto your model e.g. you could project some screw holes, rivets, shirt buttons or anything that stands out from the surface of the mesh onto the normal map without needing extra geometry on the low poly mesh. This is good for many situations where you want to add small details without increasing poly count.

In conclusion here are some basic settings to keep in mind.

Single mesh where low poly matches high poly very closely:
Distance = 0.2
Bias = 0

Multiple meshes (say, box with complex surface plus screw holes around 0.1 Bu away from the main mesh)
distance = 0.2
Bias = 0.15

Note: these values will need to be tweaked because every model has a different scale etc.

I hope this was useful to some people! 

Tuesday, 24 September 2013

The Time Device

Today I did some texturing of a game prop. I made the high poly model and from that produced a low poly model. A normal map was then made from the high poly model.

I will detail how I did the normal mapping in another post, but I've found Blender to require a little bit of hacking to get going, but once you get the idea its pretty simple and relatively fast.

Anyway here's some screenshots.

Monday, 23 September 2013

Unwrapping woes

Quick tip for people who happen to hit the same problems I did with UV unwrapping.
This is what I used to do:
Don't do this

When you have a cylindrical object with a continuous perfectly vertical side, select the top and bottom edge loops of the perfectly vertical side (this is important) and make a seam. Make sure you make your seams are on polygons that are facing the same way. e.g. If you have a bevelled edge, select the edge loop at the end of the bevel when the next polygon is exactly (or as close as it gets to) vertical.

Next make a vertical seam, but only between those two seams you created earlier and not between other seams where the geometry is not perfectly vertical or you will end up with bent strips of UVs (see above). This ensures the middle strip is  opened and flattened out evenly and remains straight while the top and bottom parts are flattened into circles/rings (see below).
Do this!

I found this produced a much cleaner looking UV map with little extra clean up work.

One disadvantage I can see is that you end up with thin rings of UVs which may end up wasting texture space. However this can be easily countered by nesting other parts within the rings.

Sorry if this seems trivial. I'm sure most of you already know this but while modelling a prop it suddenly hit me and I realised I maybe someone else might have been in the same situation. I hope someone found it helpful.

Anyway, 'till next time.

Sunday, 22 September 2013

Scientist character

My friend and I are working on a game. There's not much I can say right now but I've been working some things for the past few weeks.
Today I'm showing you progress on the main scientist character.

I haven't done much humanoid character modelling. I haven't done much normal map generation. 

So that's what I've been doing lately!

To start with I made a high resolution mesh. I dont usually go with a specific modelling style but in this case, after seeing this lovely tutorial by CGtuts, I decided that subdivision modelling was pretty useful!

By starting with a low poly mesh and applying a subdivision modifier you can produce high poly meshes with the peace of mind that when it comes to producing the low poly mesh, all the vertices will stick closely to the underlying high resolution mesh, allowing you to focus on simply removing edge loops rather than trying to mess around with traditional retopologising methods.

Of course when it comes to animation, you will need to make sure you have adequate geometry for deformation, but that's not too complicated once you have a low poly mesh which you know is a good proxy for the high resolution one.

The benefit of the subdivision process is that you can use the edge loop selection and delete features to effectively reduce the geometry to something a game engine can handle, while the overall volume matches the original mesh closely. The down side is it may take a while to reduce the geometry back from one or two levels of subdivisions however the benefits are great.

The final reduced mesh can then be modified to improve deformation etc.

Final polygon count is around 12k triangles.

The next stage involves rigging as I want to make sure the geometry will deform and take on the normal map correctly.
Using the riggify tool in Blender made it very easy rig this thing. The only annoyance is the weight painting itself where it can sometimes be quite hard to get the correct deformation in all poses.

Ready to kick some alien butt!
This is the result after the rigging process!

Notice the bulging on the coat. This is due to the rig acting weird!
For those interested, here are some wires:
Face wireframe

I hope to show some texturing soon.
Until next time.

Saturday, 21 September 2013

Risen from the ashes

This is a new start for my blog. I will be documenting my personal projects in 3D modelling, animation and game design.
For my first post I would like to show you some of my recent work.

Lester (as in Red Leicester, you know because rats like cheese.. I'll let myself out..)
The character was designed as a courier for the game DOTA2. It was uploaded on the steam workshop.

My initial sketch of the character:

Initial concept of Lester the Rat
Based on the sketch I proceeded to create the mesh. I ended up having to remove a ton of detail such as ropes, potions and equipment which so heavily affected the poly count.
Fortunately, this allowed me to focus and simplify the design and in the end, stripping a lot of superfluous detail was a good thing.

Next the textures were produced. My process was influenced by the documents on texturing released by Valve however I had to make it up as I went along  for a lot of the process because I wanted to experiment with various colours and multiple layers easily.
I first started with a an ambient occlusion pass which was then heavily modified to eventually become a "Value pass". Essentially I put down all the values I wanted on the character to make sure it read as well as possible.

Blender makes this process very easy by providing 3D painting tools. I simply painted in black and white , using a soft low opacity brush, where I wanted light and dark colours to be while every so often zooming out to check how well it reads. Painting directly over the ambient occlusion I produced a gradient where the darkest part was near the legs and the lightest part near the top of the body. This directs the viewers eyes to the interesting parts of the character.

Here's the result of the first part:

The ambient occlusion was painted on top of using black and white to produce a Value pass
Next it was simply a matter of overlaying colours as described by Valve.
This is the result after much painting and tweaking:
This is the final result of texturing
The nice thing about this method is that the value pass gives you a good start for the shading. After that you can collapse layers and painting some more.

The model was then animated as required by the engine. The result can be seen in the following video. Unfortunately I forgot to record the special idle animation, so you'll have to wait until Valve adds it to the game to see it ;)

And here is the final beauty renders of Lester in both ground and flying versions.

Hope you like him!

Lester posed in ground and flying versions