Skip to content

Avogadro Transparent Rendering and Engine Updates

When I initially implemented the transparent VdW engine for Avogadro I had the problem that any rendering of transparent objects must be done after the internal opaque objects have been rendered. So at the time I just implemented a ball and stick engine inside the VdW engine that was basically a copy of the ball and stick engine. I also mentioned that if we could set render order that would allow me to use any other engine if there was a way to ensure this engine was called after the others. The need for this had already been mentioned with respect to label rendering too.

Avogadro rendering of a functionalised C60 molecule using a transparent VdW engine with a stick backbone

Yesterday we discussed the engine rendering order needs on IRC and hashed out some ideas. Then my IRC connection went crazy (I think it was Freenode or the server I was connected to at least). Donald made some commits late last night (my time at least) and implemented flags for the engines to declare their roles and their transparency depth to order within particular roles. We now have a renderOpaque and renderTransparent function in each engine which should improve transparency rendering when combined with the rendering order enhancements.

The above image shows a rendered functionalised C60 molecule (one I worked with during my PhD research) using the transparent VdW engine with the stick engine rendering its backbone. It has allowed me to simplify the VdW engine whilst making it far more powerful as it can now use the ball and sick, stick or wire frame engine to render the structure inside the VdW surface. As we add more engines they can also be used with no further modification to this engine.

I am really pleased with the result and this particular visualisation shows the structure of the molecule very well. Lots more to do but I thought it would be nice to show how this display engine had progressed. Back to coding now - next challenge is getting to grips with threads!

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

Benoit Jacob on :

Benoit JacobNice to see how quickly you transformed the outcome of our IRC discussion into actual code!

Marcus D. Hanwell on :

Marcus D. HanwellThanks - hope you liked the rendered molecule. I thought it would be nice to throw a new one in that looked great with the stick backbone.

Benoit Jacob on :

Benoit JacobI like it very much; one remark: the labels are colored by the transparent red spheres, thus appearing pale red. Shouldn't they remain white ? I think that's a rendering-order issue.

Marcus D. Hanwell on :

Marcus D. HanwellI think it may be rendering order - I will look into it later if you don't beat me to it.

Troy Unrau on :

Troy UnrauThis looks really cool. I am wondering, while pretty much every stand-alone molecule can be modelled using this system - do you folks have a way to show crystal lattices? (repeating molecular structure?) It would be really useful for my mineralogy :-)

Marcus D. Hanwell on :

Marcus D. HanwellAs it happens we do :-) It is not fully implemented yet, it can display existing crystal files but we don't yet have a crystal builder implemented. It is something that should get done over the summer although I am not sure exactly when that might be.

Benoit Jacob on :

Benoit JacobYes, Geoff (cofounder of avogadro and OpenBabel maintainer) is working on it and it already works pretty nicely. There are plans to eventually expose that functionality in Kalzium too.

Kassie Trenton on :

Kassie TrentonYes it is cool & I think if you look on http://www.badspace.com you might find something that might be useful to you .

Jos on :

JosWill you be able to show volumetric views of the electrons?

Jospoortvliet on :

JospoortvlietYeah, just ask 'em more, ej... Why not ;-)

Lovely work, Marcus... I can only hope you enjoy working on this as much as many of us like to see the results ;-)

Marcus D. Hanwell on :

Marcus D. HanwellI some times feel a little bad as Google/KDE gave me the opportunity to work on my dream project for the summer - and they are even paying me to do it! I look forward to working on Avogadro and the Kalzium 3D stuff. I am also really pleased that I have been given the opportunity to be part of creating such a useful tool for the community.

Glad you like the snapshots I have been providing of my progress. It is great to receive feedback on what I am doing. If it doesn't get done over the summer I will still be working on this project in my spare time once the Google Summer of Code (TM) is over :-)

Marcus D. Hanwell on :

Marcus D. HanwellI am not sure if I know what you mean. We are planning on adding further visualisation engines, a big addition will be surface meshes so that we could render visualisations of the electronic surface of the molecule among other things.

Avogadro is very modular, each visualisation is a self contained engine loaded as a plugin at runtime making Avogadro very easy to extend. It is the same for tools and extensions. I am certainly open to suggestions of what people feel would be most useful.

Geoff Hutchison on :

Geoff HutchisonAs Marcus and Benoit mention, you can view crystal cells from pre-existing data files.

You can also already draw a freehand crystal and add crystallographic unit cell data to the record. That much was easy. You can also alter unit cell information (e.g., change a, b, c, alpha, beta, gamma) if you wish.

As Marcus mentioned, we don't yet have a builder to add atoms at specific unit cell coordinates. It's a goal -- but I'm not sure when I'll have time to do it this summer. (It's not part of Marcus's SoC proposal and he'll have his hands full with other things.)

Anonymous on :

amazing!

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA 1CAPTCHA 2CAPTCHA 3CAPTCHA 4CAPTCHA 5


You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.