cscheid / lux Goto Github PK
View Code? Open in Web Editor NEWLux is an EDSL for WebGL graphics and shading
License: Eclipse Public License 1.0
Lux is an EDSL for WebGL graphics and shading
License: Eclipse Public License 1.0
Should review the code so that only a minimal number of global objects are exposed. Ideally, only Lux
and Shade
should exist. (I could put Shade
inside Lux
, but I think a lot of code would look bad. The same goes for vec*
and mat*
)
Uncaught TypeError: Object # has no method 'indexOf' lux.js:16909
Looks like the remove function is treating scene as an array instead of an object. I was going to send a pull request, but I don't see a list of actors anywhere.
I'd love to see the graphing calculator working!
I've been bitten by typing Shade(x, y, z)
instead of Shade.vec(x, y, z)
. We should either check for multiple parameters or actually just call Shade.vec()
in case we get more than one parameter.
We get literals like "NaN.0" which are nonsense.
Doesn't work because ctx.parameters.width stores width in virtual pixels (or whatever the name is), not device pixels.
I bought the kool-aid, might as well drink it.
Since Javascript is dynamically checked, if a user passes a bad value into a function, the error might only manifest itself much further down the code. Tracking this error down is a slow and opaque problem: the error message will typically come from the innards of Facet, which will confuse users that are not intimately familiar with the library (at present, anyone but me).
The easy way to solve this problem is to add a strict layer of type-checking into every function. This works, but carries a runtime penalty, and good code pays the cost of debugging over and over again. This is not a problem if the API call is not on the application hot path, but some calls are unavoidable: anything that happens per-frame on WebGL should be considered on the hotpath, since spare cycles can be used for more features.
The easy way to solve this problem is to add a strict layer of type-checking into every function. This works, but carries a runtime penalty, and good code pays the cost of debugging over and over again. This is not a problem if the API call is not on the application hot path, but some calls are unavoidable: anything that happens per-frame on WebGL should be considered on the hotpath, since spare cycles can be used for more features. The canonical example of this type of thing is in https://github.com/cscheid/facet/blob/master/src/shade/parameter.js .
I'm leaning towards creating two sets of methods, the slow, type-checked method, and the fast, non-type-checked version.
But what's the best way to expose this in an API? Is it even hopeful to do something like this robustly and effectively?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.