hannulatero / titegpumath Goto Github PK
View Code? Open in Web Editor NEWUtilizing Fragment shader for general computation in GameMaker.
License: MIT License
Utilizing Fragment shader for general computation in GameMaker.
License: MIT License
======================================================== TITE GPU MATH LIBRARY Written for Cookbook jam. By Tero Hannula ======================================================== HOW TO USE 1) Create data with given size. With struct you can give optional parameters. data = new TiteData(256, 256); // Creates gpu data block with default parameters. 2) Do calculations in any of Draw-events, as this uses shaders and surfaces. You can use either method-functions, or script functions directly. data.Randomize(-16.0, +16.0); // Randomizes contents to be between -16 and +16. tite_randomize(data, -16.0, +16.0); // Does same. 3) To set values into gpu, use FromBuffer-method. data.FromBuffer(buffer); // Puts contents of buffer into data. 4) Get results from data into to used in GML, use ToBuffer-method. data.ToBuffer(buffer); // Puts contents of gpu into buffer. 5) Destroy gpu datablock when you don't use it anymore. data.Free(); // Frees the GPU data. If you still use this handle, data is recreated. ======================================================== GENERAL CONSIDERATIONS & INFO Different GPUs can have differing behaviour, and they might not support same accuracies. Calculations must happen in the GameMaker's Draw-events, because calculations are just rendering, and drawing doesn't work in other events. Operation methods will take inputs, and store results in callee. In-place operations make temporal surface, which is cleaned afterwards. - Reason for this, is that you can't use surface as both source and destination. ========================================================
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.