Home Technical Talk

Bevels vs Sharps

Way2Close
null
Hey people, Is there any reason why I shouldn't bevel every sharp edge (instead of making them sharp) as I understand it any where there is a sharp/split edge, those verts are doubled (to the gpu at least), if you bevel the same edges the verts are also doubled, but with bevels you can have UV seams anywhere you want for technically less gpu verts due to UVs having less seams, Yes you will end up with more tris but surely all that matters is vert count? 

In the image below they both have the same gpu vert count, in more complex models the beveled one would have less gpu verts because there will be fewer UV islands...



So would it be ok to bevel instead of sharp for all objects in a game?

Please let me know if I have completely misunderstood all of this haha

note: I use Blender > substance painter > UE4

Replies

  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    um, you're add two triangles for every segment - small ones at that.

    You're correct i your assessment, but in this day and age (mobile platforms excepted) you really don't need to worry about vert count very much.

    Whether you bevel an edge or not is a decision you should make based on what you want it to look like and whether having the geometry there adds any value to the object or not. 
  • Way2Close
    Options
    Offline / Send Message
    Way2Close null
    poopipe said:
    um, you're add two triangles for every segment - small ones at that.

    You're correct i your assessment, but in this day and age (mobile platforms excepted) you really don't need to worry about vert count very much.

    Whether you bevel an edge or not is a decision you should make based on what you want it to look like and whether having the geometry there adds any value to the object or not. 
    So our only real concern is the amount of texture information? 
  • Ashervisalis
    Options
    Offline / Send Message
    Ashervisalis grand marshal polycounter
    This is actually a really good question. People are really careful with their bevels in game art, but this is making me question everything I know.
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    Bevels help catch very thin specular highlights which make all the difference. 

    If geometry performance is a real issue, I would just create LOD's. 
  • Prime8
    Options
    Offline / Send Message
    Prime8 interpolator
    If I remember correctly the UV seam splits the verts as well and you will have seams as well with bevels, though less and as you said, you can choose more freely.
    You can as well work with custom normals when using bevels and skip high-poly -> normal baking for certain things.

    UV unwrapping gets more complicated with bevels.
    If you are planning to use Substance or Quixel or anything else you want to feed with a curvature map for masking, you might run into some issues with custom normals.
  • Way2Close
    Options
    Offline / Send Message
    Way2Close null
    Prime8, That is the problem I have at the moment, I am trying to use custom normals and bevels, which works amazingly, Is it a case of custom normals or normal maps? Because I tried the whole one "smoothing group" or no hard edges workflow and it always looked awful especially with mips. Why do custom normals cause issues for substance? because substance is giving me a hard time with curvature maps on seams.
  • Prime8
    Options
    Offline / Send Message
    Prime8 interpolator
    If you have a hard/split edge and bake down all necessary maps, you get curvature information on both UV islands at the seam, when you have a custom normal and the seam on one side of the bevel, only the island with the bevel contains curvature information, the other is "flat", giving you a sharp edge on any mask. You can see this here in many places
    http://polycount.com/discussion/comment/2567191/#Comment_2567191

    Custom normals don't cause any problem but the way curvature and UV seams work together as described above. If you don't use any masks based on curvature you don't have issues, at least I haven't experienced any yet.
  • Way2Close
    Options
    Offline / Send Message
    Way2Close null
    So is there no way around the bad curvature baking? As i understand it, SP generates its curvature maps from the normal map, wouldn't it be far better to generate it from the hp mesh? This is something I asked substance here: 
    https://forum.allegorithmic.com/index.php?topic=21117.new#new

    but never really got an answer to.
  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
    ^ Substance Designer bakes curvature from HP.
  • Way2Close
    Options
    Offline / Send Message
    Way2Close null
    So what causes the hard edges in the image here
    https://forum.allegorithmic.com/index.php?topic=21117.new#new

    Surely if its a curve, its a curve regardless of uv seams?
    Im so confused lol 
  • Prime8
    Options
    Offline / Send Message
    Prime8 interpolator
    cptSwing said:
    ^ Substance Designer bakes curvature from HP.
    Is that baker active again? Was deactivated last time I baked in Substance.
    Way2Close said:
    So what causes the hard edges in the image here
    https://forum.allegorithmic.com/index.php?topic=21117.new#new

    Surely if its a curve, its a curve regardless of uv seams?
    Im so confused lol 

    The curvature baking is not wrong, the curvature information is just limited to the face of the bevel.
    Look at the model you posted with the curvature map applied, you will see that only the UV shell of the top has contains information around that edge, the "stripes" don't, that is what causes the hard edge.
    On the lower edge it is not a problem because there is no seam.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    Way2Close said:
    poopipe said:
    um, you're add two triangles for every segment - small ones at that.

    You're correct i your assessment, but in this day and age (mobile platforms excepted) you really don't need to worry about vert count very much.

    Whether you bevel an edge or not is a decision you should make based on what you want it to look like and whether having the geometry there adds any value to the object or not. 
    So our only real concern is the amount of texture information? 


    No,  not at all. 
    Vert count isn't all that important because it's a relatively minor cost compared to all the other things.

    The most significant cost in a deferred renderer is how many times each pixel gets interfered with. Many things contribute to this cost and it's only indirectly related to how many triangles/verts are in your model. Shader cost (particularly with alpha blending) and post process effects are where you'll see most of your resources eaten up. 

    WRT your example...  Those small triangles you've added become extremely inefficient when they drop to sub pixel size (at a distance) as they can cause groups of pixels to be rendered many more times than they should be while contributing nothing to the appearance of the object. Long thin triangles are the worst case in this regard,  especially if they meet at a pole.
    You get around this by lodding appropriately and at the correct distance from camera.

    I've glossed over the details here but you'll be able to Google up a more in-depth explanation of how geometry and pixels marry up. 
  • ActionDawg
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    Those links have a lot of valid info  but are somewhat out of date as hardware has moved on significantly in the last 14 years.

    http://www.fragmentbuffer.com/gpu-performance-for-game-artists/

    This link is a lot more up to date - I just dug it out now and haven't read it all but it looks pretty solid - the issue I mentioned earlier is called overshading in this article. 
  • Way2Close
    Options
    Offline / Send Message
    Way2Close null
    Thank you very much, I will read through it. I hope you dont mind if I ask a less general question in the mean time, but in your personal opinion:

    My game is very room based, how important would this all be, as when objects are occluded (by lets say a wall) they are no longer being rendered, So what i'm trying to say is can I just go buck wild with bevels because they wont ever be rendered at a distance?
  • almighty_gir
    Options
    Offline / Send Message
    almighty_gir ngon master
    Way2Close said:
    Thank you very much, I will read through it. I hope you dont mind if I ask a less general question in the mean time, but in your personal opinion:

    My game is very room based, how important would this all be, as when objects are occluded (by lets say a wall) they are no longer being rendered, So what i'm trying to say is can I just go buck wild with bevels because they wont ever be rendered at a distance?

    The opposite, i believe. Extremely small triangles tend to be more gpu intensive because of the way pixels/fragments are calculated in batches of 4. i one, or some of those pixels are outside of a triangle, they have to be recalculated.

    https://www.g-truc.net/post-0662.html
  • almighty_gir
    Options
    Offline / Send Message
    almighty_gir ngon master
    Might be useful to get a real rendering engineer to weigh in on this... @jeffdr or @monkeyscience maybe.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    ^^ That's always a good idea. There are loads of factors to consider when you're trying to scrape out the last few few frames per second. 

    The fragment/small triangle thing is a matter of efficiency. Any given fragment inevitably stands a chance of being drawn multiple times and that's OK. What you're trying to avoid is doing it for no benefit - Eg,  having several triangles taking up less than one pixel on screen. 
    Drawing an object is always going to use resources - it's efficient when all the resources used contribute directly to it looking awesome. 

    if your view distances don't change much you're very lucky because  you can tell whether your triangles are contributing or not by simply looking at them (they don't change size on screen if you don't move) . 
    The chances are that if you're building a room sized environment youll be able to bevel away to your heart's content with no ill effect. 
  • McDev
    Options
    Offline / Send Message
    McDev polycounter lvl 2
    Funny I am just thinking about this for a project of mine, it would be great to have more indepth information. I was anyway thinking about a test to see how much thin triangles affect render speed. EDIT: I actually just did and when having 2M triangles in the scene it doesn't seem to make any difference if they are smaller than one pixel or not. Might really only be a low end problem like mobile and VR devices.

    I tend to use bevels and make them smooth so that I get a nice edge with limited polycount and better results than a normal map can provide, which we know can be tedious to make smooth. Especialyl at closeups this works good and it can give you a better Lightmap result as the surfacec is actually round by some degree.

    If you have the time LOD is a great solution and it can even work in closeups. You can match your UVs so that lower LOD levels work fine with both texture and lightmap. But it works especially well for looping areas so for instance if you got a cubic pillar and you round up the edges and repeat the texture on the x axis. For more complex objects and bevels this may not work properly, but if LOD is only used to reduce triangle count then this can be an option, in the distance UV seams don't matter. But here is an example, the top plate is an issue here.


    Yet for my project I keep this in mind but mainly focus on LOD0 for a start. I want to make an interactive demo and once the scene runs bad on low and mid range GPUs I am going to add LOD. Not sure which tools do what but most bevel tools are UV aware nowadays andthis can be a great help, so you actually model and UV your LOD1 first and then bevel the edges. At areas with connected UVs you get the end result directly. Also when you are unsure this is actially a good approach because you can always Bevel, but it is harder to make it unbeveld when it has UVs already.
Sign In or Register to comment.