Home Technical Talk

How Could I Keep Texture Scale But Still Be Able To Add Edge Wear

polycounter lvl 8
Offline / Send Message
MrDoxies polycounter lvl 8

I should note that I'm modeling in Blender, texturing in Substance, and the final product is in UE4.

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Hello. Using support loops, or face weighted normals would allow you to do easy and simple edge detection. Alternatively, you could just mark the edges with vertex colors, and use some noise texture in the material together with the vertex colors to apply edge wear. I made some experiments with these earlier, they all worked fine. You can check the results and the material function out in my thread (towards the bottom of the first page, and on the second page).
    http://polycount.com/discussion/157279/the-wonders-of-technical-art-unreal-engine/p1

    There is a third way too, but that would involve an additional texture using a second uv channel with the unique unwrap, and you could just bake out a curvature map from substance.
  • .Wiki
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Oh, completely forgot about that article. Thats great too, thanks for the reminder.
  • MrDoxies
    Options
    Offline / Send Message
    MrDoxies polycounter lvl 8
    Obscura said:

    There is a third way too, but that would involve an additional texture using a second uv channel with the unique unwrap, and you could just bake out a curvature map from substance.

    The secondary UV channel was exactly what I was looking for thank you very much!

    I will look into the other ways mentioned by you and .Wiki, but this way was exactly what I was looking for.
  • Eric Chadwick
    Options
    Offline / Send Message
    Tiled higher-frequency edge wear is the way to go. 2nd UV is rather wasteful, it needs yet another texture in memory, and it increases the vertex count a lot (which isn't as much of a problem these days, but still relevant). I recommend vertex color masking.
    http://wiki.polycount.com/wiki/MultiTexture
  • MrDoxies
    Options
    Offline / Send Message
    MrDoxies polycounter lvl 8
    Tiled higher-frequency edge wear is the way to go. I recommend vertex color masking.
    http://wiki.polycount.com/wiki/MultiTexture
    I'll definitely look into vertex color masks. My only concern is I really like the control I get over the look of the edge wear using multi UV. I understand it is probably wasteful in the long run, I just didn't want to lose texel density on the rest of the wall just for scratches on corners.

    I'll report my progress, thank you very much!
  • MrDoxies
    Options
    Offline / Send Message
    MrDoxies polycounter lvl 8
    Okay so what I'm finding is vertex painting would require me to add more verts to get more control over the painting, but I'd like to avoid adding more polygons than need be just for the edge wear.

    Splitting up the model into smaller parts so I could keep each whole model within the UV bounds would just add a bunch of unneeded draw calls.

    Thinking about it now I would need a separate material instance for each of the wall segments unless I made them one large mesh with the base material tiled across it at 2048x2048, then the edge wear on a separate UV but I can see that making the edge wear a much much lower resolution than the base wall. Not to mention the lightmap resolution that would be needed to make a mesh like that bake well.

    I usually work with modular components but wanted to try just feeling it out on wall lengths and such to get a less 'modular' feeling, but I feel like I really shot myself in the foot trying for the little details lol

    Just not really sure how to balance efficiency with visual quality I guess.


  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Back to Eric's comment and by looking at your material setup, I would like to mention that your texture usage is already very wasteful (most of the people does this unfortunately) because you don't pack the grayscales into rgb channels. You could put all of the grayscales into the channels of a single texture so memory usage is 1/3 or around that depending on the amount of them, and I guess you don't use shared samplers either. So overall its many times more expensive than it could be.
  • Eric Chadwick
    Options
    Offline / Send Message
    Is this for a portfolio piece? Or for an actual game? If it's just for your portfolio, don't worry about perf, just make it look awesome. All the performance optimization stuff can come later.
  • MrDoxies
    Options
    Offline / Send Message
    MrDoxies polycounter lvl 8
    Obscura said:
    Back to Eric's comment and by looking at your material setup, I would like to mention that your texture usage is already very wasteful (most of the people does this unfortunately) because you don't pack the grayscales into rgb channels.
    Yeah that's fair, Though I am aware of the packing grayscales, and that is generally how I work when I use painter or photoshop to make textures. This material is the default one imported by the substance instance factory for designer. I'm just hopping into it to add the overlay the edge wear on it. I'm not sure if substance would work properly if I mess with the texture maps to much. Probably worth looking into

    Is this for a portfolio piece? Or for an actual game? If it's just for your portfolio, don't worry about perf, just make it look awesome. All the performance optimization stuff can come later.
    It is more so a portfolio piece, it started as a study at how PT did their scale and textures, but it turned more into a practice of maintaining texel density across the scene. though I did make it playable. I might add some really basic gameplay just for fun, have things move around the scene when you aren't looking to freak out my friends who try it but that's as far as I'd go lol. That being said I would still like to learn the proper way to go about these things going forward into making playable things, so I guess I just wanted to see what my options were.

    Seems like vertex painting, floating transparent planes, and overlaying a second UV are the only ways to go about it. At least to get what I do in painter over to the engine, in engine procedural looks good but I like my paint brushes lol

    I'll keep chipping away at it and see where I end up with it and post some results. Thank you for all the help so far.


  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    MrDoxies said:
    Okay so what I'm finding is vertex painting would require me to add more verts to get more control over the painting, but I'd like to avoid adding more polygons than need be just for the edge wear.

    Splitting up the model into smaller parts so I could keep each whole model within the UV bounds would just add a bunch of unneeded draw calls.

    Thinking about it now I would need a separate material instance for each of the wall segments unless I made them one large mesh with the base material tiled across it at 2048x2048, then the edge wear on a separate UV but I can see that making the edge wear a much much lower resolution than the base wall. Not to mention the lightmap resolution that would be needed to make a mesh like that bake well.
    So you write off adding more verts to get better vertex painting, but seem down with having a whole other UV set, which will at the least double your vertex count and worse increase your shader complexity since you likely have to calculate tangents on the extra UV channel to get normal maps to work properly.

    Are you doing a proper height blended vertex color shader because with a small bit of geometry they can get quite detailed (use very low brush settings in Unreal).

    If your edge damage is relatively aggressive as in not really a smooth gradual blend try the fallout 3 style edges mentioned above, look into UE4's mesh decals to achieve this
    https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/HowTo/MeshDecals
    There is even an example scene.
    With this method you could have many different strips of edge wear and damage on a sheet and place them wherever you like. It would add draw call how many depends on how you group them though.


  • MrDoxies
    Options
    Offline / Send Message
    MrDoxies polycounter lvl 8
    m4dcow said:
    So you write off adding more verts to get better vertex painting, but seem down with having a whole other UV set, which will at the least double your vertex count and worse increase your shader complexity since you likely have to calculate tangents on the extra UV channel to get normal maps to work properly.
    I'm sorry I hope I wasn't coming off as ungrateful for the advice. I wasn't aware of exactly what the performance cost difference would be.
    I just saw a method that let me paint directly on the mesh and ran with it.

    m4dcow said:
    If your edge damage is relatively aggressive as in not really a smooth gradual blend try the fallout 3 style edges mentioned above, look into UE4's mesh decals to achieve this
    https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/HowTo/MeshDecals
    There is even an example scene.
    With this method you could have many different strips of edge wear and damage on a sheet and place them wherever you like. It would add draw call how many depends on how you group them though.

    I gave this method a shot, I went a little overboard just to make sure it stood out so I could see what was happening. I think this method could work very well and I will probably use it for the final product.

    Would it be better to merge the two meshes together. The floating decal geometry and the base wall mesh, and use two material ID's instead? I would imagine that would cut down 1 draw call.


  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    If you're using baked lighting you can repurpose the lightmap UVs for the edge detail  -  they're already unique and you're not paying any extra for it. 

    if not I'd advise vertex painting modulated with some masks.  



  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    MrDoxies said:
    I'm sorry I hope I wasn't coming off as ungrateful for the advice. I wasn't aware of exactly what the performance cost difference would be.
    I just saw a method that let me paint directly on the mesh and ran with it.

    I gave this method a shot, I went a little overboard just to make sure it stood out so I could see what was happening. I think this method could work very well and I will probably use it for the final product.

    Would it be better to merge the two meshes together. The floating decal geometry and the base wall mesh, and use two material ID's instead? I would imagine that would cut down 1 draw call.

    No worries man, the decision making just seemed odd to me.

    Whether you merge the meshes together depends on your setup, but it since there will be 2 material IDs you will get at least 2 draw calls anyway. What you don't want is a bunch of different meshes for each piece of decal geometry.

    Also keep in mind you can use the vertex painting method in conjunction with this to get some variety other subtle variety like dirt or stains into the scene too.
  • MrDoxies
    Options
    Offline / Send Message
    MrDoxies polycounter lvl 8
    m4dcow said:
    Whether you merge the meshes together depends on your setup, but it since there will be 2 material IDs you will get at least 2 draw calls anyway. What you don't want is a bunch of different meshes for each piece of decal geometry.

    Also keep in mind you can use the vertex painting method in conjunction with this to get some variety other subtle variety like dirt or stains into the scene too.

    These are the two meshes, and I set my material up pretty much the same as the tutorial on the UE4 wiki, however I have the roughness and opacity maps packed into one texture on different channels.


    Ignore the multiply on the diffuse, that was just to darken it a bit further to see what I was doing. I'm going to convert this to a master material and use instances of it with plug in parameters for the texture samples.

    Thanks again for all the help, lots of methods to look into, but I think I found the one for this project. I'll post the final scene when ever it's finished.


Sign In or Register to comment.