![]() The approved dependencies are currently the following:Ĭanvas element provided by template (#babylon-canvas)Īdditional libraries may be added at moderator discretion, but the rule is only one external library per project. # Limited DependenciesĮach project can have zero or one library dependency. Now you have the basics here are some general principles you need to consider when making your art. Math.random is derived from the computer's clock, so there is no guarantee you will get the same output on different computing environments in the future. All the attributes of your piece should be derived from that token so that user will be able to render their piece and get the same results each time. When users mint each piece, they are creating a hash token on the blockchain. Great for getting a random color from a discrete color paletteĮvery time one of these functions is called, random_dec() will also be called somewhere in the stack, applying the deterministic arithmetic to the seed and returning a new random number. R.random_choice() // Random choice from a given list. R.random_bool(0.5) // Random boolean with probability 0.5 We can get an instance of the Random class like so: Artists may also add their own convenience methods, but all randomness should be originally sourced from the random_dec() function. The convenience methods random_num, random_int, random_bool, and random_choice may be removed if not needed for a specific project. Note that the class uses the prng algorithm sfc32, which was designed and coded by Chris Doty-Humphry and is public domain. random boolean with p as percent liklihood of true Return Math.floor(this.random_num(a, b + 1)) requires a < b for proper probability distribution random integer between a (inclusive) and b (inclusive) random number between a (inclusive) and b (exclusive) random number between 0 (inclusive) and 1 (exclusive) seed prngB with second half of tokenData.hash ![]() seed prngA with first half of tokenData.hash Let b = parseInt(uint128Hex.substring(8, 16), 16) Let a = parseInt(uint128Hex.substring(0, 8), 16) Each character (0-9, a-f) represents a value from 0-15 and each pair of characters ("aa", or "f2") represents a value from 0-255. These variables, in turn, control the way the output looks and operates.Įach "seed", also known as a "hash string" is a hexadecimal string generated in a pseudo-random manner at the time the token is minted. ![]() When a user wants to purchase an iteration of a project hosted on the platform, they purchase an ERC721 compliant "non-fungible" token, also stored on the Ethereum blockchain, containing a provably unique "seed" which controls variables in the generative script. A generative script (using p5js for example) is stored immutably on the Ethereum blockchain for each project. The Art Blocks platform hosts generative projects for the production of verifiably deterministic outputs. To closely replicate this environment on your end while developing, we recommend using Chrome and turning off "Use Hardware Acceleration" in Settings. This means GPU intensive projects will render slower and may require code optimization and performance improvements from the artist. ![]() Headless Chromium requires the use of SwiftShader, a CPU implementation of the GPU API. To generate these, Art Blocks currently uses compute instances running headless Chromium with Puppeteer. Specifically, static images are rendered for all projects (used as thumbnails, on other platforms, etc.). Artists will likely need to tweak/optimize their project code to get it working in the Art Blocks environment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |