
Show HN: Speck, a WebGL molecule renderer - wwwtyro
https://github.com/wwwtyro/speck
======
bananicorn
First off, this looks amazing.

Sorry if this is a stupid question, but what does this mean: "Speck renders
atoms and bonds not with polygons, but with imposters. This means you can zoom
in as close as you like and surfaces remain smooth, not faceted."

I've only ever heard of imposters as bitmaps or simpler models, replacing the
original 3d models at a distance. But I guess this is something entirely
different... Could you point me in the right direction on this topic?

~~~
wwwtyro
Sure! Here's a tutorial using a square:
[https://paroj.github.io/gltut/Illumination/Tutorial%2013.htm...](https://paroj.github.io/gltut/Illumination/Tutorial%2013.html)

In my implementation, I render a cube and discard any pixels that aren't along
a ray intersecting the sphere, while the rest are colored according to user
settings and atom colors. The same approach is taken with the cylindrical
bonds, except of course it's a ray-cylinder intersection instead.

~~~
bananicorn
Wow, thank you! Honestly, I don't understand half of it right now, but hey -
now I've got something new to learn.

Really thank you very much :)

------
wwwtyro
Author here. You can try it live at
[http://wwwtyro.github.io/speck/](http://wwwtyro.github.io/speck/)

------
jaflo
I'm getting an error:

    
    
      Line #16628: Uncaught Extension EXT_frag_depth not available.
    

I'm using Chrome 54.0.2840.101 (64-bit) on Linux, WebGL: Hardware accelerated,
OpenGL ES 3.1 Mesa 12.1.0-devel (git-b010fa8).

------
anilgulecha
Nothing more to say than this: It's beautiful :)

Not sure what the use-case for this would be..perhaps have a library of models
for use in education, or show chemical reactions and how a compound is formed.

~~~
wwwtyro
Thanks :)

My primary purpose for writing it was for the production of journal article
figures.

~~~
anilgulecha
That's actually not a bad idea. You could spend some time to generate good
images of various compounds and put them up on stock photo sites. Good use
case.

~~~
wwwtyro
That's... that's a really good idea. :)

