nav2

Showing posts with label uv. Show all posts
Showing posts with label uv. Show all posts

Sunday, May 15, 2016

Some notes on baking Normal maps again

Flipping UV islands is a common way of getting more pixels to cram in detail. What you do is for each symmetrical part of your model, you take the left side and flip it over the right side.

 That doesnt mean that the entire left side should be the same as the right - if you do that your model will of course be a bit bland. So plan in advance which parts you want to have symmetric and which not. You should plan it right from when you start making your high poly model.
In my case, I sculpted the nude in Zbrush completely from scratch, but used marvelous designer to create his outfit:

Making the hoodie was a  gotcha moment.I had to first stitch it in neutral pose over his head and run the simulation to get it to wrap around it naturally, then I puled it down to fall over his jacket during another cloth simulation. He looked good with a hoodie on, but the final design was planned  with a hat on instead.
Marvelous provided some really nice realistic cloth simulation which resulted in a good starting point for wrinkles and detail. Bringing the clothing back to Zbrush - I added detail to it - more wrinkles and a zipper here and there, the shoes and shoe laces. The hat, the hands and the respirator mask are all made in blender - where modelling them made much more sense. For the mask I used modifiers heavily. Wireframe modifier was perfect  for the cage.

Naturally the generated cloth mesh had no symmetry. So then when I started doing retopology in blender - the plan started forming more. For the outfit I will keep the middle part asymmetric, but will reuse the texture space of the sleeves. Same goes for the pants. His face will be completely unwrapped, but I will reuse uv texture space of the neck, the the cap shade and the shoes.


So I did the model accordingly in two stages- first retopo the asymmetric bits, then do the ones that reuse texture space - with a mirror modifier. I had to cut the hi poly model import from zbrush and marvelous designer into body parts and make the planned ones symmetrized for the high poly mesh - where there was no symmetry for the clothing. Thankfully blender has wonderful sculpting and modelling tools that make that part a walk in the park.

 When baking a normal for a target model with flipped islands that overlap their counterparts, you are most probably going to get seams.
If you want to avoid it, but still be able to reuse texture space via flipped uv islands, it is important to do this: Select all islands that overlap other islands, and move them in X + texture.width.


As a side note you need to consider that this UV technique does not work if you need to bake a lightmap on the model - which is usually the case for static background objects.

For the mask normal baking, I arranged the uv islands in a way that it will bake the bars perfectly horizontally and vertically. It is generally a good practice to arrange your islands in a way where you will get less diagonal lines on the bake - try to avoid diagonal straight lines as a whole. Horizontal and Vertical lines have  no anti-aliasing you see - so geometric detail such as this looks much crisper on lower texture sizes. If you look at model rips from old video games - you will see that they utilized this approach quite successfully to get some good looking textures as small as 256 or even less. I was also being cheap again with reusing UV space  with a vertical mirror. Whenever you can, and especially for detailed parts with repeating elements - try to reuse texture space!

In most cases, you will still need to clean up the bake result.
The normal cleanup was done in Krita, as 3D-Coat does not allow cleaning up external normal maps. Their import layer is locked and limited to very few operations.
 It was however quite good at further detailing them during texturing with your PBR materials. Next post will be about that =)

Monday, May 5, 2014

Normal maps - Round two (3d Coat)- Dragon



I thought that my portfolio needs more detailed, game friendly 3d models. For that reason it was needed to tackle the subject of normal map baking yet again. I have done so in the past and looking at it retrospectively, that post didn't really reveal in a concise way the things that affect how a normal map bakes. So here goes my dragon experiment.

First off I used Blender to sculpt the dragon and push dyntopo to the test. I wanted to push it to it's limits on my dual core, 4gb ram laptop.
593 108 triangles seems to be the limit dyntopo can get to before becoming completely unusable. Now some of you might think - oh but  you can use lights instead of matcaps, you can disable double sided faces, switch off outline selected, turn on vbos, you can do this or that to speed up the viewport. I know about those tricks - they do help the viewport. It is not the viewport, it is dyntopo. The moment you turn on dynamic topology at that polycount , the screen freezes and lags extremely on every brush stroke.Optimize doesn't seem to do anything either. A trick would be to split the model to parts, but I didnt wanna do that. So at that point I just decided to continue working on this in 3d coat. It would be a fine opportunity to practice more in 3d coat.

I gave the model more detail there and played with the voxel room's tools. The rest of the pipeline I did in 3d coat. So what are the things that affect a normal map bake:


0. Topology - the retopology stage can be really important as to how your bake ends up looking like.
One must strive to have good edge flow not only for animation, but also for a better normal map- an optimal number of polygons to cover the high density mesh in a way that would best preserve it's silhouette. After all the silhouette will be the thing that would give away the fact that it's just a low poly model with a normal.

It is also good to note that weird edge flow used to reduce the polycount can cause problems further down the line. N-gons should be avoided. Triangles shouldn't be used at areas that will deform. Non-planar faces can be problematic too- some turn all polygons to triangles for that reason.

There are a lot of elements that can amount to a better normal map bake if you know about them. Since it's a big subject and I am certainly not an expert yet, you could try checking out Hai Phan's excellent video course on sculpting and baking.


1. UV unwrapping - is the next step of the pipeline that is key to the resolution of your normal map.
In previous posts here I have noted that one way to efficiently use UV space is to have folded and overlapping islands (left over right half). Since overlapping them could cause problems, another approach to have them reuse pixel space is to simply shift them in X or Y by exactly the size of your texture space. That way if you set your texture to "tiling" the outside of uv space islands will still get the detail. Other obvious points to rehash:
- Every uv seam is taxing a bit more the real time renderer. So a good rule of thumb would be to have less uv islands if you can. In example above I was just pressured by time to unwrap it faster. It's always easier to just have many islands.
- Try to pack the islands in a way that they use as much pixel space as possible.
- Try not to have any weird uv island overlap/twist upon itself. Example above has one island that way on purpose to test the possible issues that could arise during bake.
- Try to hide uv seams in areas where they are not likely to be seen from the common camera angles/character poses. Crevices are also a good spot to place them.

2. Baking (cages) - That is another thing Blender users can't enjoy at the moment I am writing this. 3d coat gives you the ability to easily set a baking cage. An inner and outer shells that would determine the range of the high density model. It's a nice way to reduce potential normal map garbage for cleaning up later on. But I found that it is still not enough to give a completely perfect bake on a complex model such as the dragon. So I still had to do some cleaning up.

3. Dealing with holes and garbage in the normal map (clone tool)

At this point after getting my bake out, it is important to compare the low poly mesh with the normal to the high density mesh. Comparing the two reveals minor issues scattered all over the normal.

The easiest way I found to clean up those issues is by using the smudge, blur and clone brushes. These tools are well known to photoshop users, but can also be found in both 3d coat and blender.Finally I used a new bump layer in 3d coat to touch up the normal map- increase some crevices, smooth out some other areas. And another bump layer to add more fine detail such as scales/etc. And here is all that combined with a quick texture: 
In this post I do sort of compare 3d coat to blender. The truth is that both are excellent apps for 3d sculpting. Blender is still catching up on that front though. Some of it's current disadvantages are being worked on. If you want to support that development, consider donating to the blender foundation or joining the Blender Cloud!..


.

Tuesday, February 19, 2013

d4i- Low poly stuff and using vectors to texture again

There is really no point in doing sculpting and retopology when the characters are really really low poly.

There is quite a lot I could get away with topology-wise, given that the shader is  to be shadeless and wouldnt have any normal maps - the only thing that has to work is the silhouette and the deformations.
The game engine triangulates the mesh, so I am allowed to use as many tris as I want to.
in order to preserve verts.
Instead of making uniform meshes, I would split a mesh into shells - to save on faces.

It took a few hours to get them from scratch to UV unwrapped stage. A nice thing about the mirror modifier in Blender is that it folds all symetric UV islands that its mirroring automatically when you apply it - one half over the other whilst putting the left side islands on top of their right side counterparts. This is not good if your model will use normal maps (as noted in a previous post in this blog), but its incredibly useful when you want to save UV space for obvious reasons. If you unwrap(again) after applying the mirror modifier, blender unfolds them in completely symetrical islands that are normal map friendlier. It's still very easy to later flip one half over the other if need be.

The shells are all uniform and no stretching for as long as you mark the seams right. Doing this is Maya is a hassle (without $$plugins??). Autodesk, please be more competitive and improve your uv unwrapper. :P

For the UV seams, I like placing those where I know a different colour/material of the character will begin. For example the snail's shell and skin would be on sepparate islands. This makes texturing easier later. I like cutting seams on the side of the character where I know the camera won't be looking.

Priority was given to UV islands that are going to have transparent sprites (bee wings, hedgehog spikes).
Islands that are on areas nobody will ever see (the mouth interior of the hedgehog or the bottom of the snail) I scaled down as much as possible - gave them very little uv space.
On top of that I used the snapping options to overlap identical uv islands (the bee's knees, legs,etc).

Next step , I exported the UV layouts and got them in inkscape, to be vectorised.

This splits the island shapes that were bleeding into each other. From there its a matter of Path>difference. 

This then gave me a nice and easy base colour for each island (picked it straight from the concept art).

Using vectors allows me to export it to any resolution, while having it small. Just as I did with the concept art, I decided to keep all of the enemy textures in one file, so it's easy to track if they are consistent in style, polish and execution. I used masking, clipping and other tools. New feature in inkscape 4.9 called "select same" allows you to select all objects with same fill colour, line colour, style, etc automagically. Useful when used with "union" to merge shapes, saves loads of time when colouring.

The three models can share the same material and therefore UV space. In total they are 685 faces (as you can see in the pic). I might have to add a few extra edgeloops on the snail's neck, might take out some geometry...


Sunday, March 7, 2010

Mammoth mesh

Yesterday I created a mesh for the second character of my upcomming animation short for Bradford University. The mammoth is a low-poly mesh that consists of 820 quads, 4 textures and uv maps. I did the whole thing from scratch in 5 hours, using mainly Maya, but also Z-brush for the UV mapping and Photoshop for the texturing and transparency maps.



You can see a better quality render at my flickr gallery, which is previewed in a small window on the left side of this blog.

I found out how to embed 3d in flash content, so from now on, I will be able to post actual 3d viewers instead of static pictures :P

Monday, March 1, 2010

UV mapping and texturing of cave guy

Today I cleaned up the topology and finished the UV mapping and texturing work of cave guy. I used Z-brush to do the UV and Z-brush and photoshop to create and edit it's texture. There are no seams visible. I might have over saturated the skin tone. There'll be a couple of test renders later.



name of mesh: Cave dude
number of polygons: 3559
texture size: 1024x1024
Time taken: 3 days- one to sculpt,one to retopologise, and one to uv and texture...


Another thing I did was softening the Normals of the whole mesh and then hardening them on some of the edge loops.


It might not be a very good idea to uv it before it's boned, skinned and tested, but I just had to do it today.This was something I wanted to learn from ages. Now that I know how it's done, I think I will enjoy texturing organic stuff in the future.
I have to say though, I am relying too much on my tablet. If I didn't have a wacom tablet, this would have been very hard to achieve in 3 days.