Home Technical Talk

Tips for baking bevel onto hard edges?

polycounter lvl 6
Offline / Send Message
bitinn polycounter lvl 6
Hi,

I am working on a project where we are limited by polycount budget (because it's a Sims like builder game, we need to be conservative with polycount and texture).

And one thing I am doing, is to use hard edge on models to maintain silhouette, and use a higher poly model to bake smaller bevels onto normal maps. For example:





Question:

- I am not entirely sure I am doing this right. Because we expect the game to use an isometric camera at distance, we set a low texel density goal (2.56 ppcm). The drawback, as you can see, is metal reflection at the fake bevels are looking a bit strange (wavy). Is there a cure for this without using higher texel density?

- I also tried chamfer/support edge loops on low poly, but neither give me a fine bake like the 2nd image. Plus I ended up using more polygon (actual polygon in game) than using hard edges, if I want to maintain a good silhouette and decent triangulation result.  Is using hard edges the better solution for my case?

- My reason for doing this, is to create a nice semi-realistic bevel feel on models, without needing to handpaint the bevels. Is this something people do to PBR assets?

In short, if you were in my situation, would you use hard edges?

Replies

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    What do you mean by "wavy"? I don't see waviness. I see pixelation.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Obscura said:
    What do you mean by "wavy"? I don't see waviness. I see pixelation.

    Sorry, I got a retina screen, that might have made my screenshots look worse somehow... And Maya's viewport doesn't have retina support, let me capture some from Unity:



    Without normal map:



    And this is my normal:



    And this is how big I expect the chair to be, when in game (and with FXAA enabled):



    At the same distance without normal:



    TL;DR;

    Maybe wavy is not the right word. But do you see any rooms for improvement, in particular with my normal maps?


  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    To add: this is as close as I think the camera will ever be (without or with Normal maps).


  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    I see. Its still a pixelation. You can fix this by UVing the legs of the chair straight. You can also try adding more dilation.
  • Neox
    Options
    Offline / Send Message
    Neox veteran polycounter
    considering hard edges add as many verts as using chamfers, you might just get away with using less loops on the curves and chamfering all those edges. using face weighted normals you could get rid of normalmaps alltogether if you use them just for the edges.
  • pior
    Options
    Offline / Send Message
    pior grand marshal polycounter
    Upload a test asset for people to look at it. This is probably trivial to fix but there's no real point trying to guess what went wrong as there could be multiple factors involved. In other words, put the odds in your favor by providing all the data/information rather than just screenshots.

    And yeah, for this kind of stuff you are probably better off creating models with beveled edges since the cost will be negligible, and the gain in texture resources will be significant.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Neox said:
    considering hard edges add as many verts as using chamfers, you might just get away with using less loops on the curves and chamfering all those edges. using face weighted normals you could get rid of normalmaps alltogether if you use them just for the edges.
    Thx. I heard this point a lot, however, my hard edges are at the uv seams anyway; and I am not quite happy with the chamfer approach in my test, as you say, once chamfers are here, we usually skip the normal map. But a 1 segment chamfer can't beat normal map easily without extra help from textures?

    I saw The Sims' assets using the chamfer approach sometimes, but they still use handpainted diffuse map to fix the highlight at the edges (and I am trying to avoid handpainting that).

  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    "But a 1 segment chamfer can't beat normal map easily without extra help from textures?"

    Looks the same if you do it right. If you apply face weighted normals, the corners should have good shading. Thats the point of the whole technique.

    "but they still use handpainted diffuse map to fix the highlight at the edges"

    I would say thats just the part of their visual style. Its slightly stylized.
  • Neox
    Options
    Offline / Send Message
    Neox veteran polycounter
    it really depends on how close you wanna get and what your final output is supposed to look like, but essentially even trading a chamfer with an extra edge for the normalmap doing nothing but edges might be worth it. you don't really have to handpaint, you should be able to generate those edges in the diffuse using substance.

    in your example the "wavyness" is likely to happen becase of your final output resoltion? So this is stepping, you could fight it by softer bevels on the highpoly and more sampling on the normalmap. Or you could straighten your UVs and not have diagonal lines. This will not work in all cases or you might even get away in those soft curves you have there.
    Using more generic normalmaps not specifically for this asset baked ones.

    Like using trim sheets in modular environments.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Thx @Neox, @Obscura, and @pior

    So I suck it up and made two version of the same low poly: one with hard edges and one with chamfer approach. One with normal baking and one without. And indeed, if I am extra careful with straighten my UV (create more shells), then they look pretty much the same.




    Thing is, although I would expect they to have roughly the same poly/vertex count, they don't. In Unity they have following stats (and yes I did Triangulate within Maya):



    And also I just realize I need the normal map anyway for some surface details, but with Chamfer approach maybe I can save some more by using smaller, tile-able normal maps.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Actually, these stats match Maya's Tris and UVs count. What does "UVs" mean in Maya's context?




  • Neox
    Options
    Offline / Send Message
    Neox veteran polycounter
    for the mesh based approach to work you need face weighted normals

    for the straight uvs i don't think you will need extra cuts, but it sure will stretch some on the curved parts, however. depending on the final texturestyle you might not even see it.
  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    Make sure to face weight the normals to get the most out of the chamfered geo. The example you posted doesn't look like you did.

    Just in case you're not completely familiar with the technique, here's a video explaining it:
    https://www.youtube.com/watch?v=G-K7WT9IIok
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    PolyHertz said:
    Make sure to face weight the normals to get the most out of the chamfered geo. The example you posted doesn't look like you did.

    Just in case you're not completely familiar with the technique, here's a video explaining it:
    https://www.youtube.com/watch?v=G-K7WT9IIok
    Yes I missed that in a hurry. A question though, does FWN means 100% vertical normal or does it also have some wiggle room?

    Eg. which is more "correct" FWN? I used 2 separate scripts, one require manual face selection, but ensure 100% vertical to face; the other is an one click solution but somehow it doesn't create 100% vertical normals?

    Also please tell me how you spot I wasn't using FWN so easily :)









  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Fully perpendicular is the best on flat shapes.  If its fwvn or not, you can tell by the shading. The distortion of the reflections. It "bends" when you dont adjust the normals. And from the diffuse shading.

    The legs still doesn't look fully correct though, in any of your examples. Look at those lines and breaks in the shading where the rounded corners are.
  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    Incorrect normals are easy to spot most of the time because they cause a gradation across the affected surface. The more incorrect the normals the more pronounced the gradient.

    "Face weighted normals" is just the name of a quick technique to alter normal direction based on the size of its associated faces (ie. the 'weight'). But for the best results you should edit them via manual face selection so the normals are completely perpendicular to a specific surface.

    If you end up doing a lot of work with custom normals it might be worth picking up this script: http://www.scriptspot.com/3ds-max/scripts/normal-tools
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Obscura said:
    Fully perpendicular is the best on flat shapes.  If its fwvn or not, you can tell by the shading. The distortion of the reflections. It "bends" when you dont adjust the normals. And from the diffuse shading.

    The legs still doesn't look fully correct though, in any of your examples. Look at those lines and breaks in the shading where the rounded corners are.

    I was trying to save a few polys by not chamfering the bottom faces of legs, but I guess they backfired, and affected FWN script from working properly, how about now?





  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Yes. If you would want to save on tris, you should rather try something like this:

  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Hi All,

    Sorry to jump back onto this topic. I have read many times LOD are difficult with Chamfer models. And now I know why: I don't have a normal map anymore.

    The chamfer model has around 1000 tris, do people normally create a hard edge low poly version as LOD1/2 and ignore the normals?

    (You can see the look of hard edge model at a distance without normal in my earlier replies).
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    I would do the first LOD similarly to that image with the topology changes. Id reduce segmentation of corners, etc. And on a further LOD, I would switch to hard edges, yes. Question though. Why do you need to LOD and go such low poly in a Sims type of a game? It has a top down camera, so frustrum culling takes care of the rest of the scene.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Obscura said:
    I would do the first LOD similarly to that image with the topology changes. Id reduce segmentation of corners, etc. And on a further LOD, I would switch to hard edges, yes. Question though. Why do you need to LOD and go such low poly in a Sims type of a game? It has a top down camera, so frustrum culling takes care of the rest of the scene.
    Because we somehow want this to work on Intel GPU and entry-level Mac, while having a wider zoom-level than Sims. It's a ballpark estimate, but seeing Sims use LOD aggressively, we might as well prepare for it.
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    I think first you should do some performance tests. I know intel gpu is weak but I'm not sure if its that weak. If frustrum culling works, and you can also hide walls and props that you dont want to see from the current camera angle,I don't think you would get issues from too many polygons. Doesn't sound like a too complex scene. It should be still able to handle a few million tris on the screen. You could save more on using tiling textures, and minimize the amount of unique ones. Also, if the intel gpu should be able to handle it, you need to take some sacrifices and live with a few hard edges here and there at least in the case of a much more complex object i think.

  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    I used an Intel GPU for a while about 3 years ago with an i5-4670 CPU, and it had basically identical performance to a Geforce 650. Not amazing performance, but not too bad either.

    For LODs (not counting UVs) here's a rough example based on your mesh of how you might go about it: https://www.dropbox.com/s/z6ug06m3hofjkk7/chair_lod.obj?dl=0
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    PolyHertz said:
    I used an Intel GPU for a while about 3 years ago with an i5-4670 CPU, and it had basically identical performance to a Geforce 650. Not amazing performance, but not too bad either.

    For LODs (not counting UVs) here's a rough example based on your mesh of how you might go about it: https://www.dropbox.com/s/z6ug06m3hofjkk7/chair_lod.obj?dl=0
    That's very kind of you, I get the idea now.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Hi All,

    For chamfer models, is it possible to hide the pixelation that appeared when viewing from certain angles?

    I have tried my best to straighten UVs and give enough padding for dilation, but I still can't get the same result as hard edge approaches.

    For example (the one at the back is using hard edges + normal map, I also tried to make chamfer larger to compensate for the issue):



    The issue won't be so obvious if I am not suing metallic material. But am I hitting a limit of chamfer?
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    Anti aliasing is your friend here... On low settings, this should be fine. On high, you should put strong anti aliasing. Temporal AA does really good job, but it has certain issues and some people don't prefer it, but I'd say overall its nice. MSAA would be an up to date alternative, especially for forward rendering.

    I would say on the intel card, its fine like this...  :p
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    You can also exaggerate the bevels. This would make it appear less bad from closer but you still need AA from further, and in general, for smooth result. Super sampling would have the same effect. Like rendering on higher resolution and downscaling. In some games, there is resolution scale/super sampling slider , which you can pull up to 200 % which means 4k downscaled to 2k if you play on 1080p. This would have an anti aliasing effect as well.

    For perfection, use AA and supersampling in all cases  B) 30 fps on modern hardware.
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    Obscura said:
    You can also exaggerate the bevels. This would make it appear less bad from closer but you still need AA from further, and in general, for smooth result. Super sampling would have the same effect. Like rendering on higher resolution and downscaling. In some games, there is resolution scale/super sampling slider , which you can pull up to 200 % which means 4k downscaled to 2k if you play on 1080p. This would have an anti aliasing effect as well.

    For perfection, use AA and supersampling in all cases  B) 30 fps on modern hardware.
    Haha thx!

    The screenshot I posted was using Unity built-in FXAA. I suspect that's what we are going to use on lesser hardware, also because we want to use deferred shading. There are other cheaper solutions like SMAA we can explore.

    Good to know I have done the right thing from an asset standpoint.
Sign In or Register to comment.