{"id":13821574,"url":"https://github.com/vram-guild/canvas","last_synced_at":"2025-05-16T12:33:53.006Z","repository":{"id":37921017,"uuid":"172166782","full_name":"vram-guild/canvas","owner":"vram-guild","description":"Shader-Based Minecraft Renderer for Fabric","archived":false,"fork":false,"pushed_at":"2024-06-06T15:49:31.000Z","size":9083,"stargazers_count":424,"open_issues_count":85,"forks_count":40,"subscribers_count":15,"default_branch":"1.19","last_synced_at":"2024-11-19T21:36:11.961Z","etag":null,"topics":["minecraft","shaders"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vram-guild.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-02-23T03:30:14.000Z","updated_at":"2024-11-12T06:15:15.000Z","dependencies_parsed_at":"2023-12-28T07:44:09.857Z","dependency_job_id":"b17af70e-8436-46ff-b262-de0caa363acc","html_url":"https://github.com/vram-guild/canvas","commit_stats":null,"previous_names":[],"tags_count":321,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vram-guild%2Fcanvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vram-guild%2Fcanvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vram-guild%2Fcanvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vram-guild%2Fcanvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vram-guild","download_url":"https://codeload.github.com/vram-guild/canvas/tar.gz/refs/heads/1.19","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254530860,"owners_count":22086686,"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","shaders"],"created_at":"2024-08-04T08:01:24.122Z","updated_at":"2025-05-16T12:33:51.029Z","avatar_url":"https://github.com/vram-guild.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# Canvas\nCanvas is a shader-based Renderer for the [Fabric](https://fabricmc.net) modding toolchain.  It supports all features of the proposed [Fabric Rendering API](https://github.com/FabricMC/fabric/pull/65) plus extensions defined in [FREX](https://github.com/grondag/frex).\n\nDiscord: https://discord.gg/7NaqR2e\nCurse: https://www.curseforge.com/minecraft/mc-mods/canvas-renderer\n\n## License\nExcept as noted in individual source files, all code in this mod, include shaders, is [licensed under the LGPL-3.0 License](https://www.gnu.org/licenses/lgpl-3.0.en.html). This means no warranty is provided.\n\nSome elements of code are adapted from or copied from other projects with compatible licensing.  The author has attempted to provide credit and/or appropriate notices in the code where applicable.\n\n## Limitations\nCanvas is in EARLY ALPHA.  Expect it to break.\n\nThe FREX extensions, shader library, vertex formats, attribute bindings, and lighting options are subject to change - causing your code to break.  Sorry.  When there is a stable release I will avoid breaking changes in shipping versions.  Until then, experimentation is the norm.\n\n## Why\nWhen people first hear about Canvas they often ask if it is a performance mod or a replacement for Optifine / shader packs.  The answer is \"no, but...\"\n\nOptifine and shader packs primarily target vanilla Minecraft.  They work with modded, often well, but they aren't designed as tools for *mod authors*.\n\nCanvas' main purpose is to give mod authors more control and options for rendering modded blocks.  It can also be used for building shader packs, but the design is entirely different than OF and does not yet support all the features needed for a full shader pack implementation.  Unlike OF shader packs, Canvas shader packs can be mixed together by adding multiple resource packs. \n\n## Performance\nPerformance-wise, Canvas tries to be be faster than Vanilla with extended features. It is optimized heavily - but the intent of these changes is to make better rendering practical, not to be a general-purpose performance mod. It isn't meant to run on low-end hardware and may or may not make your game run faster overall.\n\nCanvas will try to fully use your hardware and will not be timid about it. It wants at least 4GB and will push both your CPU and GPU.  It will stress your cooling system.\n\nIf you're looking to max performance with Canvas, the config menu tool tips indicate which features can help.  Bloom is especially expensive at high resolutions.  But bloom is also fun to look at, so.... your call. \n\nMore optimizations will be added after a stable release.\n\n# Using Canvas\n\n## Installing Canvas\nAdd Canvas to the `mods` folder in your minecraft folder (`%appdata%/.minecraft/mods` on Windows) and make sure you have recent versions of [Fabric](https://fabricmc.net/) Loader and API, plus at least 4GB of memory allocated to Minecraft.  An in-game config menu is available in video options, or via Mod Menu if you have it installed.\n\n## Compatible Shader Packs\n\nThird-party pipeline shaders:\n* [Lumi Lights](https://spiralhalo.github.io/)\n* [Forget-me-not](https://github.com/Poisoned-Honey/ForgetMeNot-Shaders)\n* [lomo (wip)](https://github.com/fewizz/lomo/)\n\nThis list is updated infrequently.\n\nMore releases can be found in [`#canvas-3rd-party-releases` channel](https://discord.com/channels/614624415631671316/752632870257950790) on the [discord server](https://discord.gg/7NaqR2e).\n\n# Developing With Canvas\nBefore using Canvas, you should first understand RenderMaterials, Meshes, RenderContexts and other features defined by the Fabric Rendering API.  For that information, consult the [rendering article on the Fabric Wiki](https://fabricmc.net/wiki/documentation:rendering). Note: Fabric wiki is still WIP as of this writing but should be more complete \"soon.\"\n\nYou can also see [RenderBender](https://github.com/grondag/renderbender) for some (not very good) examples of usage.  Avoid duplicating those examples directly - they aren't especially performant or suitable for use at scale.  As soon as someone releases a model loader / library for Fabric Rendering API / FREX, that will almost certainly be a better approach.\n\n## Attaching Shaders to Materials\n\nShaders can be attached to materials via json, which is the preferred way. Your materials are located in `materials/` within your namespaced resource location.\n\n### assets/example/materials/test_material.json\n```json\n{\n\t\"vertexSource\": \"example:shaders/test.vert\",\n\t\"fragmentSource\": \"example:shaders/test.frag\"\n}\n```\n\nThe paths in `vertexSource` and `fragmentSource` should point to GLSL files in your resources location.  The relative path and file extension must be included, and `shaders/` is the suggested location but not mandatory.\n\nAfterwards, you can map a blockstate (or entity, particle, etc) to your material using a material map located in `materialmaps/`, like so:\n\n### assets/example/materialmaps/block/test_block.json\n```json\n{\n  \"defaultMaterial\": \"example:test_material\"\n}\n```\n\nYou can also load the material directly into java\n\n```java\nRenderer renderer = Renderer.get();\n\n// obtain the loaded material, done after resource reload\nRenderMaterial mat = renderer.materials().materialFromId(new ResourceLocation(\"example:test_material\"));\n```\n\nNote that loading materials directly is only necessary for rendering custom meshes. For full blocks, entities, particles, or fluids, using material maps is the recommended way.\n\nAlternatively, materials can also be created directly in java, like so:\n\n```java\nRenderer renderer = Renderer.get();\n\nRenderMaterial mat = renderer.materials().materialFinder().shader(\n\t\tnew ResourceLocation(\"example\", \"shaders/test.vert\"),\n\t\tnew ResourceLocation(\"example\", \"shaders/test.frag\")\n\t).find();\n```\n\nThis can be more reliable in case you don't want your materials to be affected by resource packs or resource reload. In this case, material maps can't be utilized.\n\n## Writing Material Shaders\n\nYour vertex and fragment shaders must have a `frx_materialVertex` and `frx_materialFragment` procedures respectively. To ensure compatibility, shaders are limited to `#version 330` features.\n\nA detailed documentation of the available API can be found in the FREX source files:\n* [FREX Shader API Overview](https://github.com/vram-guild/frex/blob/1.18/common/src/main/resources/assets/frex/shaders/api/FREX%20Shader%20API.md)\n* [ FREX Shader API Header Files](https://github.com/vram-guild/frex/tree/1.18/common/src/main/resources/assets/frex/shaders/api)\n\n## Adding Canvas to your project\nAdd these maven repos to your build if not already present\n\n```gradle\nrepositories {\n\t// vram guild repo\n\tmaven {url \"https://maven.vram.io\"}\n\t// cloth config / used by canvas dependencies\n\tmaven {url \"https://maven.shedaniel.me/\"}\n\t// spruce ui / current ui library\n\tmaven {url \"https://maven.gegy.dev\"}\n\t// mod menu\n\tmaven {url \"https://maven.terraformersmc.com/releases/\"}\n}\n```\n\nAnd add Canvas to your dependencies\n\n```gradle\ndependencies {\n\tmodCompileOnly \"io.vram:canvas-fabric:19.3.+\"\n\n\t// optional for testing in dev environment\n\tmodRuntimeOnly \"io.vram:canvas-fabric:19.3.+\"\n}\n```\n\nNote that versions are subject to change - look at the repo to find latest.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvram-guild%2Fcanvas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvram-guild%2Fcanvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvram-guild%2Fcanvas/lists"}