Today I ported the GML math functions to GLSL. Common functions like point_distance, dcos, angle_difference and even irandom. See the code here.
xordev / gml_shaders Goto Github PK
View Code? Open in Web Editor NEWGML functions brought to GLSL
GML functions brought to GLSL
Today I ported the GML math functions to GLSL. Common functions like point_distance, dcos, angle_difference and even irandom. See the code here.
All macros that do not enclose every input parameter in brackets will not work with any somewhat complex values passed to them.
Same goes for macros that use exposed operands.
There is a strict taboo on the word seed
used as a function, variable or structure name in any project that uses this module.
That's because the name seed
is already used in your module as a global variable. On top of that, there is no indication that the float variable seed
is crucial for your random system and, therefore, should not be modifiable by the user of this library. Many C libraries that do use such variable tend to name them accordingly, all-caps with leading underlines (as opposed to snake case used for local variables).
There is no reason for any of these macros to be functions, especially considering they will most likely be in-placed by the compiler.
Making them functions will also increase their performance, as their parameters will not be recalculated for every use. Speaking of recalculations, there are also cases where macros like these are unusable no matter their bracket enclosure (any impure function will break if passed as any multi-use parameter of any macro).
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.