FreeCAD renderer is CPU bounded (at least for me)

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
jmaustpc
Posts: 9638
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby jmaustpc » Sun Feb 02, 2014 10:05 am

Hi Guys
A related question that came to my mind reading Sean BRL-CAD's responses.....

How quickly can we render rotate, and how big and complicated model can we deal with etc.etc.. if we also only displayed in Wireframe mode?

To me working in wireframe mode is horrible, but could we also model CERN, if we only rendered it in wireframe mode?

If so perhaps there could be niche FreeCAD uses, where one would want to operate in wireframe mode and then just hit "render" manually when you wanted to, like BRL does?

Jim
kwahoo
Posts: 275
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby kwahoo » Sun Feb 02, 2014 10:54 am

jriegel wrote:First of all, we will never reach 100% in GPU due to the fact that modern GPUs consist mostly out of things we don't need, like Pixel engines geard toward shader programs or texture-engines. So 50% is already pretty high. The newer the GPU hardware, the lower the GPU usage I would guess...

The main difference of the Schenkel and the Panel are the number of nodes in the scene graph. So if you have a project consisting of small parts with only a couple of triangles each, the rendering process is more traversing the scene graph (CPU) rather then rendering triangles (GPU). So at them moment FreeCAD is not geared toward lots of parts. There fore our scene graph layout is to "flat". You can see this in the Scene Graph Inspector in the tools menu.
Does renderer the scene graph traversing is necessary in all cases? Or only for highlighing/selection/modyfing faces and vertices? Excuse me if I am wrong about rendering process, but rotaing/panning/zooming shouldn't need more than:

a) modify transformation matrix [CPU]
b) access buffered verices and indices [GPU/CPU]
c) apply the matrix [GPU]
d) finish rendering (shading, rasterization) [GPU]

Maybe some kind asynchronous algorithm (different pipeline for changing a view and for modyfing/selecting a model) is possible?
jmaustpc wrote: To me working in wireframe mode is horrible, but could we also model CERN, if we only rendered it in wireframe mode?

If so perhaps there could be niche FreeCAD uses, where one would want to operate in wireframe mode and then just hit "render" manually when you wanted to, like BRL does?
Jim,
The wireframe will change nothing, while we are bottlenecked by scenegraph. Without that we could beat BRL-CAD preview even in shaded mode, I think;)
BRL-CAD has no dynamic selection/highlighting mouse feature.

PS A familiar picture Image
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby jriegel » Sun Feb 02, 2014 12:52 pm

Kwahoo ist right. Wire frame is not better. Mostly even worse cause most OpenGl implementations are not very effective on lines. They mostly concentrate on triangles....

@kwahoo
Yes your principally right, but ;) The render in Coin is a so called RenderAction which traverse the tree and do all kind of stuff. E.g. decide which Level of Detail needs to be rendered and if the object (Part) is in the view frustum at all. And a lot more.... Also interesting is sorting of transparent objects. They have to be rendered from back to front. So Coin sorts them before rendering. And and and......

Tweaking the scene graph is a art in itself and we will have lot of fun in the future with it... :?
Stop whining - start coding!
kwahoo
Posts: 275
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby kwahoo » Sun Feb 02, 2014 2:11 pm

jriegel wrote: @kwahoo
Yes your principally right, but ;) The render in Coin is a so called RenderAction which traverse the tree and do all kind of stuff. E.g. decide which Level of Detail needs to be rendered and if the object (Part) is in the view frustum at all. And a lot more....
I noticed an interesting thing in Pro/Engineer (Creo): rotating and panning is fast but zooming, when LOD is applied, is much slower (maybe x10 slower!). PTC had to do some smart optimisations.

jriegel wrote:Also interesting is sorting of transparent objects. They have to be rendered from back to front. So Coin sorts them before rendering. And and and......
This making situation hopeless :( I heard about some techniques without sorting, but all are unfortuunately Nvidia-specific.
1.http://blog.icare3d.org/2010/06/fast-an ... uffer.html
2.http://www.openglsuperbible.com/2013/08 ... necessary/
jreinhardt
Posts: 329
Joined: Mon Sep 09, 2013 6:08 pm

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby jreinhardt » Sun Feb 02, 2014 4:17 pm

jriegel wrote: So in assembly we need a eye on that too, such as low render quality for catalog parts...
Is there currently any way to mark a part as a catalog part or to set the render quality?
BOLTS, standard parts library for FreeCAD Thread, Help with Translation
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby jriegel » Sun Feb 02, 2014 4:56 pm

Not jet, but soon...
Stop whining - start coding!
mouse
Posts: 11
Joined: Mon Feb 27, 2017 11:20 am

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby mouse » Mon Feb 27, 2017 11:43 am

First can I thank you for providing such elegant and powerful software for free.

By way of a small contribution, I have noticed the following effect.

In a simple arch drawing, just two crossing walls created from line using the wall tool - I am working my way through tutorials - I get what looks like total 1 core usage (12.5 on an 8 core machine) and 42% GPU usage in process hacker.

This is associated with a shimmering of the partial shading on the top surface. When this shimmering is present, usage is high when not present it isn't.

I am running under Win 7 ultimate on a i7-2600 3.4 Ghz machine with 16Mb of memory. GPU is a bit weak - Radeon HD 6700 series if I remember correctly.

I hope this may help you to track down an issue which may be contributing to performance challenges. I am happy to supply any other info you need.

More generally can I ask, possibly in another post if you prefer, whether it is practical performance-wise to use FreeCAD for detailed house-sized architectural drawings yet? If one is to use the power of FreeCAD, I would think you's need to paramterically constrain quite a few objects - this object must be the height of the ceiling, that must be the length of that wall etc. So I though I would check regarding performance first. Possibly there are workarounds....

My simple arch drawing:
Image

Kind regards

Mouse
Jee-Bee
Posts: 2011
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby Jee-Bee » Mon Feb 27, 2017 1:54 pm

As far as i know Multi threading and CAD software is difficult!
Creo Doesn't and most processes in FreeCAD doesn't eighter. As far as i know only Boolean operations using multi threading...
Maybe later on Assembly can use multithreading during loading... but that's a wild guess.
mouse
Posts: 11
Joined: Mon Feb 27, 2017 11:20 am

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby mouse » Mon Feb 27, 2017 2:21 pm

Jee-Bee wrote:As far as i know Multi threading and CAD software is difficult!
Creo Doesn't and most processes in FreeCAD doesn't eighter. As far as i know only Boolean operations using multi threading...
Maybe later on Assembly can use multithreading during loading... but that's a wild guess.
Thanks I can see it would be difficult.

I was more thinking that the continous shimmering of the rendering, which occurs when I am making no changes at all to the drawing, and is associated with these high CPU incidents, was possibly indicative of some instability or inefficiency in the rendering algorithm or some related routine.

Kind regards

Mouse
User avatar
yorik
Site Admin
Posts: 11840
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: FreeCAD renderer is CPU bounded (at least for me)

Postby yorik » Mon Feb 27, 2017 3:22 pm

For architecture models, yes, it works quite well already (examples:
https://github.com/uncreatednet/casa-ec ... 2001.FCStd
https://github.com/uncreatednet/wikilab ... ilab.FCStd )
Indeed at some point you begin to reach performance limits. But there is a lot that can be done, simplify some parts of the model, remove "parametricism", etc. But I see none of these problems as very show-stopping, because there i still a lot to be done on the freecad side to make things better (assemblies, GUI optimization, etc), and also this is an inherent problem of parametric cad, it is very easy to raise the complexity to infinite levels...