Skip to content

YVin3D/Loki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loki: Random Number Generator for Metal


How to Use:

1 - Add the Loki folder to your Xcode Project

2 - Include the header in your Metal shader using something like: #import "../Loki/loki_header.metal"

3 - In your shader, initialize a Loki() object with (up to) 3 unsigned int seeds. ** It is recommended to use values that are unique to each thread such as pixel position.

4 - Call .rand() on your Loki object as many times as you would like.

Sample Project:

The attached sample project simply creates a scene filled with random grey values generated using Loki. They change every frame using an iteration counter that is incremented each frame. It should look something like this:

About

A Random Number Generator for Metal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published