Home Technical Talk

Ngons for assets in UE4?

Coffeehouse
vertex
Offline / Send Message
Coffeehouse vertex
Hello Polycount-Community,

I read that one should alwas model in polygons which are (automatically?) converted to tris upon implementation into an engine (f.e. UE4).

I also read, that the reason for that is 
a) better animation possibilities
b) avoiding shading errors of ngons

Now lets say I have the back of chair with some curvy stuff around. If I just trace the outline with a path tool and then extrude it, I obviously have an ngon with 40 or more vertices on the front and back, and maybe 40 polys as ring (or edgeloop? not sure what the right term is here) around.

Is a model like that "game ready" or do I need to break the whole front and back into polys (with the cutting tool in 3dsmax or what?). That seems like a lot of work. Is that really necessary. If it is, is there a way to automate that?

Thanks,
Coffee

Replies

  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    You can use a turn to poly modifier to triangulate in Max, and then check the mesh for shading errors/edges that need turning. You should always maintain full control of your tri topology before baking or export to engine. Yes, the mesh will be auto-triangulated but the results, especially with n-gons, is very unpredictable.  And also, each software will triangulate differently and lead to errors. Do it right from the start and develop a correct/solid workflow rather than a lazy one.
  • Coffeehouse
    Offline / Send Message
    Coffeehouse vertex
    Thank you for your answer.

    If it is just about applying a modifier it is probably not that much effort, right? Would you triangulate objects consisting of even polygons manually too? Or is that safe enough to be left as quads?
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Quads are great for modeling/uving/skinning/etc, but, as I said above, if you don't triangulate your mesh before bake/export to engine you run the risk of an unwanted triangulation result which can lead to visual errors. Quads are still going to triangulate randomly (50/50), but it's just that with n-gons there are more permutations.  If you add the modifier you have full control as you can further edit the result by turning edges to fix shading/topology issues.

    Or if you're lucky you could get away with it in-engine altogether,  but that is poor practice imo.
  • Coffeehouse
    Offline / Send Message
    Coffeehouse vertex
    So if the shading looks wrong I have to "turn an edge?". How do I do that? Do i have to use the "normal" modifier to flip the normal on that tris/edge?
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    By clicking the 'turn' button.... :)

    If you add a 'turn to poly mod', check 'limit polygon size', set it to 3.

    Now go down the stack to your base editable poly, enable 'show end result', edge sub-object selection, and use either 'edit tri' or 'turn' to change the way hidden edges are oriented. (Hidden edges are always there when you're working on any poly mesh, they show up as dashed lines) This will propogate up the stack and is how your mesh will be triangulated.

    The normals of faces are the direction that they[triangles/faces/polygons] point in object/world space. A face is made up of at least 3 vertices and 3 edges, all with their own normal direction. So flipping a face is basically turning it 180degrees backward and is nothing to do with turning an edge. Think of it like turning it inside out. As a rule you always want the face normals of a contiguous surface pointing in the same direction. If they are not then the geometry will be 'broken'. Turning an edge simply means changing 1 or 2 of the verts that it is connected to, to neighbouring verts.
  • Coffeehouse
    Offline / Send Message
    Coffeehouse vertex
    Well, I do not quite understand what effect turning an edge has visually, but it probably will make sense when I try it out. Thank you for your explanation, Musashidan!
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Yes, try it yourself, you will need experience working on triangulated meshes to know what I mean. It's a bit hard to explain. The best thing to do is model a random shape, triangulate it and just start stretching verts around. You will soon see what I mean when the surface shading breaks. Then just turn some edges as I explained above and you'll see what I mean. Self-experimentation is a huge part of learning 3d.
  • Coffeehouse
    Offline / Send Message
    Coffeehouse vertex
    Hello again, well, it is not working as I hoped.  :)

    a) I cannot see the invisible edges (see first screenshot). Pressing F3/F4 doesn't change that. Neither does pressing the turn button. I can turn them without seeing them. The cursor changes when I move over it, but it is not dashed, just invisible. (3dsmax 2012)
    b) If I triangulate like you told me I can see them because they are not invisible anymore of course. (second Screenshot)
    c) You said I should move vertices around to see shading errors. That I do not understand. So I need to move every single vertex of my object to see if the edges are turned the correct way? How would I know which way is correct anyway ... should they all turn into the same direction if possible?

    Thx
    Coffee
     

  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Max 2012 was when they(Adesk) started to first implement Nitrous viewport. My guess is that your invisible edges(dashed) are simply not showing up on account of a 2012 display issue.

    As for what I'm describing, a plane isn't a good example as it has no silhouette. You only need to worry about shading errors after you have triangulated the mesh. This is when you would need to go in and manually turn edges to relieve the artifacts. A good rule of thumb when turning edges is to always go for the shortest edge possible. This can help if you run into concave quads.

    Another consideration is for cylindrical, and some curved shapes. You can sometimes get highlight skewing if the edges are all turned in the same direction.

    I'll try to post some images with examples late as it's hard to explain.
  • Coffeehouse
    Offline / Send Message
    Coffeehouse vertex
    There are some explanations in this video at around 2:30. 
    Is that the same thing you mean? So I would only need to scrutinize the mesh for weird spots?
    I also just tried to run meshsmooth/turbosmooth on a cylinder - that looked pretty awful too on the top. I suppose the whole thing is not that easy ... :(

    https://www.youtube.com/watch?v=VXS70tRhMb8
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    Perfect example! That video explains exactly what I described above......but with pictures. :)

    Mesh/turbosmooth is another matter entirely. That is subdivisional modeling as opposed to polygonal modeling (what we'very been talking about) I highly recommend watching all the vids on that site as it breaks the fundamentals down as simply as is possible.
  • Coffeehouse
    Offline / Send Message
    Coffeehouse vertex
    Yes, that sounds good. I should not turn this thread into a "teach me all the fundamentals about 3d". :)

    Thank you again for your time, Musashidan.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    No problem.  You're welcome. It might seem a bit overwhelming at first but after a while this stuff becomes second nature. :)
Sign In or Register to comment.