Home Technical Talk

The "ultimate trim" technique from Sunset Overdrive

polycounter lvl 10
Offline / Send Message
dzibarik polycounter lvl 10
I was trying to reproduce a tecnique from Sunset Overdrive which is described in this talk - http://www.gdcvault.com/play/1022324/The-Ultimate-Trim-Texturing-Techniques but ran into some problems.

First, it simply doesn't work for me because I still see seams.  
Here's how it looks now:
http://i.imgur.com/vQewiVy.png

So I was wondering what I'm doing wrong.

1)It could be that my normal map rectangles which came out from NDO arent 45 degrees. The image from the slide 15 looks like it went straight from NDO but I might be wrong
2)I could place my UVs wrong (most likely). They look like that now - http://i.imgur.com/SmP7QLB.png 
It seems that they need to be placed with the exact offset but... I don't know how to put them. May be set some padding between islands? How can I calculate it?
3)Something is wrong with my vertex normals. The edge is soft now and normals are averaged.

So can anyone break down this technique? This would give everybody a huge boost in production as well as improve visual fidelity.

Replies

  • Clark Coots
    Offline / Send Message
    Clark Coots polycounter lvl 13
    I also tried replicating this technique a while back. I color sampled the RGB from the GDC slides because I too was having problems with seams. I hand painted the bevels and the RGB I ended up with were:

    Top: 128, 218, 218
    Right: 214, 124, 189
    Bottom: 130, 36, 218
    Left: 37,128, 217

    In Maya with High Quality viewport rendering I did not get seams: http://imgur.com/HhgbDqY

    I should have test baked an actual 45 degree bevel and see what the numbers were, but I guess I got lazy after the hand painted worked.

    I used hard edges anywhere there was a bevel.

    The UV padding isn't that important. As long as the UV border isn't straddling 2 different normal directions and you have enough padding to account for mipmapping you should be fine.

    So those were my results, if you have Maya I did write a MEL script with the help of a friend and some code from Brian Keffers Ninja UV Script. It auto scales and layout the UVs to have equal texel density. It's still needs a bit of cleanup code but I'd be happy to share if interested.
  • dzibarik
    Offline / Send Message
    dzibarik polycounter lvl 10
    @Clark Coots: thanks for the reply. I'll try doing that when I get home. It's strange that the problem may stem out from color not matching. The square from the presentation looks like it was done in NDO so I guess my color should have matched it. But we'll see. 
  • JedTheKrampus
    Offline / Send Message
    JedTheKrampus polycounter lvl 8
    I made my reference normal map by baking down a beveled cube. Of course for UE4 you'll need to pick from the top side for the bottom normals and the bottom side for the top normals. It works 100% correctly with 90 degree angle hard edges only--otherwise you'll get a slightly wrong result if you use e.g. 70 degree hard edges but it probably won't be too noticeable.



    Here's how that normal map looks in Blender.



    It's a little weird looking but very modular and easy to set up, so I really like this technique. And compared to the bevel/custom normals method, this way gives much less in the way of subpixel triangles.
  • dzibarik
    Offline / Send Message
    dzibarik polycounter lvl 10
    @Jed: I think the seam in your shot is too noticeable like it was in mine. I wonder if it's possible to make it less evident. In the presentation shots it looks perfect so I wonder if bevel we use is too hard or may be shots are taken with more appropriate light conditions which make seam almost not noticeable.
  • Makkon
    Offline / Send Message
    Makkon polycounter
    I don't know if it was already mentioned, but Ndo does not create it's normals at a perfect 45 degrees.

    Also keep in mind that padding is very important. You need to bake/create these sheets so that you have enough room. It can get a little crowded, but it works wonderfully.
    I gave this a shot a few months ago and got some decent results. But I baked my sheets, and you can get decent results from hand painting them too.



    you'll be happy to know that it works spectacularly in UE4

  • m4dcow
    Offline / Send Message
    m4dcow interpolator

    When I first saw these slides, I wondered, about the seams due to padding offset and texture detail along the edges. Also was a bit confused when it shows the part about doing the curved bits that aren't all in line. I wish they would release the actual video to get some insight into this.

    @Makkon how did you deal with edge details on your last image?

    I did some tests myself and once you make sure the edges are at 45 degrees they match up well.

  • Makkon
    Offline / Send Message
    Makkon polycounter
    @m4dcow I wondered about the details at the seam too, but from a medium distance they are not noticeable. Because the surface appears flat on the edge, the seam doesn't really show up. Turns out hard-edges are much more noticeable than a texture seam on a flush surface.
    Otherwise, I just used a 3axis worldspace material projected over everything, seems to unify it. If it's still a problem, you can soften the noisy details at the edges.
  • armagon
    Offline / Send Message
    armagon polycounter lvl 11
    Is it possible to make NDO export 45º angles?
  • armagon
    Offline / Send Message
    armagon polycounter lvl 11
    Hey @Makkon, would you be willing to share that normal tex and the UV's of those models?
  • dzibarik
    Offline / Send Message
    dzibarik polycounter lvl 10
    I think I almost got it -

    The illusion falls apart if we take a look from a different angle -

    It doesn't work without hard edge (so far) and the issue may come out from my messy UVs. I'll continue to experiment.
  • Goobatastic
    Offline / Send Message
    Goobatastic polycounter lvl 8
    How did the experiment go?
  • MisterSande
    Offline / Send Message
    MisterSande polycounter lvl 8
    very interesting technique but a bit confusing. Why wouldn't you just bevel the edges of your objects and use trimsheats ? The additional polygons should not affect performance much ?
  • Mant1k0re
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    very interesting technique but a bit confusing. Why wouldn't you just bevel the edges of your objects and use trimsheats ? The additional polygons should not affect performance much ?
    Wondering the exact same thing.
  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    very interesting technique but a bit confusing. Why wouldn't you just bevel the edges of your objects and use trimsheats ? The additional polygons should not affect performance much ?
    They might, being really long, super thin triangles.
  • huffer
    Offline / Send Message
    huffer interpolator
    very interesting technique but a bit confusing. Why wouldn't you just bevel the edges of your objects and use trimsheats ? The additional polygons should not affect performance much ?
    What do you mean by trimsheets? Beveling the edges (from one segment to two) will introduce shading gradients on planar surfaces, unless you use face-weighted normals (and that will mean more work).
  • radiancef0rge
    Offline / Send Message
    radiancef0rge ngon master
    huffer said:
    What do you mean by trimsheets? Beveling the edges (from one segment to two) will introduce shading gradients on planar surfaces, unless you use face-weighted normals (and that will mean more work).
    Not if you have proper scripts to align vert normals. 
    I kind of agree with beveling edges and using flat textures, more versatile imo. 
  • Mant1k0re
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    m4dcow said:
    They might, being really long, super thin triangles.
    huffer said:
    [...]will introduce shading gradients on planar surfaces
    Would be really cool if you could both elaborate a bit. I sense some interesting information unfortunately beyond my grasp at this point in time :)

    Why is a long and thin triangle expansive?

    And I'm afraid I don't even start to understand the second point.
  • radiancef0rge
    Offline / Send Message
    radiancef0rge ngon master
    long triangles cause issues with the rasterizer, https://simonschreibt.de/gat/renderhell-book3/ check out section 6 
  • Mant1k0re
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    long triangles cause issues with the rasterizer, https://simonschreibt.de/gat/renderhell-book3/ check out section 6 
    That truly was an enlightening read, Radiance. But if I understand correctly it really is an issue if the triangle is really, really long. Which can be the case if you're beveling something like a wall, I guess; in which case the solution would be to simply insert more cuts. I'm really interested in this because 90% of my modeling work are buildings and I use bevels on every other edge.
  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    Mant1k0re said:
    long triangles cause issues with the rasterizer, https://simonschreibt.de/gat/renderhell-book3/ check out section 6 
    That truly was an enlightening read, Radiance. But if I understand correctly it really is an issue if the triangle is really, really long. Which can be the case if you're beveling something like a wall, I guess; in which case the solution would be to simply insert more cuts. I'm really interested in this because 90% of my modeling work are buildings and I use bevels on every other edge.
    I use bevels too, but just put forward a possible reason why they might not be used.

    If you add more cuts then instead of something being 6 tris vs 4 tris, it is now 12 or 24 tris depending on the amount of splits vs 4 tris. Also authoring the actual geometry might take longer with the bevels and having to edit vertex normals.

    I also remember reading somewhere that in Alien Isolation, where they used a lot of bevels and normal editing rather than normal maps, if they made their bevels to small they would have aliasing issues. Not saying this was the case here, but another thing to keep in mind.
  • huffer
    Offline / Send Message
    huffer interpolator
    @Mant1kore  You'll get this soft shading unless you edit the vertex normals:
     
    I think it's best to use both methods as called for. Think of something like a metal or wooden bridge, made of a lot of planks or girders - using bevels on all those edges will add a lot of triangles and it will be more work involved to correct the normals (and they might break when editing later, etc). I'd use bevels on the close-up parts and keep hard edges everywhere else (they'll look pretty good and soft from afar).
  • dzibarik
    Offline / Send Message
    dzibarik polycounter lvl 10
    How did the experiment go?
    Ok, I forgot to update the thread but it went well (a year later, about a month ago, lol). Except I consider this tenchinque to be not relevant in production for me because I don't have tools to manage UV islands efficiently and the project I'm on currently have a bit different pipeline. I just bevel edges when I need it and edit vertex normals with one click in Modo 10 (you can use Farfarer's script on earlier versions). 

    And the secret to techinque was a PERFECT 45 degree angle on a normal map. NDO doesn't produce it (I know some people managed it but I couldn't). I literally made a plane, rotate it at 45 degree angle and built a trim sheet from these planes. Than I made a cage to bake which sits righ atop trim shapes, baked it and that was it.

    I'll try to search for the scene where I did this and upload it. The technique would probably work for me if I had a guy who scripted UV islands automatic aligning to these trim shapes. 
  • Makkon
    Offline / Send Message
    Makkon polycounter
    You can actually hand-paint the 45 degree bevel, it's very viable and works well. This is a good solution for very organic, uneven bevels. It doesn't look so good in VR with thick bevels. If your bevel is mechanical you will probably be better off with regular chamfers and custom normals or extra edgeloops. 

    The extra edgeloops (2 division bevel with no chamfer) is viable because of easy removal. You can delete the edgeloops at any time and make changes easily. Great for LODs.

    Single bevel with custom normals looks good in VR, but it's hard to fix when you need to make changes, and the custom normals workflow can be a slow down.

    I think a combination of these approaches, when keeping in mind the asset's use, complexity, distance to player, and other variables is best. Whatever works, you just have to weigh your options.
  • Mant1k0re
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    Makkon said:
    You can actually hand-paint the 45 degree bevel, it's very viable and works well. This is a good solution for very organic, uneven bevels. It doesn't look so good in VR with thick bevels. If your bevel is mechanical you will probably be better off with regular chamfers and custom normals or extra edgeloops. 

    The extra edgeloops (2 division bevel with no chamfer) is viable because of easy removal. You can delete the edgeloops at any time and make changes easily. Great for LODs.

    Single bevel with custom normals looks good in VR, but it's hard to fix when you need to make changes, and the custom normals workflow can be a slow down.

    I think a combination of these approaches, when keeping in mind the asset's use, complexity, distance to player, and other variables is best. Whatever works, you just have to weigh your options.
    Thanks a lot for the extra comments, especially for mentioning VR, which is my target medium :) I'll definitely be looking into custom normals. I seem to remember someone mentioning Marius Silaghi's quad chamfer plugin was good for this? (been looking for a max script to automate some of this work, doing it manually seems like a lot of work). Sorry for derailing the thread since this is about the trim technique.
  • dzibarik
    Offline / Send Message
    dzibarik polycounter lvl 10
    Last time I asked there was no one click solution for custom vertex normals in 3d Max. 

    http://polycount.com/discussion/154664/a-short-explanation-about-custom-vertex-normals-tutorial/p1
  • Makkon
    Offline / Send Message
    Makkon polycounter
    Custom normals are pretty great, though they can be a little tough to manage when you have a complex mesh to worry about. It's less of a worry when your details and decals are floating and not cut into the mesh.
    If you are a Maya user, this script has been really wonderful so far :)
    http://www.mapcore.org/topic/16292-vertex-normal-script-for-maya/
  • JedTheKrampus
    Offline / Send Message
    JedTheKrampus polycounter lvl 8
    Mant1k0re said:
    long triangles cause issues with the rasterizer, https://simonschreibt.de/gat/renderhell-book3/ check out section 6 
    That truly was an enlightening read, Radiance. But if I understand correctly it really is an issue if the triangle is really, really long. Which can be the case if you're beveling something like a wall, I guess; in which case the solution would be to simply insert more cuts. I'm really interested in this because 90% of my modeling work are buildings and I use bevels on every other edge.
    Any rasterizer section that has two or more triangles intersecting is going to be more expensive than any rasterizer section that only has one triangle in it. That's why when engines draw a full-screen quad, they do it using one triangle in clip space: (-1, -1, 0), (-1, 2, 0), (2, -1, 0) rather than a two-triangle quad at each corner of clip space. You reduce the burden of the rasterizer along that diagonal.

    Your proposed solution, adding more cuts to the wall, actually increases the pressure on the rasterizer. I measured approximate pixel distances using the measure tool. Observe:



    One cut down the middle makes the situation worse:



    With no bevel there's just one non-silhouette edge that takes up around 1463 pixels. So if you use just a single bevel for everything, you'll have lower vertex processing cost and a better visual result compared to hard edges (assuming here you can use hard edges off seams if you want), but you'll generally put about twice as much pressure on the rasterizer. It's OK to use bevels for some things, but you should avoid them on current hardware if there's another way that looks just as good, and make sure that things that have bevels have LODs that don't have bevels. It's more important to avoid tiny triangles that have substantial portions that are smaller than a pixel (which is another big reason why beveled meshes are kind of bad for performance.) I think it's pretty safe to say that if you want to maximize performance, you should stick to bevels that are 1 quad across rather than 2. 2 is OK if you're making a portfolio piece or personal work and want UV layout to be more straightforward, otherwise you should stick to 1 because having 2-width bevels is definitely going to bottleneck the rasterizer.

    One artistic thing I like about this technique in particular is that it's pretty easy to vary the apparent width of the bevel, because it's all in the texture.
  • Mant1k0re
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    Thanks a lot for the explanation Jed, I think I'll do a test in-engine to see perf for myself though and see if it's really such a showstopper. The thing I'm after is good looking edges in VR, at least for assets I can get close to. Normal mapping does not work at all when you get close in VR, but it sounds like custom normals do. So I'll be exploring a bit more and see how much one can push the envelope with this.
  • JedTheKrampus
    Offline / Send Message
    JedTheKrampus polycounter lvl 8
    Yes, testing in engine is always a good idea, especially in VR where you might not want to use normal maps.

    Honestly a bevel here and there isn't going to absolutely kill your performance. You need a lot of them to bottleneck the rasterizer.
  • AlexanderLawrence
    Offline / Send Message
    AlexanderLawrence polycounter lvl 16
    Makkon said:

    I think a combination of these approaches, when keeping in mind the asset's use, complexity, distance to player, and other variables is best. Whatever works, you just have to weigh your options.
    Agreed. It's best to analyze each asset and determine what will be best in that particular circumstance.
  • AlexeyFanta
    Offline / Send Message
    AlexeyFanta polycounter lvl 9
    Sorry for necromancy, maybe, someone there stil trying to figure out this. You really need some space for padding to have 0 seams. Also RizomUV has now cool workflow to make it more less automatic ))

  • Kanni3d
    Offline / Send Message
    Kanni3d ngon master
    Sorry for necromancy, maybe, someone there stil trying to figure out this. You really need some space for padding to have 0 seams. Also RizomUV has now cool workflow to make it more less automatic ))


    Yes, especially if being mipped down (high quality mode = 2k trim texture, low quality mode for lower end machines = 512) there should be quite a lot of padding to prevent bleeding on lower resolutions
  • Lamont
    Offline / Send Message
    Lamont polycounter lvl 15
    Sorry for necromancy, maybe, someone there stil trying to figure out this. You really need some space for padding to have 0 seams. Also RizomUV has now cool workflow to make it more less automatic ))

    Here here for RizomUV. It does make this technique MUCH easier to deal with.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    @AlexeyFanta , @Lamont -  care to explain what this particular Rizom workflow does ?
  • AlexeyFanta
    Offline / Send Message
    AlexeyFanta polycounter lvl 9
    pior  After update 2024 it has trim sheet tools. You can specify how to pack your mesh to a trim, and via color ID you can make pading that needed to make sure there no pesky seams showing.
    https://youtu.be/s_eXFbAuuuA
Sign In or Register to comment.