Minecraft Core Shaders: Edit Them in a Resource Pack
Learn how minecraft core shaders work in a resource pack: the 26.3 folder layout, the 26.2 text rename, safe edits and debugging shader errors.
อัปเดต 5 พ.ย. 2569เขียนสำหรับ Minecraft 26.3อ่าน 3 นาที
Written for Minecraft 26.3.
Minecraft core shaders are small GPU programs that draw blocks, entities, text and more. A resource pack can replace them from assets/minecraft/shaders/core/. This is advanced work, and the wiki warns it is not an intended or supported feature and may change at any time.
Before you start
A resource pack. See Pack basics.
Some GLSL knowledge. Shaders are written in GLSL.
Vanilla's shader files to copy from. Extract them from the game jar for your exact version.
A graphics card that supports OpenGL 3.3 Core Profile.
Folder layout
assets/minecraft/shaders/
core/ (.vsh vertex and .fsh fragment programs)
include/ (shared .glsl helper files)
post/ (post-effect shaders)Every core shader is a pair: a
.vshfile (vertex) and a.fshfile (fragment) with the same name.Since 25w07a there is no program JSON for core shaders. Settings come from defines in the code.
Shared code is pulled in with
#include <file.glsl>or#include <namespace:path.glsl>. The included file must end with an empty line.
What changed in 26.2 and 26.3
26.2 merged the text shaders.
rendertype_text,rendertype_text_see_through,rendertype_text_intensityand its see-through form becamecore/text. Variants are chosen with the definesIS_GUI,IS_SEE_THROUGHandIS_GRAYSCALE.rendertype_text_backgroundand its see-through form becamecore/text_background, usingIS_SEE_THROUGH. In 26.3 snapshot 8 the text_background files were removed again, so check what ships in your version before editing.26.3 renamed
rendertype_cloudstocloudsandrendertype_world_bordertoworld_border.26.3 snapshot 5 replaced
#moj_importwith#include. Old packs that use#moj_importfail to compile.26.3 compiles shaders with ShaderC, which is stricter:
#versionmust be the first line, andinandoutneed a location.
Older packs targeting 1.20 or 1.21 will not work unchanged. Uniforms became uniform blocks in 1.21.6, and the member order of Globals and DynamicTransforms changed in 26.3 snapshot 6.
Make a safe change
Copy one vanilla pair, for example the
core/textfiles, into your pack at the same path.Make one small change, such as a colour multiplier in the fragment file.
Keep the uniform blocks exactly as vanilla declares them. Names, order and types must match, or behaviour is undefined.
Reload with F3 + T and test.
Safe edits are changes to the maths inside main(): colours, discards and simple effects. Unsafe edits are anything that changes declared uniforms, the samplers or the in/out interface.
Check it worked
Reload the pack and look at the thing the shader draws.
Chat text and item tooltips are a quick test for text shaders.
If the game still shows the effect after you reverted the change, the pack is not applied. See debugging a pack.
Common problems
The pack turns itself off
A shader failed to load. The game disables the pack and also turns off Fabulous graphics. Open the game log and read the first error.
Reading the error
A compile error names the file and line. Fix the first error, not the last. We did not verify the exact log text or file location on the wiki, so search the log for the shader name you edited.
It works on one machine and not another
Drivers differ in what they accept. Keep to OpenGL 3.3 Core features.
It does nothing with Iris or OptiFine
Mods that replace the renderer have their own shader systems and may ignore or break custom core shaders. We could not verify this on the wiki, so test on a vanilla client first.
Rebuild after every Minecraft update. Shader interfaces change between snapshots, and a pack that worked on 26.2 can fail on 26.3. For text on screen, see also unicode fonts.