Home Technical Talk

Masking methods for grout/tiling texture

polycounter lvl 8
Offline / Send Message
MisterSande polycounter lvl 8
Hey there, back again with a question regarding masking. In my example I have a grout and brick texture intersecting and I would like to have a mask of my grout for texture usage.

I have the meshes in Zbrush and 3DSMax so methods in those software are preferred.

masking.jpg?dl=0

Replies

  • Farfarer
    The easiest way is probably assigning a black material to the bricks and a white one to the grout, then baking out a diffuse map.
  • MisterSande
    Offline / Send Message
    MisterSande polycounter lvl 8
    Farfarer wrote: »
    The easiest way is probably assigning a black material to the bricks and a white one to the grout, then baking out a diffuse map.
    I tried this in RTT and Xnormal but my diffuse map in Max Render to Texture turns up completely black.

    hmm.jpg?dl=0
  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    I don't really know about Max, but in xNormal you can bake out vertex colours for the mask, or in your case if you are loading up 2 high poly models, you can use the "Bake Base Colors" map in xNormal which will randomly assign each different mesh a colour.

    On another note, looking at your high poly, you may run into issues if you are doing an AO bake. They will be subtle, but you will probably have a lighter edge running horizontally and even vertically, because you don't have actual bricks to pad out the raycast for the AO.
    QpWnYhG.png
    If you plan on generating AO from a normal map bake, this won't be an issue, or if baking it might be so subtle that you can live with, but just pointing out the possible issue.
  • MisterSande
    Offline / Send Message
    MisterSande polycounter lvl 8
    - I normally attach all the HP objects together before baking. Is it preferred not to do this ?

    - Im curious why exactly I would run into AO bake issues. Is it due to the steep angle difference between the grout and bricks ? How can I, keeping in mind a texture similar to this one, avoid problems (now, or in the future) ?

    Solid advice on the Xnormal bake btw, thank you m4dcow!
  • MisterSande
    Offline / Send Message
    MisterSande polycounter lvl 8
    Just did some testbakes in Xnormal but the only results I get is a filled colored texture like this green one...

    Tried different settings but no succes yet. hm.jpg?dl=0
  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    Just did some testbakes in Xnormal but the only results I get is a filled colored texture like this green one...

    Tried different settings but no succes yet.

    So xNormal does different colors for each different mesh, so I would suggest exporting the high poly grout plane as one mesh, and the bricks as another. Also use the "Write Object ID If No Texture" option, because xNormal is basically writing a different color for each object id ei: separate mesh.

    Also I did a test to demonstrate what I was trying to explain with the AO bakes here
    d7n11Ie.png
  • MisterSande
    Offline / Send Message
    MisterSande polycounter lvl 8
    soild advice yet again , thanks a bunch!

    @Xnormal, I actually did try what you suggested already but still got the same result. Will get back on this one after I have done some more troubleshooting.
  • MisterSande
    Offline / Send Message
    MisterSande polycounter lvl 8
    Managed to find the issue in Xnormal :) It seems the "edge padding" setting was set to high which caused the brick color to "drown" the grout color. Also, my grout texture consisted of 2 polygroups which actually splitted the mesh in 2 seperate ones. I collapsed them together and reloaded them and voila:


    X_bakes_03_cagetest3_G_C_2_baseTexBaked.jpg?dl=0

    Really thanks a bunch. Nothing helps me grow more faster then constantly solving problems I rather would avoid.
  • MisterSande
    Offline / Send Message
    MisterSande polycounter lvl 8
    So I tried extending the bricks but I am encountering the current problem:

    hmm1.jpg?dl=0



    I realise the edge bricks distances need to be exactly the same but the problem is that these 2 bricks have different dimensions.
  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    The dimensions shouldn't matter, just the amount the mesh is offset.
    U7jeqCQ.png
    In this image the pink lines should all be the same length, because they are drawn from one part of a brick mesh, to the exact same spot on their instanced counterpart. This length should be the width of the plane you are baking the high poly down to (if it isn't, it won't tile)

    So If the plane is 128 units, you move the bricks on the right 128 units to the left, the bricks on the left 128 units to right and the same for top and bottom.
Sign In or Register to comment.