{"id":19742883,"url":"https://github.com/raub/texgen-raub","last_synced_at":"2026-06-08T13:32:18.842Z","repository":{"id":143911253,"uuid":"183670644","full_name":"raub/texgen-raub","owner":"raub","description":"Seamless procedural texture generator","archived":false,"fork":false,"pushed_at":"2019-05-27T10:00:54.000Z","size":84,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-02T21:02:36.625Z","etag":null,"topics":["3d","generator","gl","graphics","javascript","js","node-3d","noise","procedural","seamless","texgen","texture","webgl"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-04-26T17:40:20.000Z","updated_at":"2025-04-08T03:53:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc9bfd66-f28a-47b5-bee3-c5da60351f06","html_url":"https://github.com/raub/texgen-raub","commit_stats":null,"previous_names":["node-3d/texgen-raub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raub/texgen-raub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raub%2Ftexgen-raub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raub%2Ftexgen-raub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raub%2Ftexgen-raub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raub%2Ftexgen-raub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raub","download_url":"https://codeload.github.com/raub/texgen-raub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raub%2Ftexgen-raub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34065349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["3d","generator","gl","graphics","javascript","js","node-3d","noise","procedural","seamless","texgen","texture","webgl"],"created_at":"2024-11-12T01:34:13.013Z","updated_at":"2026-06-08T13:32:18.824Z","avatar_url":"https://github.com/raub.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Texgen\n\nThis is a part of [Node3D](https://github.com/node-3d) project.\n\n[![NPM](https://nodei.co/npm/texgen-raub.png?compact=true)](https://www.npmjs.com/package/texgen-raub)\n\n![Build Status](https://travis-ci.com/node-3d/texgen-raub.svg?branch=master)\n\n\u003e npm i -s texgen-raub\n\nThis works only with **THREE.JS**. [Live DEMO](http://gsom.tech/texgen).\n\n\n## Synopsis\n\nMethod `THREE.generateTexture` is added.\n\nArgs:\n\n```js\n{\n\tresolution: number = 1024,\n\tuniforms   : Object = {},\n\tfragment   : string = 'void main() {gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);}',\n\tnoconsole  : bool = true,\n\tnodebug    : bool = false,\n\tmipmaps    : bool = true,\n\tfloating   : bool = false,\n\tanisotropy : number = renderer.capabilities.getMaxAnisotropy(),\n}\n```\n\n* `resolution` The size of the texture. Must be power of 2.\n* `uniforms` Passed directly into the `THREE.Material`.\n* `fragment` Fragment shader code for texture generation.\n* `noconsole` Supress three.js shader logs in console.\n* `nodebug` If threejs shader logs are omitted.\n* `mipmaps` If mipmaps are generated for the texture.\n* `floating` Generate floating-point texture (yay, heightmaps!).\n* `anisotropy` Anisotropy filtering level for the texture.\n\nReturns:\n\n```js\n{\n\ttexture : ?THREE.Texture,\n\tbuffer  : ?(Uint8Array|Float32Array),\n\terror   : ?string,\n}\n```\n\n* `texture` The resulting texture, if any.\n* `buffer` The raw texture data. The type depends on the passed `floating` flag.\n* `error` If an error has occured, it is passed here.\n\n\n---\n\nThis is a procedural texture generator. You have to provide a piece of\nfragment-shader code with at least the `main` function present.\n\nThe output is not necesserily seamless. But it is easy to achieve.\n\n\n\n## Usage\n\n```js\nconst fragment = `\nvoid main() {\n\tvec3 uv3 = getUv3(varUv);\n\tgl_FragColor = vec4(vec3(pow(noise(uv3 + 9.4) * 1.7, 10.0)), 1.0);\n}\n`;\nconst { texture } = THREE.generateTexture({ renderer, fragment });\nmaterial.map = texture;\n```\n\nThe following image is produced. Here it is easy to see the seamless edges:\n\n![Example](example.png)\n\nMore texture-like images are achieved with multiple layers of noise.\nSee [examples](examples.js) here. Also you can practice at the\n[Live DEMO](http://gsom.tech/texgen) website.\nThere you can also download your results as PNG.\n\n### GLSL API Details:\n\n* `void main() {}` Required procedure\n* `vec4 gl_FragColor` Output pixel color\n* `vec2 varUv` varying UV coords [0; 1]\n* `vec3 getUv3(vec2)` 3D seamless noise coords\n* `sampler2D _grain` convenience grain texture\n* `float noise(vec3)` coherent noise generator\n* `float getSign(float)` -1 for negative, +1 otherwise\n* `M_PI = 3.141592653`\n* `M_2PI = 2.0 * M_PI`\n* `M_PI2 = 0.5 * M_PI`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraub%2Ftexgen-raub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraub%2Ftexgen-raub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraub%2Ftexgen-raub/lists"}