2
$\begingroup$

I am working on a web-based molecular visualization program for a research project (e.g., one that can display XYZ and PDB files). The current options are outdated (for instance, Jmol uses Java). My advisor uses MDL Chime but almost no browser supports that plugin nowadays.

My idea has been to use modern web tools so the visualization program is future-proof for a while. I'm using WebGL through Three.js and it seems to be working pretty well.

However, I'm already running up against some performance bottlenecks. I need to be able to display systems of 500,000 to 2,000,000 atoms in realtime (60 fps). These systems should be rotatable/zoomable/etc.

The entire system is fed into WebGL as one geometry using a BufferGeometry.

500,000 atoms * 24 triangles per sphere * 60 = 720 million triangles per second

My MBP-retina (GT 650m) chokes on this, so I have no doubt most people's computer would do the same.

However, the MDL Chime program I mentioned before renders this scene fine on my advisor's 10 year old laptop without using the GPU. What kind of trick could it be using to achieve this performance? The spheres don't look low-quality; there's no way it could be rendering that many triangles per second, right?

$\endgroup$
6
  • 2
    $\begingroup$ I assume you've already seen these best practice? In my opinion, WebGL isn't really ready for prime time yet due to performance issues. Also the idea of real-time 3D graphics in an interpreted language is somewhat laughable. $\endgroup$
    – Victor Liu
    Sep 13, 2013 at 19:14
  • 1
    $\begingroup$ The 3D part isn't Javascript, and also Javascript isn't really considered an interpreted language anymore with the recent JIT improvements in V8/IonMonkey. $\endgroup$
    – Nick
    Sep 13, 2013 at 19:39
  • 1
    $\begingroup$ that webgl best practices list looks good, but yeah I wouldn't laugh at javascript or assume I could write even assembly language that runs faster than modern javascript engines, especially if it has access to gpu api $\endgroup$
    – k20
    Sep 13, 2013 at 19:57
  • $\begingroup$ I maybe looking naive here but MDL Chime maybe cutting the scene and drawing just what can be seen... the number of triangles u mention doesn't seam to be a problem to a GPU stackoverflow.com/questions/16639931/… probably u'll find better answer in stackoverflow $\endgroup$
    – imbr
    Oct 22, 2013 at 3:06
  • $\begingroup$ try a look at stackoverflow.com/questions/tagged/webgl too $\endgroup$
    – imbr
    Oct 22, 2013 at 3:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.