Sunday, February 6, 2011

ChemDoodling: now in 3D, but not (yet) on the iPad

You need Google Chrome or Firefox 4 to view the molecule.

In a previous post I wrote "The 3D version of ChemDoodle Web Components requires something called WebGL, which is not available in standard browsers yet, but should be soon.  You can get access to it now by downloading Google Chrome (BETA)."

Now you just need Google Chrome or Firefox, i.e. if you view this post in the Google Chrome or Firefox 4 browser you should be able to interact with the molecule.  Other browsers should include WebGL soon, and when it reaches Mobile Safari, it should work on the iPad.

This means ChemDoodle Web Components is ready for use in research and education.  It's quite easy to use: see here for installation instructions and here for a simple html example.  Furthermore, "Over the next couple years, we intend to match all functionality in JMol" according to Kevin Theisen.

I note that the ChemDoodle Web Components are open source, so feel free to pitch in!


Charles Xie said...


On my Windows XP, this feels very sluggish, especially for a tiny molecule like this.

Anonymous said...

@charxie: Yes, we have had several reports of slowness in Chrome. It appears from our investigation that Chrome is having an issue with our cylinder geometry, which is used to render bonds. We are looking into improving this performance in Chrome. Definitely, we will be adding new features and making the components as efficient as possible in all browsers.

I should note that only Chrome is experiencing this problem. Beta versions of Firefox and Safari do not have these performance issues. If you can get a copy of Firefox 4 beta, come back to this page and you will see much better performance.

Charles Xie said...
This comment has been removed by the author.
Unknown said...

Works fine on Firefox 4 Beta on my Linux, but puts quite a load on my CPU when rotating or zooming. The graphics are smooth though.

Personally, I prefer the less "blingy", 2D'ish mophine molecule in ChemDoodle. :)

Jan Jensen said...

Glad to hear it. Sounds like Firefox 4 Will be released soon.

I have to say I prefer the "real 3D". Perhaps one could switch to 2D while rotating, at least for very large molecules.

Henry Rzepa said...

As noted above, the Webkit version of Safari also supports WebGL. One can find out what any browser supports here.

I note that the Apple iPad does not yet run a version of Safari which supports WebGL (and oddly, one cannot install a beta version of the browser for this platform), but it is presumably not too far away.

Jan Jensen said...

I haven't been able to find anything concrete on when one could expect WebGL in mobile Safari. That in itself is not very encouraging.

Egon Willighagen said...

JMol is an older project, competing with Jmol (, with limited functionality :)

Anyways... one of the powers of Jmol is the scripting. Can you elaborate on what scripting is currently available, and what scripting commands you'll start working on next?

Anonymous said...

@Jan - We should not let the absence of information about WebGL in Mobile Safari be discouraging. Apple has a habit of hiding feature details until the day they are released. I believe we should see WebGL on iPhones and iPads within 6 months of WebGL support in Safari.

I would also like to mention that our team is developing great new WebGL features. We will provide several new styles and rendering improvements. The next update should be in about 2 weeks.

@Egon - The ChemDoodle Web Components library is a scripting framework. Unlike JMol, which is an application, and requires scripts to be manipulated, ChemDoodle Web Components are themselves a script and can be manipulated at runtime with basic Javascript. You can do anything and everything to any component and the data it renders at anytime. I recommend you complete the tutorial here:

Also, we are not trying to compete with JMol, since as you said, it is an old technology. We are providing an open-source (GPL) HTML5 chemical graphics and cheminformatics solution for web browsers and mobile devices. As with all software projects, it will grow over time. JMol's feature set is a good first goal for functionality. After we match it, we will match functions from more complex 3D rendering tools.

If you want to follow our progress, please subscribe to the RSS feed at iChemLabs:

Anonymous said...

To update, we have discovered the source of the slow performance in Chrome. We now provide some workarounds so the ChemDoodle Web Components (version 4.2.1) perform much faster in Chrome. We have also reported this issue to the Chrome team to help them fix it:

Jan Jensen said...

Thanks Kevin, I have now updated to version 4.2.1.

Henry Rzepa said...

It was a bit of a disappointment to find that the newly released IOS 4.3 for iPad does not in fact support WebGL. Kevin has kindly given me this URL to perform this test (I had been using this one but it turns it it is mis-reporting). So we will have to wait a bit longer for iPad support.

Jan Jensen said...

Yes, as far as I know WebGL is not even turned on by default yet in the nightly builds of Webkit. Many months to wait I'm afraid.

But as Kevin pointed out, Apple loves to surprise people. So one never knows.

Anonymous said...

To add some optimistic notes, WebGL has been shown in Mobile Firefox (Fennec) since last year, and it is very much a goal for their team. WebGL is now also starting to appear in Android Browser, which is WebKit based (like Mobile Safari).

I looked into why Modernizr was giving false positives in Mobile Safari for WebGL support. Modernizr checks for the WebGLRenderingContext framework, which renders WebGL. This is opposed to the ChemDoodle Web Components, which check for WebGL support by attempting to render a WebGL scene. So what does this mean? Either, the Mobile Safari developers mistakenly forgot to remove part of this framework, or there are currently plans to provide this support.

WebGL is an HTML5 technology, and since Apple is one of the largest supporters and founders of HTML5, I do believe we will see WebGL in Mobile Safari. The anticipation will be difficult, but it will also make WebGL on iPads so much more enjoyable :).

Jan Jensen said...

OK, the Mdernizr glitch is an interesting hint that something is happening on that front.

I'll try to arm myself with patience.