{"id":13525756,"url":"https://github.com/Xrayez/godot-anl","last_synced_at":"2025-04-01T05:32:24.146Z","repository":{"id":49832751,"uuid":"102379264","full_name":"Xrayez/godot-anl","owner":"Xrayez","description":"Accidental Noise Library in Godot Engine enhanced with visual noise editor","archived":false,"fork":false,"pushed_at":"2022-08-05T05:11:35.000Z","size":1336,"stargazers_count":111,"open_issues_count":1,"forks_count":5,"subscribers_count":8,"default_branch":"gd3","last_synced_at":"2024-10-30T00:16:06.642Z","etag":null,"topics":["accidental-noise-library","bumpmap","godot-module","godotengine","gradient-noise","normalmap","simplex-noise","value-noise"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Xrayez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-04T16:06:21.000Z","updated_at":"2024-10-17T20:28:40.000Z","dependencies_parsed_at":"2022-08-28T21:00:45.424Z","dependency_job_id":null,"html_url":"https://github.com/Xrayez/godot-anl","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xrayez%2Fgodot-anl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xrayez%2Fgodot-anl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xrayez%2Fgodot-anl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xrayez%2Fgodot-anl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xrayez","download_url":"https://codeload.github.com/Xrayez/godot-anl/tar.gz/refs/heads/gd3","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222703721,"owners_count":17025838,"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":["accidental-noise-library","bumpmap","godot-module","godotengine","gradient-noise","normalmap","simplex-noise","value-noise"],"created_at":"2024-08-01T06:01:21.786Z","updated_at":"2024-11-02T10:31:06.789Z","avatar_url":"https://github.com/Xrayez.png","language":"C++","funding_links":[],"categories":["Modules"],"sub_categories":["3D"],"readme":"# Accidental Noise Library in Godot Engine\n\n![🐧 Linux](https://github.com/Xrayez/godot-anl/workflows/%F0%9F%90%A7%20Linux/badge.svg)\n![🍎 macOS](https://github.com/Xrayez/godot-anl/workflows/%F0%9F%8D%8E%20macOS/badge.svg)\n![🎨 Windows](https://github.com/Xrayez/godot-anl/workflows/%F0%9F%8E%A8%20Windows/badge.svg)\n![🤖 Android](https://github.com/Xrayez/godot-anl/workflows/%F0%9F%A4%96%20Android/badge.svg)\n![🍏 iOS](https://github.com/Xrayez/godot-anl/workflows/%F0%9F%8D%8F%20iOS/badge.svg)\n![🌐 JavaScript](https://github.com/Xrayez/godot-anl/workflows/%F0%9F%8C%90%20JavaScript/badge.svg)\n\nThis is a wrapper for the\n[Accidental Noise Library](https://github.com/JTippetts/accidental-noise-library)\noriginally written by\n[Joshua Tippetts](https://sourceforge.net/u/tippettsj/profile/), modified\nto be properly compiled for [Godot Engine](https://github.com/godotengine/godot)\nand be used freely in both GDScript and C#.\n\nThe master branch aims to be in sync with Godot's master branch. Checkout other\nbranches and/or releases for compatible versions. You can decide which version \nyou need based on the following compatibility table:\n\n### Compatibility table (ANL/Godot)\n\n|     | 3.0 | 3.1 | 3.2 | 4.0 |\n| --: |:---:|:---:|:---:|:---:|\n| 1.0 |  👍 |  👎 |  👎 | 👎  |\n| 2.0 |  👎 |  👍 |  👎 | 👎  |\n| 2.1 |  👎 |  👍 |  👍 | 🤞  |\n| 2.2 |  👎 |  ❓ |  ❓  | 🤞  |\n\n*Note: the latests versions may not be released yet and are kept for reference,\nbut expect them to be compatible.*\n\n## Notable features:\n\n* generate height, normal and bump maps from noise directly;\n* ability to construct noise from visual nodes in editor and via code;\n* make custom modular noise as components from base nodes.\n\n![Visual Accidental Noise Workbench](examples/images/visual_noise.png)\n![Visual Accidental Noise Normalmap](examples/images/visual_noise_normalmap.png)\n\nSee [wiki](https://github.com/Xrayez/godot-anl/wiki#visual-noise) on how to get started\ncreating noise with visual nodes.\n\n## Overview\n\nThe AccidentalNoise class encapsulates the two main classes required for noise\ngeneration: `CKernel` and `CNoiseExecutor`.\n\nThe kernel holds any amount of noise functions together creating compound noise\nfunction. The noise executor then evaluates the function chain at any point of\nthe pipeline.\n\nThe library is full of features compared to other noise generation libraries with\na drawback of poorer performance.\n\n## Compiling\n\nIf you'd like to try out or develop the module:\n\n```bash\ngit clone https://github.com/Xrayez/godot-anl anl\nscons\n```\n\nNote that `scons` will clone Godot Engine repository and compile the engine with\nthe module for you. Make sure that the module's directory name is exactly\n`anl`. Once the compilation is done, the resulting binaries should be available\nunder `godot/bin` directory.\n\nIf you'd like to compile the module the traditional way, please refer to\n[Godot Engine: Compiling](https://docs.godotengine.org/en/latest/development/compiling/)\ndocumentation.\n\n## Configuring the build\n\n### Extending the noise period\n\nNoise functions will have a period of 256; with coordinates higher than that,\nthe patterns will repeat. If a larger period is required, build with \n`anl_use_expressions_camelcase` command line option to use a long-period hash \ninstead in exchange for a slight decrease in performance:\n\n```bash\nscons anl_use_long_period=yes\n```\n\n### Expression naming convention\n\nThe original library uses `camelCase` to parse function tokens in an expression,\nyet the module uses `snake_case` to confirm to Godot's naming convention. If you\nstill want to use `camelCase` style, build with `anl_use_expressions_camelcase`\ncommand line option:\n\n```bash\nscons anl_use_expressions_camelcase=yes\n```\n\n# Usage examples\n\n## GDScript\n\n### Generating 2D landscape:\n\nSee [landscape.gd](examples/landscape_2d/landscape.gd).\n\n### Result\n![Simple 2D terrain](examples/landscape_2d/landscape.png)\n\nYou can also map the noise to an image with dedicated method instead to simplify\nthe above example:\n```gdscript\nimage = noise.get_image(width, height)\n```\n... or even tiled texture!\n```gdscript\nnoise.mode = AccidentalNoise.SEAMLESS_XY\ntexture = noise.get_texture(width, height)\n```\n\nExpression builder can be used to simplify the process of chaining\nfunctions together to one-liners:\n\n```gdscript\nvar n = AccidentalNoise.new()\n\nvar expression = \"translate(select(0, 1, (x + y), 0.5, 0), 10)\"\nvar function = noise.evaluate(expression)\nvar value = noise.color_2d(x, y, function)\n```\n\nBut please note that the expression builder feature is a work in progress as\nstated by original author. Some functions work, some don't and might crash the\nengine.\n\n## C#\n\nSee demo project: [AnlTest.cs](examples/mono/AnlTest.cs).\n\n```csharp\nusing Godot;\nusing System;\n\npublic class AnlTest : Godot.Node2D\n{\n\tpublic override void _Ready()\n\t{\n\t\tAccidentalNoise an = new Godot.AccidentalNoise();\n\t\tAccidentalNoise.InterpolationTypes interp = AccidentalNoise.InterpolationTypes.Linear;\n\t\tint seed = 37;\n\t\tan.Function = an.GradientBasis(an.Constant((double)interp), an.Constant(seed));\n\t\tan.Function = an.Scale(an.Function, an.Constant(5.0));\n\t\tan.Mode = AccidentalNoise.MappingModes.Xy;\n\t\tImageTexture noise = an.GetTexture(128, 128) as ImageTexture;\n\t\tGetNode\u003cTextureRect\u003e(\"Noise\").Texture = noise;\n\t}\n}\n```\n\n## Programmable noise\n\nIt's possible to modify noise parameters via special noise variables which are\nlike `constant()` but can be set and retrieved by name.\n\nSee [random_noise.gd](examples/programmable_noise/random_noise.gd).\n\n### Result\n![Before](examples/images/programmable_noise_before.png)\n![After](examples/images/programmable_noise_after.png)\n\n\n## Other examples\n\u003cdetails\u003e\u003csummary\u003eTexture synthesis\u003c/summary\u003e\n\u003cp\u003e\n\n![Water or Smoke?](examples/images/water_smoke.png)\n![Stones with moss?](examples/images/stone_moss.png)\n![Lapis lazuli?](examples/images/stone_lapis.png)\n\n\u003c/p\u003e\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXrayez%2Fgodot-anl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FXrayez%2Fgodot-anl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FXrayez%2Fgodot-anl/lists"}