-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vec2, vec3, vec4 support #7
Comments
I think type inference for variables for now is a good target to work towards. We can work on type inference for functions if we move on to higher order functions. |
As of now, the addFunction, allows one to overwrite the return type.
This is without the "auto-voodoo" type inference. A similar implementation can be done for the kernel creation function. Note that internally the kernal also use the FunctionBuilder.addFunction call. But has isRootKernel set to true for some conditional voodoo. Successful implementation of voodoo can jack into this. |
For now we go with this.vec2(0,1) to declare vecs bah, so that in jsland we can have a.x, a.y type syntax. I'll go with that and implement the proper objects. |
Okay let's formalize this. Let's support the following operations:
And of course, bonus would be
|
I believe this is solved, can anyone confirm? |
Fully supported now in v2 rc 13. |
Vectors are very useful for graphical computations so it would be very useful to support vec variables and function arguments and function returns.
When it's implemented it could look like:
The "this" context variable can provide the vec2 function in fallback mode just like this.thread.x and etc.
Challenges:
/*vec3*/var v = ...
which might look very ugly.The text was updated successfully, but these errors were encountered: