separate splits increase the rendering time ?

Community Forums/General Help/separate splits increase the rendering time ?

RemiD(Posted 2016) [#1]
Hello, :)

Today i have read this article :
http://www.ericchadwick.com/examples/provost/byf2.html

And i was surprised to learn that to not increase rendering time too much, what matters is not only to limit the numbers of materials (and thus of surfaces) in a mesh but also the number of different smoothing groups and of separate uv groups (an uv group being triangles which are welded, separate uv groups being triangles which are not welded)

And if i understand correctly, the author says that the impact of each different smoothing group or separate uv group can impact the rendering time as much as another material (and thus surface).

Is this still true ?

Thanks,


Bobysait(Posted 2016) [#2]
It is and it's not ...
It depends on the structur of the surfaces of the graphics engine you use.

What slows down the rendering is essentially the number of draw call.
Each call will transfert a paquet that needs to be synchronized with the CG.
(Nowadays, you can eventually use FrameBuffers to store the most used surfaces in the CG Ram).
So, if your structur is made of "One Surface per Material", it will multiply the draw calls.

What happens with the UV, or the Normals is noticable too in the framerate and it is due to the vertex count increased.

While A triangle is computed with 3 vertices (you can lower this by using TRIANGLE_FAN/TRIANGLE_STRIP or POLYGON_STRIP if your engine support it),
a vertex for most engines, only support a single Normal vector and a single UV set at a time when rendering.
So, if you have a seam on the texture, it will require two vertices to make it visible
(an engine like 3dsmax will use a single vertex -> but it's a Rendering/Video engine, not a "realtime" engine, internally, it's possible that all the triangle are just exploded for the rendering, using a vertex for each normal set and each UV set, and the "polygon" look is only used for the user interface, not for rendering)

So ... The matter of smoothing group (and UV seams) is not due to the structur of the smoothing groups, but only due to the way it needs to compute more vertices for the seams.

Conclusion :
More surfaces = more draw call = more CG synchronization = more rendering time.
More vertices = more rendering time.


RemiD(Posted 2016) [#3]
Ah ok i have reread and by "splits" they probably mean duplicated vertices.
So it seems to be a matter of limiting the number of surfaces/materials to limit the number of draw calls and also limiting different smoothing groups and unwelded triangles to limit the number of vertices. Ok !


AdamStrange(Posted 2016) [#4]
Be careful. Shaders can also add differences as does the 3d engine. Also materials can mean a lot of different things. You could have a single materials that uses uv to select the current maps and vertex colours to select the colours. in that situation the document becomes of less use.

You also have to consider the 3d pipeline you are using. older pipelines are slower but a bit more forgiving. you are basically throwing lots of commands at the gpu. E.G. for each shape you are sending gpu data for each vertex, etc.

Modern 3d moves from the base triangles and strips to batch processing. You setup as much of the data as possible beforehand. and with a single gpu command send all the data to the cpu in one go. Because the connection between the cpu and memory is much faster it is considered a single command and many times faster. But the strips still exist.

Moving further we are now moving into a new phase of 3d where all the above is combined and processed. The entire 3d scene is transferred and locally held and only the changes updated. It;s a bit of a brain crunch to get your head around.

The best way to think about it, it not to. Do what you have always done until you find there is a bottleneck. then work out if it is the model or the 3d renderer.


Matty(Posted 2016) [#5]
Assuming we are talking blitz3d...the efficiencies gained by worrying about some of these things are fairly small unless you are throwing very complex scenes with lots of animation...your bottleneck will be elsewhere. Still....it's useful to know.


RemiD(Posted 2016) [#6]

Assuming we are talking blitz3d...the efficiencies gained by worrying about some of these things are fairly small


Combining surfaces which use the same material and which are near enough can significantly decrease rendering time, and limiting the number of vertices (no unwelded triangles like i have seen in some routines to merge surfaces in the code archives) can also significantly decrease rendering time. Not sure why you say that the impact is "fairly small". I have seen the contrary.