{"id":26623834,"url":"https://github.com/samiperttu/funutd","last_synced_at":"2025-04-09T15:04:51.348Z","repository":{"id":40581180,"uuid":"483036072","full_name":"SamiPerttu/funutd","owner":"SamiPerttu","description":"Procedural texture library","archived":false,"fork":false,"pushed_at":"2024-06-13T20:23:51.000Z","size":7267,"stargazers_count":91,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T15:04:47.318Z","etag":null,"topics":["graphics","procedural-generation","texture"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamiPerttu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-19T00:07:22.000Z","updated_at":"2025-03-05T18:37:19.000Z","dependencies_parsed_at":"2024-01-01T23:19:35.402Z","dependency_job_id":"95ab690f-8aed-4dd1-957d-e7defbe3599e","html_url":"https://github.com/SamiPerttu/funutd","commit_stats":{"total_commits":120,"total_committers":1,"mean_commits":120.0,"dds":0.0,"last_synced_commit":"75408539da78875309b08334825d490785a75dc3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiPerttu%2Ffunutd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiPerttu%2Ffunutd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiPerttu%2Ffunutd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamiPerttu%2Ffunutd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamiPerttu","download_url":"https://codeload.github.com/SamiPerttu/funutd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphics","procedural-generation","texture"],"created_at":"2025-03-24T10:19:02.977Z","updated_at":"2025-04-09T15:04:51.320Z","avatar_url":"https://github.com/SamiPerttu.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FunUTD\n\n[![crates.io](https://img.shields.io/crates/v/funutd.svg)](https://crates.io/crates/funutd)\n[![License](https://img.shields.io/crates/l/funutd.svg)](https://github.com/SamiPerttu/funutd/README.md)\n\n## Fun Universal Texture Definitions\n\nFunUTD is a 3-D [procedural texture](https://en.wikipedia.org/wiki/Procedural_texture) library running on the CPU.\nThis is an alpha version undergoing rapid development and may contain rough edges.\n\n### Features\n\n* Different tiling modes, including tiling of all 3 dimensions\n* An endless supply of procedurally generated, self-describing volumetric textures\n* Isotropic value noise, isotropic gradient noise and Voronoi bases\n* Palette generation with Okhsv and Okhsl color spaces\n* Interactive texture explorer (in the example `editor`)\n* `no_std` support (enable by disabling the `std` feature)\n\n## Basics\n\nThe type returned by texture generators is `Box\u003cdyn Texture\u003e`.\n`Texture` is the trait implemented by procedural textures.\n\nThe basic operation is querying the value of a texture at a point in 3-D space\nwith the `at` method. The value is another 3-D vector.\n\nThe canonical range of texture values is -1...1 in each component.\nThis applies to the palette component as well.\n\nSome components may slightly exceed the range, while others may come under.\nMany unary nodes such as `reflect`, `vreflect`, `saturate` and `overdrive` remap\nany range back to -1...1.\n\nData for procedural generation is contained in `Dna` objects, which contain\nthe necessary context that is threaded through the generation process.\nGenerator functions draw whatever data they need from the supplied `Dna` object.\n\nTextures can describe themself, that is, print the code that generates them.\nThis is done using the `get_code` method. Obtained codes can be copied and\npasted around and subjected to further scrutiny.\n\n### Tiling Modes\n\nTiling modes - whether the texture loops seamlessly for each dimension -\nare implemented via a hasher parameter.\n\nCurrently implemented tiling modes are:\n\n- `tile_none()` - none of the axes tile.\n- `tile_all()` - space is filled with copies of the unit cube and texture\nfrequencies are rounded to the nearest whole number.\n- `tile_xy()` - for each fixed `z`, the `xy` plane is filled with copies\nof the unit square, while moving in the `z` dimension produces infinite variation.\nTexture frequencies are rounded to the nearest whole number.\n- `tile_z()` - moving in the `xy` plane produces infinite variation,\nwith the texture repeating at integer intervals along the `z` axis only.\nTexture frequencies are rounded to the nearest whole number.\n\nTo tile a different shape than the unit cube or square:\n\n- `tile_all_in(x, y, z)` - space is filled with copies of `(x, y, z)` sized boxes.\nTexture frequencies are rounded to the nearest whole number.\n- `tile_xy_in(x, y)` - for each fixed `z`, the `xy` plane is filled with copies\nof `(x, y)` sized rectangles, while moving in the `z` dimension produces infinite\nvariation. Texture frequencies are rounded to the nearest whole number.\n- `tile_z_in(z)` - moving in the `xy` plane produces infinite variation,\nwith the texture repeating at intervals of `z` along the `z` axis only.\nTexture frequencies are rounded to the nearest whole number.\n\n## Future\n\n`Dna` objects can be mutated or crossed over to create variations of genotypes\nor to optimize a texture for a purpose.\n\n## Texture Explorer\n\nThe texture explorer, which is a work in progress,\ncan be found under the example `editor`.\n\nIt supports an explorative workflow: click on one of the small images,\nand the other images become its mutations.\n\nThe code of the currently selected texture is shown below the large image.\nYou can copy the code to clipboard by clicking \"Copy Code\".\n\nCodes can be pasted in source code directly. It is just required to\nimport the prelude to the paste site (`use funutd::prelude::*;`).\n\nThe tree shaped parameters are shown on the right side of the screen,\nwhere they can be edited as well.\n\n### Mutation Modes\n\nThe mutation mode determines how mutations are made:\n\n- Any: parameters are changed arbitrarily.\n- Finetune: only non-structural parameters are changed.\n\n![](editor_gui.jpg \"explorer GUI\")\n\n---\n\n## Examples\n\nThese examples are from an earlier version of FunUTD.\n\n```rust\npalette(\n    Space::HSL,\n    0.160739,\n    0.401973,\n    0.250040,\n    0.234684,\n    displace(\n        0.10390177,\n        layer(\n            2.4686515,\n            layer(\n                3.0395193,\n                noise(4077839245, 11.842703, tile_all()),\n                vnoise(1246086663, 12.16001, Ease::Smooth5, tile_all()),\n            ),\n            rotate(\n                9.744911,\n                vnoise(3984989388, 8.905142, Ease::Smooth5, tile_all()),\n                vnoise(168447214, 5.8911786, Ease::Smooth5, tile_all()),\n            ),\n        ),\n        reflect(\n            1.884496,\n            vec3(0.5632216, -0.31983083, -0.7500508),\n            fractal(\n                7.6917915,\n                5,\n                0.50210387,\n                2.4051504,\n                0.0,\n                2.0523214,\n                worley_basis(3902470283, tile_all(), 7, 10, 17),\n            ),\n        ),\n    ),\n)\n```\n\n![](example1.png \"texture example\")\n\n---\n\n```rust\npalette(\n    Space::HSL,\n    0.550072,\n    0.228674,\n    0.165266,\n    0.317444,\n    saturate(\n        8.597511,\n        fractal(\n            5.8026867,\n            4,\n            0.5642442,\n            2.114186,\n            0.07022904,\n            1.0159429,\n            displace(\n                0.15992701,\n                voronoi_basis(1401237949, tile_all(), 10, 25, 7),\n                worley_basis(785949362, tile_all(), 0, 22, 14),\n            ),\n        ),\n    ),\n)\n```\n\n![](example2.png \"texture example\")\n\n---\n\n## License\n\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version 2.0\u003c/a\u003e\nor \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in FunUTD by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamiperttu%2Ffunutd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamiperttu%2Ffunutd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamiperttu%2Ffunutd/lists"}