Giter Site home page Giter Site logo

titegpumath's Introduction

========================================================

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.



========================================================

titegpumath's People

Contributors

hannulatero avatar

Stargazers

parchii avatar cupofc0t avatar  avatar Per Johansson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.