I found a mistake in my calculations of the normals, now fixed, so if
you look again at my rug demo the display is significantly improved
(and the glitch on the left of the pulse is gone).
GlowScript creates a set of meshes (arrow, box, cone, curve, cylinder,
pyramid, sphere) which reside in GPU memory from which instances of
these objects get their geometry data, individualized by instance
attributes pos, color, opacity, size, axis, and up. The new thing is
that users can create their own meshes, and instances of these meshes
(and note that if you change a mesh, all the instances change
instantly). There was a question whether dynamic changes to a mesh
would have serious performance problems, since GPU memory has to be
updated. My rug example shows that performance is fine -- not a
problem. Evidently sending the update to the card isn't very
expensive.
This is in marked contrast to the slowness of readPixels to get
information from GPU -> CPU. Apparently this slowness is mainly due to
the necessity of syncing the GPUs with the CPU, not with the data
transfer itself. For example, I use false-color mouse picking where I
read just one pixel, the one under the mouse. This typically takes an
enormous tenth of a second!
Owen, you had asked whether I had run into any problems with
CoffeeScript. The answer is yes, but it has more to do with the editor
used in GlowScript than with the CoffeeScript language. We use the ACE
editor, which includes a helper thread that continually examines your
program while you're editing and places discreet little markers beside
statements that might have problems (e.g. missing parenthesis), all of
course keyed to JavaScript. Certain kinds of errors stop the helper;
it can't continue. The result is that in ACE the helper is always
stopped when editing CoffeeScript. I don't think this is trivial to
fix in ACE, and I need to look around to see if there's a good
CoffeeScript editor we could use.
Also, there is significant preprocessing of a GlowScript file from
JavaScript (created directly or converted from CoffeeScript) to
JavaScript, to permit infinite loops and vector addition and
subtraction. Scherer put in comment lines containing the original line
numbers to give in case of error, and I need to revisit that machinery
because now the "original" JavaScript might be converted from
CoffeeScript and therefore the reported line number need not be very
close to what you wrote.
Finally, there is a real CoffeeScript problem, one I'm familiar with
from Python. Whitespace is great, but sometimes indentation errors are
hard to spot and fix, especially if you have a somewhat longish
indentation. The problem is similar to the problem in non-whitespace
languages where you may have trouble seeing which set of braces
surrounds a long block of code. Even though most editors nowadays help
you match up braces, if the matching brace is outside the page being
viewed it can still be annoying.
Bruce
> --
> You received this message because you are subscribed to the Santa Fe Complex "discuss" group.
> To post to this group, send email to
dis...@sfcomplex.org
> To unsubscribe from this group, send email to
>
discuss+u...@sfcomplex.org
> For more options, visit this group at
>
http://groups.google.com/a/sfcomplex.org/group/discuss