Question about smoothing groups and vertex count

justinbarrettjustinbarrett Posts: 178Member

I was wondering if anyone knew, off the top of their head, if using flat shaded meshes(no smoothing) splits the vertices?...double the vertex count...in conjunction does using smooth shading interpolate the vertex normal and share it between the two "verts"..making only one vert?...
I know this is a convoluted question, but I'm working on some assets and before I get all crazy and actually start to make something meaningful in Godot I would like to know specifically.
-thanks :)

Comments

  • MegalomaniakMegalomaniak Posts: 3,006Admin

    AFAIK, yes, that's the way GPU's work. By no means can I guarantee that I'm not misrecalling something though.

  • TwistedTwiglegTwistedTwigleg Posts: 3,557Admin

    Unfortunately, I do not know the answer, but I am curious because a lot of the game development I do is low-poly with flat shaded models. I personally haven't noticed too many slowdowns with the games I have made in Godot with flat shaded models, but that doesn't mean there isn't a performance cost. I know in some game engines flat shaded models doubles the vertex count, like I have heard this happens in Unity, but I do not know if the same happens in Godot or not.

  • cyberealitycybereality Posts: 1,090Moderator

    One option you may want to look at is using flat colored textures for low poly objects. This is more flexible, for example, if you want to have a single face or part of an object be a different color. I tried to do this with vertex colors, but they seemed to want to interpolate (maybe there is a way to fix this with shaders, I don't know). For example, the texture can have a few squares of different colors, and then you can drag the UV shapes into them completely to color the faces.

  • justinbarrettjustinbarrett Posts: 178Member

    well my plan is to have flat shaded models all sharing the same material and one palette texture for all the colors....an open world game...this is why the vertex count is important...I am trying to keep things very minimalistic.

    I appreciate all the responses...I guess the fact is I should be checking what the video card is doing and not so much the engine...

  • cyberealitycybereality Posts: 1,090Moderator

    I just did a test with a simple icosphere exported as glTF from Blender. I was able to get about 8K spinning objects on screen at interactive rates (above 60 fps on a 2080 Ti). With either flat or smooth shading, the performance was about exactly the same. So my guess is that Godot is properly using indexing with the same number of vertices. It would be good to user RenderDoc (or whatever) to confirm exactly, I will look into that next. Cheers.


Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file