ZBrushCentral

Baking matcaps the easy way

I love Zbursh’s matcaps but trying to bake them into a uv map for use in other applications or games can be quite a tricky thing. I’ve tried using the old ZApplink technique of sending different views back and forth to bake the shader info down into poly paint but to be honest I’ve always found this to be more work than its worth.
However I stumbled across a rather quick solution a few weeks ago whilst using the UV master plug in.

Ive not seen anyone else using this method so I thought id share it with you guys.
[attach=230765]matcap_bake.jpg[/attach]
I hope this proves useful for some of you.

Attachments

matcap_bake.jpg

SUPEr cool, have been missing this for aaa longtime thanks for the tip :+1: :+1: :+1: :+1: :+1: :+1:

Hey thanks, I will try it :+1: :+1:

Yes, thank you.
I already tried the same. But matcaps dont work the same on flattened meshes.
There’s a much better way to export matcaps to an external renderer and bake textures there.
see this from my thread, this is rendered in blender using the default copper like matcap.
http://www.zbrushcentral.com/showpost.php?p=702508&postcount=77

Just grab the matcap, export it. Then use it as texture (in blender in my case). Use the “normals projection” method for mapping!. Thats all. I can also bake it in blender and export a perfect map in zb for more painting if I like.
Picture 2.jpg

This is similar to original post just no ZAPP link or 2d tool. Once set up just change matcap and render

-Set the document size to 2048 x 2048 (if this is your UV size),

-Draw in tool.

-Clone tool and delete all high subdivisions leaving only the lowest (the one you made the unwrap with)

-‘flatten’ in UV master, turn on (‘Disp on’) displacement map (If flatten doesnt work, ‘Copy UV’ from original cloned tool)

-Press ‘F’ on keyboard to frame the tool to the document (This fits it to the screen so its the same as your UV map)

If you need a flipped map use ‘Deformation’ and ‘mirror’ on Y and x axis(this will flip the tool if using it for 3ds max

-now choose any matcap (center the single light if using standard materials)

-Select ‘Create maps’ under render-BPR menu

-Press ‘BPR’ with everything off (shadows, AO, etc)
This will render it to the document size and antialiasing applied for good quality.

  • Click on ‘Img’ under ‘Create maps’ to save your new map.

The good thing here is you just change matcap and BPR render it again and again, very quickly once its set up. You can even use the nomalRGBMat material and use it as a Normal map which is handy because you can adjust the height by adjusting the displacement map height.

It helps to create a border of above 4 on your UV to avoid seams.

I hope this is handy for some one.

michalis and HD CG ADDICT
I think the above metheds are great aswell this is just my 2 cents. Thanks I always had this in the back of my head, I just couldnt seem to understand it until now.

HD CG ADDICT, soulty666, these are great and useful methods with lot of possibilities. It depends on what we’re after. “My” method is simpler for exporting and rendering a matcap and maybe the “right” way. One disadvantage though. Cavity color can’t be exported like this, I have to either bake and export a cavity mask-map to use it as second tex of material or paint cavity in blender (just a click but with different look this time)

michalis, i like this new way to utilize uv master, will be trying it out.

I just wanted to add an old but unique method I have not seen posted.

When you capture a material, it is possible to use the “flat Color” material.
Doing so will create a texture (in the texture palette) of the “hi” and “lo” values of the material you are capturing from image.

This method is more useful, not so much to capture perfect matcap materials but rather to capture the lighting information which define the material.

It works well as an ambient multiplier in maya shaders.

Also I think “flattening” the material along with using the displacement is tried and true and allows you to have more even lighting.

cheers

OK, all these are interesting. As this one star rating is. Someone, once again, thinks that we’re stupid , or even better, he is, as he doesn’t talk too much. Lets stop this rating system, so annoying. How can you rate without talking, being anonymous? The nazi’s way?

@: Skaale & Bas Mazur

Im glad you’ve found it useful

@;michalis

Thanks for sharing another strategy. I’ve also used the method you suggested and it is a great way to make an accurate replication of a matcap, blenders full render bake option does give you a lot of flexibility. However I do find it a bit slower especially when you want to combine multiple materials.

@:soulty666

Your idea is actually the way I first started to bake matcaps using UV master but I had problems getting the document to match up exactly with the UV layout. I’m guessing its because I did not frame the flattened tool properly as you suggested. Ill have to test it again for my self; but if it does line up perfectly your method could possibly be made into a easy to use macro or Zscript. Since every thing needed would be native to ZBrush a well made Zscript might be able to offer a 1 button solution to baking matcaps inside of Zbrush.

I don’t understand Michalis’s method. How would you align the texture? A walkthrough would be very much appreciated if this is the easiest method.:smiley:

Thank you

  • I found the easiest way is to just uv map a flat square plane and set your displacement on this.
    This way you can ‘f ’ (fit to screen) and mirror ’ y’ if using max (needs to be flipped)

  • set your Doc size to 2048 x 2048 and use BPR render on any matcap or standard material.
    This way the plane aligns to the document instead of the edge of the flattened uv fitting to the screen. I found my above method is slightly off because the outer edges had nothing to stop them hitting the edge of the document.

-Make sure your uv plane is one big square (this was the default uv layout from uv master when you just hit unwrap).

Hope this helps. Ill try post some examples of how I used it.

This video might help shed some light on the topic. Its old but parts are relevant.

http://www.pixologic.com/zclassroom/homeroom/tutorial.php?lesson=joseph

another one
http://sebleg.free.fr/tutorials/zbaking.html

I’ve been using Joseph Dursts method for a while. I was hoping for an explanation on Michalis’s method since he’s correct about the matcaps lighting behaving differently when they are flattened.

rissta-Thats a good point. When its flat the lighting is different.

@Rissta

Im not 100% if this is the way Michalis method works so please forgive me if I’m wrong. But from his description it sounds like a sphere projection method.
You basically take a sphere inside Zbrush with the desired matcap applied to it. Drop it to the canvas and export the document as a psd file. Crop the image so that the edges of the sphere match up to the edges of the image. After this you simply apply the texture map to an object in your 3d application, setting the mapping coordinates to Normal.
normal_matcap_map.jpg

This is a good way to recreate simple matcaps in other applications and can of course be baked into a texture map, by using blenders full render settings or similar baking options in other apps.
There is a bit of a down side to this however, with some matcaps its almost impossible to recreate an accurate representation of the original zbrush matcap with out a lot of tweaking of other material settings with in the external application.

As much as I like to look at other people’s work these kind of threads are the ones that I truly love… thanks guys.

This explains how to use HD CG ADDICTs method for 3ds max.
follow the video through to see how to render and use in view port. Only down side I can see to this is just like the matcaps the lighting is baked into them. the up side is no seams and the baked lighting is all the same direction.
Zbrush Material (MatCap) to 3ds max (Viewport & Rendering)
http://www.youtube.com/watch?v=LayKICsYD7o

matballs.fx download
http://www.polycount.com/forum/showthread.php?t=68125

Quick screen grab of the standard reflected map material from zbrush.

[attach=231504]matcap-to-material-render-3d-max.jpg[/attach]

These are some renders from 3ds max of zbrush matcaps.

composite.jpg

Attachments

matcap-to-material-render-3d-max.jpg

soulty, i have a question
how did you use the composite material like that?
did you use the ‘render to texture’ for each directx material,
then used each texture to render in mental ray?

the video shows how to make the directx shader.
1.
-I drag that material into the first slot on the composite material.

-Drag the first slot to the second slot(every time making a copy not an instance).

-click into the second slot(directx shader) load a new sphere(matcap) and rename it.

  • I used this so way so I could just use 10 matcaps and change or composite(a=add, s=subtract, m=multiply) them by clicking the check boxes on/off.

I didnt use render to texture. (The comment at the bottom is only a suggestion not what I did.) I just decimated and opened up the obj and used the directx shader. then used that in the ‘composite material’ as explained above.

Make sure you download the matballs.fx to use with the tutorial and directx shader. It doesnt mention it in the tutorial but its loaded into the directx shader to allow the matcap image to be loaded.

@soulty666
the directx method of max is similar to the ‘normal’ method of blender? It looks like.

@HD CG ADDICT

There is a bit of a down side to this however, with some matcaps its almost impossible to recreate an accurate representation of the original zbrush matcap with out a lot of tweaking of other material settings with in the external application.

Yes, cavity is a problem when different color is used. But blender supports cavity painting also, or just export the UV cavity mask from zbrush and use it as masking texture. Easy to do it in tex editor of blender but even better with the use of nodes system.

A bit of downside to the zbrush baking method too. Having cavity and spec effects everywhere.

In the past, I used this ‘zb-flatten’ method to have some decent bump maps for renders that don’t support normal or displacement maps (archi vis using SketchUp). Combination of Cavity and AO maps can be used now.
Tricks for apps that aren’t very popular in this forum :lol: And this is good.