It is currently Fri Apr 03, 2020 6:18 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: 3D scanner software - new hardware question
PostPosted: Wed Dec 30, 2015 9:11 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 584
Location: Belgium
Hi,

After some time of developing my CT 3D VIEWER software.
http://www.marc-systems.be/new_2010/Viewer_3d_Examples.htm
I invested my last money in a new computer and new screen.
I was thinking (i 'm not a PC guru) with a good gaming video card, that ogre will be faster to make zoom and rotations.
But I was wrong, can someone tell me why the speed is almost the same as my old slower PC ?

OS: WIN 8.1 x64
PB 5.41 LTS Final - x64
LAPTOP: MSI Leopard Pro
CPU: INTEL i7
GRAPHIC CARD: NVIDIA GTX950M
RESOLUTION: HD (1920x1080)

What do I need to speed up this zoom and rotations ?

thanks,
Marc

_________________
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Wed Dec 30, 2015 10:00 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jul 29, 2012 10:33 pm
Posts: 750
Location: United States
@marc_256
If you can give some example code of your slowdowns then someone might be able to give you some ideas to help speed up your code.

marc_256 wrote:
I was thinking (i 'm not a PC guru) with a good gaming video card, that ogre will be faster to make zoom and rotations.

To a point this is true. A better card will give you better performance in areas, but the main boost comes from being able to access the newer versions of rendering API.
The problem you're finding is that PB/Ogre is still using the old DirectX and OpenGL fixed rendering pipelines.

Alexi wrote:
I noticed a huge performance improvement by switching vsync off, you can do by passing the #PB_Screen_NoSynchronization flag. That was pretty unecpected as the test scene itself was almost empty, and running on a Titan X, without vsync it was about 100 times faster, no glitches at all, so nothing what vsync justifies so far.

If you're not getting artifacts or tearing then Vsync isn't needed. Which is why most games give you the option to turn Vsync on or off.


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Wed Dec 30, 2015 10:09 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jul 29, 2012 10:33 pm
Posts: 750
Location: United States
Quick question how are you rendering those images? It almost looks like planes and if so how many planes are generated and what image resolution are you using?

If you're using planes then you could try static geometries if you haven't already.
You could also look into 3D textures with a shader (similar to how minecraft worlds are generated).


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Wed Dec 30, 2015 10:33 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 584
Location: Belgium
Alexi wrote:
What do you mean by zoom and rotations, Sprites, Images? It depends on your special case i guess. Specs of your previous system?

Don't know what you actually mean, but i noticed a huge performance improvement by switching vsync off, you can do by passing the #PB_Screen_NoSynchronization flag. That was pretty unecpected as the test scene itself was almost empty, and running on a Titan X, without vsync it was about 100 times faster, no glitches at all, so nothing what vsync justifies so far.


- No sprites, images but cloud mesh.
- I did this, and yes it works a little faster.

Samuel wrote:
Quick question how are you rendering those images? It almost looks like planes and if so how many planes are generated and what image resolution are you using?

If you're using planes then you could try static geometries if you haven't already.
You could also look into 3D textures with a shader (similar to how minecraft worlds are generated).


What I do is,
1) I convert the CT scanner 2D images to gray scale images (256 grays)
2) I store them in the data memory (+-500 images of 512x512 bits)
3) then I make a transparent 3D cloud mesh of it.
so the user can change the transparency of the pixels to see inside the body or organs.
4) the software rebuilds a 3D cloud mesh (even with i7 x64, takes some minutes to (re)build the mesh).
5) build/make a 3D mesh for OGRE
6) so we can zoom in and rotate the camera/mesh

I made some tests:
1) stable camera and move and rotate the mesh
2) stable mesh and move and rotate the camera

looks there is no difference for now ...

Maybe I 'm a dreamer, if i calculate the mesh volume ...
500 (images) x 512 (pixels in Xaxis) x 512 (pixels in Yaxis) = 131 072 000 (3D pixels)


thanks for helping me here,
marc

_________________
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Thu Dec 31, 2015 12:29 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jul 29, 2012 10:33 pm
Posts: 750
Location: United States
@marc_256
Instancing and geometry shaders would be a major help with what you're trying to do. Problem is they are not available in the current PB/Ogre package.

Do you notice any speed improvements if you don't use alpha? If Ogre is doing alpha sorting then I could see that being a major bottleneck for the rendering pipeline.


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Thu Dec 31, 2015 3:35 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jun 02, 2003 9:16 am
Posts: 2096
Location: Germany
Quote:
then I make a transparent 3D cloud mesh of it.
The question here is also: how? You could triangulate the point cloud, e.g. with (dual) marching cubes. That way the amount of fragments processed is far less. Also you could try uploading the layers themselves and just display planes with each layer as texture.

_________________
bye,
Daniel


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Thu Nov 23, 2017 4:01 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 584
Location: Belgium
hello,

For my 2D to 3D image converter, (cancer research)
I convert 2D bmp images to a 3D pixels cloud.
To do that I use a self made algorithm, written in PB.
It work very well but it need about 3...4 minutes to do the conversion. (see below)
So, will there be a significant difference in time when I rewrite my program in ASM ?
thanks,

marco


Image



Image

_________________
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Thu Nov 23, 2017 4:47 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1799
Location: Pas-de-Calais, France
For my latest experiments in huge clouds of 3d scan (topography), I've tested some tools to convert to meshes. Best ones are Autodesk Recap and CloudCompare(CC). They're pretty good for this task, having needed work force for this kind of job, pretty difficult for only one person !

Anyway, to answer about ASM optimisation, the best optimisation is always in the algorithm, the second one in reducing memory access (few variables leading to CPU using only internal registers), third in reducing global number of sequential operations (allowing parallelism, with tricks like unlooping-thinking in a way of reducing little imbricated loops-), fourth in reducing slow instructions, and so on.
All could be done in any language, ASM being useful at the core of the algorithm. Good asm coders could, by working intensively on a specific problem, find tricks going further, but it takes time and a lot of concentration.

Now, consider also that CPUs are evolving, and some well knowns slow instructions in the past are now fast, so it's better to concentrate on algorithm and the points I've given before thinking to optimisation, especially in ASM, which is harder to debug.


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Thu Nov 23, 2017 9:51 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 6095
Location: Wales, UK
Hi Marc

The Film Industry use the GPU, either OpenCL or nVidia Cuda. I think a bit of research could find you a good, much faster solution.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Fri Nov 24, 2017 11:42 am 
Offline
Enthusiast
Enthusiast

Joined: Thu May 06, 2010 10:16 am
Posts: 584
Location: Belgium
djes,

You are right, I need to check all calculate time loops in the algorithm (who is huge) one by one,
to convert the (512x512 px) x >500 images.
It is there that I want to use ASM to win some time ...

IdeasVacuum,

It is not specially the visualisation, but the algorithm calculations,
for contrast, and transparency image after image.

thanks,
marc

_________________
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Fri Nov 24, 2017 12:39 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 867
Location: Cuernavaca, Mexico
IdeasVacuum hinted that you may be able to use the GPU to assist you...

Quote from Superuser.com:
Quote:
Modern GPUs are capable of performing vector operations and floating-point arithmetic, with the latest cards capable of manipulating double-precision floating-point numbers. Frameworks such as CUDA and OpenCL enable programs to be written for GPUs, and the nature of GPUs make them most suited to highly parallelizable operations, such as in scientific computing, where a series of specialized GPU compute cards can be a viable replacement for a small compute cluster as in NVIDIA Tesla Personal Supercomputers. Consumers with modern GPUs who are experienced with Folding@home can use them to contribute with GPU clients, which can perform protein folding simulations at very high speeds and contribute more work to the project (be sure to read the FAQs first, especially those related to GPUs). GPUs can also enable better physics simulation in video games using PhysX, accelerate video encoding and decoding, and perform other compute-intensive tasks. It is these types of tasks that GPUs are most suited to performing.

_________________
- It was too lonely at the top.

Current Machine: Win 10 Pro 64-bit, Dual Xeon E5-2670, 64 gigs ram, Geforce GTX 1660 Ti w/6 gigs ram


Top
 Profile  
Reply with quote  
 Post subject: Re: 3D scanner software - new hardware question
PostPosted: Fri Nov 24, 2017 5:58 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1799
Location: Pas-de-Calais, France
PB's ogre implementation is able to handle a lot of polygons with their own mapping and allows use of realtime shaders to alter their rendering (faster than doing it in software). G-Rom and Comtois could help you for this kind of problem. To have greatest speed everything should be in graphic memory, and you should avoid swapping between main memory and graphic memory, so you have to think in terms of what is needed by the graphic card. Shaders are like billions of processors working in parallel, sure you can do miracles with all this power, if you're able to convert your algorithms to a pixel based engine.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye