LDraw.org Discussion Forums
Rendering speed and subparting - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: Rendering speed and subparting (/thread-16798.html)



Rendering speed and subparting - Philippe Hurbain - 2015-07-02

Never got a clear answer about this... is it useful to make subparts for parts that has symmetries or repetitions, strictly for rendering speed? (I won't discuss here the other benefits of subparting such as file size savings).


Re: Rendering speed and subparting - Stan Isachenko - 2015-07-02

I think no. Almost all render engines first parse all subparts and then render all polygons from them. So i think there is no difference.


Re: Rendering speed and subparting - Roland Melkert - 2015-07-02

Speed wise you want as much in a single mesh as possible as it reduces (api) overhead. Subparts could help reduce the preparation time needed though.


Re: Rendering speed and subparting - Philippe Hurbain - 2015-07-02

OK, thanks both !


Re: Rendering speed and subparting - Ben Supnik - 2015-07-03

Roland Melkert Wrote:Speed wise you want as much in a single mesh as possible as it reduces (api) overhead. Subparts could help reduce the preparation time needed though.

There's a limit to how much processing can be 'cached' on sub-parts because each sub-part can (1) be modified by parent commands (scale, BFC inverse, change of texture environment, etc.) and (2) may interact with neighbors (e.g. for smoothing and calculating normals).

There are some cases where there could be some computation savings: if we have a rule "no smoothing between triangles across lines" (that is, lines induce creases) then we can reduce the set of "open" edges in a sub-part once. A few pathological cases are beig wins here: a 32x32 baseplate with 1024 studs - the studs are mostly pre-creased, so we eliminate almost 32k edge checks from sub-parts. But this case is already taken care of in the library.

I think a good rule of thumb might be: the humans will get annoyed with a huge file before the renderers get slow at pre-processing with repetition. :-)

cheers
Ben


Re: Rendering speed and subparting - Philippe Hurbain - 2015-07-03

Like your rule of thumb! Wink


Re: Rendering speed and subparting - Roland Melkert - 2015-07-03

I think you understand but to be sure Smile ..

I didn't mean to make the LDraw files large, I meant rending wise it won't speed things up. Once the files are read they should be used to create the recursive flat data (mesh) needed for rendering.

In LDCad for example I do this on the part level but all vertices etc are cached on the .dat file level. Another advantage of many subparts is the possibility for multithreaded loading/caching/preparing.