{"id":15195624,"url":"https://github.com/athkdev/minecraft","last_synced_at":"2025-07-01T08:34:51.746Z","repository":{"id":253189178,"uuid":"842714932","full_name":"athkdev/minecraft","owner":"athkdev","description":"minecraft procedural generating implemented with three.js","archived":false,"fork":false,"pushed_at":"2025-05-24T00:13:35.000Z","size":2493,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-24T01:20:40.022Z","etag":null,"topics":["minecraft","procedural-terrain","threejs","typescript"],"latest_commit_sha":null,"homepage":"https://minecraft.athk.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/athkdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-14T23:49:36.000Z","updated_at":"2025-05-24T00:13:39.000Z","dependencies_parsed_at":"2025-01-31T22:39:48.252Z","dependency_job_id":null,"html_url":"https://github.com/athkdev/minecraft","commit_stats":null,"previous_names":["atharvakamble/minecraft","athkdev/minecraft"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/athkdev/minecraft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athkdev%2Fminecraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athkdev%2Fminecraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athkdev%2Fminecraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athkdev%2Fminecraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/athkdev","download_url":"https://codeload.github.com/athkdev/minecraft/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/athkdev%2Fminecraft/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262928545,"owners_count":23386169,"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":["minecraft","procedural-terrain","threejs","typescript"],"created_at":"2024-09-27T23:42:40.713Z","updated_at":"2025-07-01T08:34:51.735Z","avatar_url":"https://github.com/athkdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Minecraft in the browser with `three.js`\n\nThis is a small weekend project I put together because I wanted to learn `three.js`. The terrain is procedurally generated using [Perlin Noise](https://en.wikipedia.org/wiki/Perlin_noise#:~:text=Perlin%20noise%20is%20a%20procedural,details%20are%20the%20same%20size.). \n\nView the project live [minecraft.athk.dev](https://minecraft.athk.dev/)\n\n\n\n\nhttps://github.com/user-attachments/assets/4b5df915-d2a7-4fe1-b748-a39a14f77ba7\n\n\n\n\n#### Optimization\nCurrently the grid is $300 * 300 * 10$ (length, width, height). The height is calculated using the function `perlin2(x, y)` where `(x, y)` is the row and column at that point.\n\nThat's a LOT of blocks (a max of $9 * 10^5$ blocks) - which gets pretty compute heavy to render. To tackle that there are some techniques available like [frustum culling](https://learnopengl.com/Guest-Articles/2021/Scene/Frustum-Culling), [occlusion culling](https://docs.godotengine.org/en/stable/tutorials/3d/occlusion_culling.html), and [geometric merging](https://medium.com/acrossthegalaxy/unity-tip-combine-meshes-for-performance-and-organization-c3515c844fdb).\n\n- Frustum culling: it's the process of not rendering meshes/objects which are outside of the camera frustum. This is already done by `three.js` so you don't have to manually implement it.\n\n- Occlusion culling: it's the process of not rendering meshes/objects which are hidden to the camera by *other objects*. This is *not* implemented by `three.js`, so you have to implement it manually. NOTE: we haven't done this yet - so there's room for improvement.\n\n- Geometric merging: it's the process of merging multiple similar meshes/objects that share a similar geometry and materials, into a single large mesh. This helps increase performance because the number of vertices to process declines significantly. In our scenario, there are at a maximum of $3 * 10^5$ blocks which share the same geometry and materials, so we merge all of them to get one large mesh (our chunk). This is also not done by `three.js`, we have to manually implement merging.\n\n\n\n#### Future ideas\n\nSince we have a basic procedural chunk renderer with textures setup, it would be fun to move toward applying [three.js shaders](https://threejs.org/docs/#api/en/materials/ShaderMaterial) to the render. If you have any suggestions or contributions, feel free to open an issue or a PR - I would be more than happy to go over them.\n\n\n\n#### Acknowledgements\n\nThe textures are [Vanilla PBR](https://www.curseforge.com/minecraft/texture-packs/vanilla-pbr) minecraft textures from [curseforge.com](https://curseforge.com/).\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathkdev%2Fminecraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fathkdev%2Fminecraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fathkdev%2Fminecraft/lists"}