![]() |
VOOZH | about |
Shaders are used to define the game's rendering of certain elements.
in Java Edition, two distinct kinds of shaders are used: core shaders and post-processing shaders. Core shaders are used to render fundamental parts of the game such as entities and terrain, while post-processing shaders are used to apply visual effects to the screen after core shaders have ran.
Examples of post-processing shaders include the menu background blur, certain mob vision types as seen in spectator, the Fabulous! graphics setting's fixed handling of translucent object, and the glowing status effect.
Shaders are written in the OpenGL Shading Language (GLSL). Each shader program[note 1] comes in two parts, the vertex and fragment shader. Vertex shaders define the positions of individual vertices, whereas fragment shaders define the final color of a single render fragment. For example, vertex shaders are often used to create waving foliage and water, and fragment shaders can be used to add effects like bloom, god rays, and blur. In Minecraft, vertex shaders must use the extension .vsh, and fragment shaders .fsh.
Shader programs are stored in the assets/minecraft/shaders directory of client.jar, and can be replaced with a resource pack. Note that if any error occurs when loading the shaders, the resource pack is disabled and fabulous graphics mode is turned off.
Core shaders are used to render almost everything in the game, including terrain, entities, GUI elements, etc. The shader programs for core shaders are located in the assets/<namespace>/shaders/core directory of a resource pack.
Some objects are not drawn using shaders, this includes:
FogColor uniformA list of all core shaders can be found by expanding the header below, listing descriptions of what each shader is responsible for, as well as what uniforms, samplers, and define directives are available to each shader.
| Name | Used for | Sample images | Available uniforms blocks | Available samplers.
All samplers are of type |
Define directives |
|---|---|---|---|---|---|
| animate_sprite_blit | Renders non-interpolated texture animations, as well as any non-animated sprite to a texture atlas.
Uses the |
SpriteAnimationInfo
|
Sprite - The next animation frame
|
None present. | |
| animate_sprite_interpolate | Renders interpolated texture animations to a texture atlas.
Uses the |
SpriteAnimationInfo
|
CurrentSprite - The current animation frame
|
None present. | |
| blit_screen | Copies one buffer to another. Used for the Glowing effect.
Uses the |
None present. | Sampler0 - The buffer to copy from.
|
None present. | |
| block | Renders blocks that aren't part of chunk meshes such as falling sand, blocks being moved by a piston, or pistons while moving a block. β[more information needed] | DynamicTransforms
|
Sampler0 - The blocks atlas.
|
ALPHA_CUTOUT - Minimum opacity before pixels are discarded, if not defined no pixels get discarded. This is defined as 0.5 for cutout textures, 0.1 for translucent textures, and not defined for solid textures.
| |
| debug_point | Used for some debug renderers β[more information needed]
Uses the |
DynamicTransforms
|
None present. | None present. | |
| entity | Renders most entities including but not limited to:
|
DynamicTransforms
|
Sampler0 - The base texture of the entity.
|
ALPHA_CUTOUT - Minimum opacity before pixels are discarded, if not defined no pixels get discarded. This is defined as 0.1 for cutout and translucent textures, and not defined for solid textures.
| |
| glint | Renders the enchantment glint on items, equipment, etc. | DynamicTransforms
|
Sampler0 - The enchantment glint texture.
|
None present. | |
| gui | Renders flat colored gui elements including but not limited to:
|
DynamicTransforms
|
None present. | None present. | |
| item | Renders item models in various contexts, such as when dropped on the ground, held in an entities hand, in a display entity, etc | DynamicTransforms
|
Sampler0 - The items or blocks atlas depending on the model currently being rendered.
|
ALPHA_CUTOUT - Minimum opacity before pixels are discarded, if not defined no pixels get discarded. This is defined as 0.1 for cutout and translucent textures, and not defined for solid textures.
| |
| lightmap | Renders the lightmap which is used by other shaders to determine how bright or dark parts of the world should be.
Uses the |
LightmapInfo
|
None present. | None present. | |
| panorama | Renders the title screen panorama cubemap. |
|
DynamicTransforms
|
Sampler0 (samplerCube) - A cubemap sampler containing all 6 panorama images.
|
None present. |
| particle | Renders all particle effects. Also renders the rain and snow weather effects. |
|
DynamicTransforms
|
Sampler0 - The particles or blocks atlas, depending on the particle that is being rendered. If rendering a weather effect then this is the corresponding texture for that effect.
|
None present. |
| position_color | Renders the lower half of the sky at sunrise and sunset. Also renders the F3 debug pie and chunk borders. |
|
DynamicTransforms
|
None present. | None present. |
| position_tex_color | Renders some miscellaneous textured things including but not limited to:
|
|
DynamicTransforms
|
Sampler0 - For most gui widgets and icons, this is the gui atlas. For world, resourcepack, etc icons, mojang logo, camera overlays, or other non-gui things this is the texture of the object being rendered.
|
None present. |
| position_tex | Renders celestial bodies including the sun, moon, and end flashes. | DynamicTransforms
|
Sampler0 - The celestials atlas
|
None present. | |
| position | Handles depth for the ender dragon's death raysβ[more information needed]. | DynamicTransforms
|
None present. | None present. | |
| rendertype_beacon_beam | Renders the beacon and end gateway beams.β[more information needed] |
|
DynamicTransforms
|
Sampler0 - The texture of the current part of the beam being rendered.
|
None present. |
| rendertype_clouds | Renders the clouds. |
|
CloudInfo
|
CloudFaces (isamplerBuffer) - Data about cloud facesβ[more information needed]
|
None present. |
| rendertype_crumbling | Renders the block breaking animation. |
|
DynamicTransforms
|
Sampler0 - The texture for current stage of the block breaking animation.
|
None present |
| rendertype_end_portal | Renders starfield objects |
|
DynamicTransforms
|
Sampler0 - The end sky texture textures/environment/end_sky.png.
|
PORTAL_LAYERS - The amount of star layers to render.
|
| rendertype_entity_shadow | Renders the shadow that appears under most entities. |
|
DynamicTransforms
|
Sampler0 - The shadow texture textures/misc/shadow.png.
|
None present. |
| rendertype_leash | Renders leads that are attached to entities in the world. |
|
DynamicTransforms
|
Sampler2 - The lightmap.
|
None present. |
| rendertype_lightning | Renders lightning bolts and the ender dragon's death rays. |
|
DynamicTransforms
|
None present. | None present. |
| rendertype_lines | Renders all types of lines including:
|
|
DynamicTransforms
|
None present. | None present. |
| rendertype_outline | Renders a flat colored outline of entities which have the glowing effect.
The color of this is based on the team the entity is in, or the glow color override for display entities, which is passed to the shader via the The output of this shader is saved to a buffer and then later used in the |
|
DynamicTransforms
|
Sampler0 - The base texture of the object being rendered.
|
None present. |
| rendertype_text_background_see_through | Renders the background of text display entities that are set to render through blocks. |
|
DynamicTransforms
|
None present. | None present. |
| rendertype_text_background | Renders the background of text display entities that are not set to render through blocks. |
|
DynamicTransforms
|
None present. | None present. |
| rendertype_text_see_through
rendertype_text_intensity_see_through |
Renders text that is visible through blocks. Also renders the background of player and entity nameplates.
Note: rendertype_text_intensity_see_through is identical, however it is only used to render ttf fonts. |
|
DynamicTransforms
|
Sampler0 - An automatically generated 256x256 atlas which contains the current character that is being rendered.
|
None present. |
| rendertype_text
rendertype_text_intensity |
Renders text in the world and in GUIs. Also renders maps in item frames or when held in first person.
Note: rendertype_text_intensity is identical, however it is only used to render ttf fonts. |
|
DynamicTransforms
|
Sampler0 - An automatically generated 256x256 atlas which contains the current character that is being rendered. For maps, this is the map background texture, map_decorations atlas, or the map itself depending on which part is currently being rendered.
|
None present. |
| rendertype_water_mask | A mask used to hide water inside boats. |
|
DynamicTransforms
|
None present. | None present. |
| rendertype_world_border | Renders the world border. |
|
DynamicTransforms
|
Sampler0 - The world border texture textures/misc/forcefield.png.
|
None present. |
| sky | Renders the upper half of the overworld skybox. |
|
DynamicTransforms
|
None present. | None present. |
| stars | Renders the stars in the overworld sky at night. |
|
DynamicTransforms
|
None present. | None present. |
| terrain | Renders all blocks and fluids in the world. |
|
ChunkSection
|
Sampler0 - The blocks atlas.
|
ALPHA_CUTOUT - Minimum opacity before pixels are discarded, if not defined no pixels get discarded. This is defined as 0.5 for cutout textures, 0.1 for translucent textures, and not defined for solid textures.
|
| text_background | Renders text background, for example those seen on entity nameplates or text display entities. | DynamicTransforms
|
Sampler2 - The lightmap
|
IS_SEE_THROUGH - Defined if the shader has no depth test and can be seen through other objects.
| |
| text | Renders text in the world and in GUIs. Also renders maps in item frames or when held in first person. | DynamicTransforms
|
Sampler0 - An automatically generated 256x256 atlas which contains the current character that is being rendered. For maps, this is the map background texture, map_decorations atlas, or the map itself depending on which part is currently being rendered.
|
IS_GRAYSCALE - Defined if the shader should treat the font texture as an intensity texture for TTF font rendering.
|
Include shaders (stored in assets/<namespace>/shaders/include) contain helper functions and variables that can be used in multiple shader programs. These must have the .glsl, .vsh, or .fsh file extensions.
To import an include shader, add one of the following import directives anywhere in a vertex or fragment shader program
#moj_import <filepath.glsl> imports a file from assets/minecraft/shaders/include/<filepath>.glsl#moj_import <namespace:path.glsl> imports a file from assets/<namespace>/shaders/include/<path>.glsl#moj_import "filepath.glsl" imports a file from assets/minecraft/shaders/core/<filepath>.glslWhen importing an include shader, the game replaces the import directive with the contents of the include shader. The imported file needs to end with an empty line, otherwise the shader does not load.
The following include shaders are used throughout the vanilla resource pack
| Name | Description |
|---|---|
| fog.glsl | Contains the linear_fog function to calculate the color based on the vertex distance. Contains a definition of the Fog uniform block
|
| light.glsl | Contains the minecraft_mix_light function, used to calculate face lighting in entity shaders. Contains a definition of the Lighting uniform block
|
| matrix.glsl | Contains the mat2_rotate_z function that returns the rotation matrix for a vec2 around the z-axis.
|
| projection.glsl | Contains the projection_from_position function. Contains a definition of the Projection uniform block
|
| globals.glsl | Contains a definition of the Globals uniform block.
|
| dynamictransforms.glsl | Contains a definition of the DynamicTransforms uniform block.
|
| chunksection.glsl | Contains a definition of the ChunkSection uniform block.
|
| animation_sprite.glsl | Contains a definition of the SpriteAnimationInfo uniform block.
|
| sample_lightmap.glsl | Contains the sample_lightmap function, used by various shaders to sample the lightmap texture.
|
As mentioned previously, post-processing effects are used in menu backgrounds, when spectating certain mobs to create vision effects, the Fabulous! graphics setting, and when rendering the glowing effect.
Post-processing effects are made up of multiple passes and render targets. A target is a buffer that can be read from and written to. The game provides some built-in targets that contain certain parts of the game world (particles, water, etc), and you can define your own to read and write data to. A pass can have multiple inputs from png textures or render targets.
Post-processing effects are defined in assets/<namespace>/post_effect/<post effect>.json. Note that post-processing effects are applied before the HUD and GUI elements are rendered
[0, 0, 0, 0]. The color this target is filled with when it is created or cleared. Supports two formats. A list of floats in 0-1 range [R, G, B, A], or a color in decimal format calculated from the red, green and blue components using this formula:minecraft:post/blit resolves to assets/minecraft/shaders/post/blit.vshminecraft:post/box_blur resolves to assets/minecraft/shaders/post/box_blur.fshMainDepth, for example, makes a sampler2D uniform called MainDepthSampler available to the shader program for this pass. This will also provide an additional vec2 to the SamplerInfo uniform block called <sampler_name>Size, for example MainDepthSizetargets above, or one of the following built in targets: minecraft:main, minecraft:translucent, minecraft:item_entity, minecraft:particles, minecraft:weather, minecraft:clouds, or minecraft:entity_outlineMyTexture, for example, makes a sampler2D uniform called MyTextureSampler available to the shader program for this pass. This will also provide an additional vec2 to the SamplerInfo uniform block called <sampler_name>Size, for example MyTextureSizemy_namespace:post_texture resolves to assets/my_namespace/textures/effect/post_texture.pngtargets above or minecraft:main. Note: you cannot read and write to the same target in the same passuniforms: { "UniformBlockName": [ { "type": "vec2", "value": [...] } ] }
int, float, ivec3, vec2, vec3, vec4, and matrix4x4type field is set to
int requires a single intfloat requires a single floativec3 requires list of 3 intsvec2 requires list of 2 floatsvec3 requires list of 3 floatsvec4 requires list of 4 floatsmatrix4x4 requires 16 floatsThere are currently six post-processing effects used in the game:
| Name | Used for | Sample images |
|---|---|---|
| blur | Used for the blur effect in the background of most menus in-game and on the title screen. This post effect is not used when the "Menu Background Blur" accessibility setting is set to 0. |
|
| creeper | Adds a green filter over the screen and give the appearance of a reduced resolution. Used when spectating a creeper. |
|
| entity_outline | Applies a blur over a solid color silhouette of an entity. Used when an entity with the glowing effect is on-screen. |
|
| invert | Inverts the colors of the screen. Used when spectating an enderman. |
|
| spider | Renders a blurred version of the screen with 5 additional copies overlapped on top with blurred edges. Used when spectating a spider. |
|
| transparency | Combines multiple passes (targets) of different objects in the world, resulting in slightly better translucency blending compared to "Fast" or "Fancy" graphics. Used when the graphics mode is set to "Fabulous!". |
|
Each frame is rendered in the following orderβ[more information needed]
When the game draws an item or entity in a GUI the following process occurs:
oversized_in_gui field is set to true or false in the items model definition. For entities, each one always has a unique texture that it gets rendered toThe game can skip rendering an item when necessary and will use whatever was drawn on the previous frame. An item is only re-rendered if one of the following conditions is met:
item_model, custom_model_data, or profile data componentsUniforms blocks use the std140 layout. All uniforms must be specified and in the correct order and with the correct type, otherwise weird and undefined behavior will occur. For convenience, some uniform blocks are pre-defined in include shaders, see the include shaders section for more information.
Some shaders may not use all uniforms in a given uniform block, in this case the unused uniforms will have a 'default' value. For example, while the rendertype_lines core shader will have the proper value for the LineWidth uniform, other shaders will have a "default value" for which will likely not be useful.
The following uniform blocks are available in both post-processing and core shaders.
GlobalsThis uniform block is always bound and has proper values in all shaders.
CameraBlockPos Block position of the camera in world-space coordinates.CameraOffset Fractional position of the camera in world-space coordinates.ScreenSize The width and height of the current framebuffer in pixels.GlintAlpha The value of the Glint Strength accessibility setting in a 0-1 range.GameTime A value that constantly increases from 0-1 over the span of roughly 20 minutes, then resets to 0. The exact formula for this is (<age of the world> modulo 24000) / 24000.MenuBlurRadius The value of the Menu Background Blur accessibility setting in a 0-10 range.UseRgss A "boolean" value. Value is 1 if the texture filtering video setting is set to RGSS, otherwise 0.The following uniform blocks are only available in core shaders.
FogThis uniform block is always bound, however may not have proper values if used outside shaders which support it.
FogColor Color of the fog.FogEnvironmentalStart Starting distance of environmental fog.FogEnvironmentalEnd Ending distance of environmental fog.FogRenderDistanceStart Starting distance of render distance fog.FogRenderDistanceEnd Ending distance of render distance fog.FogSkyEnd Ending distance of fog for the upper portion of the sky.FogCloudsEnd Ending distance for clouds fog.DynamicTransformsModelViewMat The model-view matrix.ColorModulator A color multiplier that can be set in game code to modify the final color of objects.ModelOffset The offset of the model being rendered.TextureMat A 4D matrix used to transform UV's for some animated effects, such as the enchantment glint, breeze and wind charge wind, world border, etc.LightingThis uniform block is always bound, however may not have proper values if used outside shaders which support it.
Light0_Direction First light direction. Used to calculate directional entity shading.Light1_Direction Second light direction. Used to calculate directional entity shading.ProjectionThis uniform block is always bound, however may not have proper values if used outside shaders which support it.
ProjMat The projection matrixLightmapInfoSkyFactor A value that specifies how much to brighten the lightmap by when the sky flashes, typically when a lightning strike occurs. This value comes from the minecraft:visual/sky_light_factor environment attribute.BlockFactor A value that fluctuates randomly, used in the vanilla shader for block light flickering.NightVisionFactor A value in a 0-1 range that specifies how much the Night Vision status effect should brighten the lightmap by.DarknessScale A value in a 0-1 range that specifies how much the Darkness status effect should darken the lightmap by.BossOverlayWorldDarkeningFactor A value that specifies how much to darken the lightmap by when a bossbar is visible. This is seemingly only used in the ender dragon fight β[more information needed].BrightnessFactor The value of the brightness video setting in a 0-1 range.BlockLightTint The color of block light. This value comes from the minecraft:visual/block_light_tint environment attribute.SkyLightColor The color of sky light. This value comes from the minecraft:visual/sky_light_color environment attribute.AmbientColor The ambient light color. This value comes from the minecraft:visual/ambient_light_color environment attribute.NightVisionColor The color of the Night Vision status effect. This value comes from the minecraft:visual/night_vision_color environment attribute.CloudInfoCloudColor The color of the clouds.CloudOffset Offset of the clouds β[more information needed].CellSize Size of each individual cloud β[more information needed].ChunkSectionModelViewMat The model-view matrix.ChunkVisibility Value that increments from 0 to 1 once a chunk section has been displayed. The amount of time this takes is dependent on the "Chunk Fade" video settingTextureSize β[more information needed]ChunkPosition β[more information needed]SpriteAnimationInfoProjectionMatrix The projection matrixSpriteMatrix β[more information needed]UPadding β[more information needed]VPadding β[more information needed]MipMapLevel β[more information needed]The following uniform blocks are only available in post-processing shaders.
SamplerInfoOutSize The width and height of the output buffer in pixels.<sampler_name>Size, for example, MainSize for an input with a name of "Main"
Since Bedrock Edition 1.18.30, third-party shader in resource packs are no longer supported on all devices due to the implementation of RenderDragon.
The deferred rendering pipeline is an alternative rendering pipeline which can be customized via resource packs and is used in the vanilla game for the Vibrant Visuals graphics mode.
Although it doesn't directly support custom shaders, it offers ways to define properties about light, fog, atmosphere, and PBR texture materials. This can be used to create lighting effects similar to those seen in Java Edition's shader packs.
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.7.2 | 13w38a | Post-processing shaders were added, accessible via the Super Secret Settings button. | |||||
| 1.8 | 14w05a | The creeper and spider shaders were added. Shaders are automatically applied in spectator mode when viewing the world as a creeper, spider, cave spider or enderman.
| |||||
| 14w05b | Shaders have been removed from view when changing perspective while spectating a mob.[1] | ||||||
| now toggles different shaders rather than turning them off.[1] | |||||||
| 14w06a | The entity_outline post effect shader was added for the glowing effect.
| ||||||
| 1.9 | 15w31a | Removed the Super Secret Settings button for an internal rewrite.[2] | |||||
| 1.16 | 20w22a | The transparency post effect shader was added for Fabulous! graphics mode.
| |||||
| 1.15 | 19w41a | Something about the shader for glowing entities has changed allowing for atlases to be passed to them, allowing for this resource pack to work. | |||||
| 1.17 | 21w10a | Added core shaders. | |||||
Added the fog.glsl, light.glsl, matrix.glsl, and projection.glsl include shaders
| |||||||
| The game now requires OpenGL 3.2 Core Profile. | |||||||
Upgraded the existing shader programs for post processing effects from glsl version 110 to 150
| |||||||
| 1.18.1 | ? | The fog.glsl include shader now has a cylindrical_distance function. All core shaders that previously used the builtin length function to calculate vertex distance use this.
| |||||
| 1.18.2 | ? | In fog.glsl the cylindrical_distance function has been renamed to fog_distance. It also takes an additional int parameter for fog shape.
| |||||
| ? | Added the FogShape uniform for core shaders.
| ||||||
| 1.19 | 22w12a | There are now shader files for translucent entity rendering.β[more information needed] | |||||
| 1.20.5 | 24w05a | The attributes array in core shader definitions has been removed. All attributes are now always bound for a given shader. | |||||
The unused position_color_normal and position_tex_lightmap_color core shaders have been removed
| |||||||
The position_tex_color_normal core shader has been renamed to rendertype_clouds
| |||||||
The IViewRotMat uniform has been removed, and the Position attribute for entities is now in (camera relative) world space
| |||||||
| Light direction uniforms are no longer premultiplied by the view matrix | |||||||
| 24w09a | The menu background dirt texture has been replaced by a post-processing blur shader. | ||||||
| 24w11a | All unused post-processing shaders that were used for Super Secret Settings have been removed. | ||||||
| 1.21.2 | 24w34a | Shader program configurations can now specify preprocessor define directives to apply to their linked shaders. | |||||
Various individual shader programs have been merged into one with the shader program configuration files defining preprocessor directives for specific behaviour. For example the core/rendertype_solid.json, core/rendertype_translucent.json, core/rendertype_cutout.json, core/rendertype_cutout_mipped.json, and core/rendertype_tripwire.json program configurations all point to the core/terrain fragment and vertex programs, with some defining an ALPHA_CUTOUT directive.
| |||||||
The fragment and vertex fields in shader program configurations can now include a namespaces instead of being hardcoded to minecraft. Additionally, the paths are now relative to the assets/namespace/shaders/ directory instead of assets/minecraft/shaders/core/.
| |||||||
The format of post-processing effects has changed and are now located under the assets/namespace/post_effects/ directory.
| |||||||
The rendertype_entity_glint_direct core shader has been removed and replaced by rendertype_entity_glint.
| |||||||
The rendertype_entity_translucent_cull shader has been removed and replaced by rendertype_item_entity_translucent_cull.
| |||||||
The ChunkOffset uniform has been renamed to ModelOffset.
| |||||||
| ? | Most textured gui elements now use the core/position_tex_color shader instead of core/position_tex
| ||||||
| 1.21.4 | ? | The sun and moon now use the core/position_tex_color shaders instead of core/position_tex
| |||||
| 1.21.5 | 25w06a | Added a new core shader, rendertype_world_border, which is used to render the world border
| |||||
| 25w07a | Shader program configuration files have been removed. The shader programs are still present, however the only uniforms available to them are the default ones that are used in the vanilla rendering. | ||||||
In post-processing effects, the field program was replaced with vertex_shader and fragment_shader which resolve to assets/<namespace>/shaders/<path>.<vsh or fsh>
| |||||||
In post-processing effects, type is now a required field for each uniform, with the possible values being int, ivec3, float, vec2, vec3, vec4 and matrix4x4
| |||||||
In post-processing effects, the values field is now option for each uniform. Leaving it unset is not recommended as it will result in undefined behavior. Leaving it unset is only used for runtime configuration of the blur post-processing effect in the vanilla rendering
| |||||||
The EndPortalLayers uniform has been removed and replaced by a pre-processor define called PORTAL_LAYERS | |||||||
| 25w10a | "Global" uniforms can now be defined in shader programs. If a uniform is not usually available to that shader, or the type of the uniform is not defined as what it would normally be, undefined behavior will occur | ||||||
Currently, the "global" uniforms are: ModelViewMat, ProjMat, TextureMat, ScreenSize, ColorModulator, Light0_Direction, Light1_Direction, GlintAlpha, FogStart, FogEnd, FogColor, FogShape, LineWidth, GameTime, and ModelOffset. Note that this is not the same as the Globals uniform block added in 1.21.6, these are individual uniforms that must be declared individually. There is also no globals.glsl include shader which was also added in 1.21.6
| |||||||
| 1.21.6 | 25w16a | All built-in uniforms are now uniform blocks instead of opaque loose uniforms | |||||
| Custom uniforms provided to post-process shaders are now uniform blocks | |||||||
In post-processing effects, targets now supports two new optional fields: persistent and clear_color
| |||||||
In post-processing effects, the uniforms field is now a list of uniform blocks, example: { "UniformBlockName": [ { "type": "vec2", "value": [...] } ] }.
| |||||||
In post-processing effect uniform definitions, the name field is now unused by the game but still present. The values field has been replaced with value, behaving largely the same but for the int and float uniform types this field accepts a single number instead of a list with 1 entry.
| |||||||
In post-processing effects, the list of size (all vec2 *Size) uniforms have been replaced with a single SamplerInfo uniform block.
| |||||||
The main menu panorama now uses a new fragment program, core/panorama.fsh.
| |||||||
The core/position_tex.fsh program is now unused.
| |||||||
The position core shader can now have a FOG_IS_SKY define directive.
| |||||||
The minecraft_sample_lightmap has been removed from the light.glsl include shader. All shaders that previously used this function now instead sample the lightmap texture directly.
| |||||||
| 25w17a | Added two new core shaders; stars, and sky which are used to render the stars and upper portion of the sky respectively.
| ||||||
Removed the FOG_IS_SKY define directive, as the sky now uses a separate shader.
| |||||||
| 25w19a | The main menu panorama now uses a new vertex program, core/panorama.vsh.
| ||||||
The core/position_tex.vsh program is now unused.
| |||||||
Added four new uniforms, FogEnvironmentalStart, FogEnvironmentalEnd, FogRenderDistanceStart and FogRenderDistanceEnd.
| |||||||
The FogShape, FogStart and FogEnd uniforms have been removed.
| |||||||
| 1.21.9 | 25w31a | Removed the post/blit.vsh, post/blur.vsh, post/invert.vsh, post/sobel.vsh, post/screenquad.vsh, and core/blit_screen.vsh shader programs and replaced them with core/screenquad.vsh.
| |||||
Vertex shaders for post-processing effects and full screen blits are no longer are passed a Position attribute. Instead these must assign vertex coordinates using gl_VertexID. Additionally, these shaders are only executed with 3 vertices instead of a full quad like they were previously.
| |||||||
| 25w33a | In the LightmapInfo uniform block, the int UseBrightLightmap uniform has been removed, and vec3 AmbientColor has been added.
| ||||||
The core/lightmap.fsh shader has been modified for the new end flashes.
| |||||||
| 25w35a | The core/lightmap.fsh shader has been modified slightly to fix some issues with end flashes. The darkness effect pulsing is no longer applied in the end as part of these changes.
| ||||||
| 25w36a | Removed the unused core/position_color_lightmap.fsh, core/position_color_lightmap.vsh, core/position_color_tex_lightmap.fsh, and core/position_color_tex_lightmap.vsh shader programs.
| ||||||
Minor change to uv calculations in the minecraft_sample_lightmap function in the core/terrain.vsh program.
| |||||||
| 25w37a | The core/entity shader can now have a PER_FACE_LIGHTING flag. When set, cardinal lighting will be computed separately for front and back faces of each quad.
| ||||||
| The game now requires OpenGL 3.3 Core Profile. | |||||||
Upgraded all shader programs from glsl version 150 to 330
| |||||||
Split the logic for minecraft_mix_light function in include/light.glsl into two additional functions: minecraft_compute_light and minecraft_mix_light_separate
| |||||||
| ? | The sun and moon now use the core/position_tex shaders instead of core/position_tex_color
| ||||||
| 1.21.11 | 25w41a | Added a new shader program core/debug_point.vsh
| |||||
Removed the LineWidth uniform from the DynamicTransforms uniform block. Line width is now passed as a vertex attribute to the core/rendertype_lines and core/debug_point shaders instead.
| |||||||
| 25w44a | Added new shader programs core/animate_sprite.vsh, core/animate_sprite_blit.fsh, and core/animate_sprite_interpolate.fsh for rendering texture animations.
| ||||||
Changes have been made to the core/terrain shader for texel antialiasing and chunk fade animations.
| |||||||
The Sampler0 uniform in the core/terrain shader now uses linear filtering instead of nearest.
| |||||||
Added new shader programs core/block.vsh and core/block.fsh for rendering non-chunk-meshed blocks such as falling sand or blocks being moved by a piston.
| |||||||
Added new include shaders include/animation_sprite.glsl and include/chunksection.glsl which contain definitions for new SpriteAnimationInfo and ChunkSection uniform blocks respectively.
| |||||||
Added two new uniforms, ivec3 CameraBlockPos and vec3 CameraOffset, to the Globals uniform block.
| |||||||
| pre1 | The core/terrain.fsh shader has been modified to implement RGSS texture filtering.
| ||||||
Added a new uniform, int UseRgss, to the Globals uniforms block.
| |||||||
| 26.1 | snap1 | The core/lightmap.fsh shader has been mostly rewritten
| |||||
Added two new uniforms to the LightmapInfo uniform block: vec3 BlockLightTint and vec3 NightVisionColor.
| |||||||
The float AmbientLightFactor uniform has been removed from the LightmapInfo uniform block. It is now pre-multiplied into the vec3 AmbientColor uniform.
| |||||||
The float DarkenWorldFactor uniform in the LightmapInfo uniform block has been renamed to float BossOverlayWorldDarkeningFactor
| |||||||
Added a new include/smooth_lighting.glsl shader. Contains a function called minecraft_sample_lightmap used by various shaders to sample the lightmap texture.
| |||||||
| snap5 | Various shaders now sample the lightmap texture using the texture function instead of texelFetch. This includes core/entity.vsh, core/rendertype_entity_decal.vsh, core/rendertype_item_entity_translucent_cull.vsh, core/rendertype_leash.vsh, core/rendertype_text.vsh, core/rendertype_text_background.vsh, core/rendertype_text_intensity.vsh, and core/rendertype_translucent_moving_block.vsh.
| ||||||
| snap6 | The core/rendertype_item_entity_translucent_cull shader has been removed, most things that were previously handled by this shader are now handled by core/entity.
| ||||||
The core/rendertype_entity_alpha and core/rendertype_entity_decal shaders have been removed and replaced by a DISSOLVE define directive in core/entity
| |||||||
All item models are now rendered using a new core/item shader instead of core/entity, with the exception of special model renderers which still use core/entity
| |||||||
| snap7 | The core/terrain.vsh and core/block.vsh shaders no longer have the Normal vertex attribute
| ||||||
Some small changes were to how various shaders sample the lightmap texture. This includes core/entity.vsh, core/item.vsh, core/rendertype_leash.vsh, core/rendertype_text.vsh, core/rendertype_text_background.vsh, core/rendertype_text_intensity.vsh, and core/rendertype_translucent_moving_block.vsh.
| |||||||
| snap10 | The include/smooth_lighting.glsl shader has been removed and replaced by a new include/sample_lightmap.glsl shader. This contains a function called sample_lightmap used by various shaders to sample the lightmap texture.
| ||||||
The following shaders; core/block.vsh, core/entity.vsh, core/item.vsh, core/particle.vsh, core/rendertype_leash.vsh, core/rendertype_text.vsh, core/rendertype_text_background.vsh, core/rendertype_text_intensity.vsh, core/rendertype_translucent_moving_block.vsh, and core/terrain.vsh, now sample the lightmap texture using the helper function declared in include/sample_lightmap.glsl.
| |||||||
core/rendertype_crumbling.vsh no longer defines a varying named texCoord2
| |||||||
| pre1 | The core/rendertype_translucent_moving_block shaders have been removed. Objects which were previously rendered by this shader are now handled by core/block
| ||||||
| 26.2 | snap1 | The game now uses a reversed depth buffer. The post/transparency.fsh shader has had its depth logic reversed to account for this.
| |||||
The core/rendertype_text, core/rendertype_text_see_through, core/rendertype_text_intensity, and core/rendertype_text_intensity_see_through shaders have been merged into new core/text shaders. Three defines are available for handling variants of text; IS_GUI, IS_SEE_THROUGH, and IS_GRAYSCALE.
| |||||||
The core/rendertype_text_background and core/rendertype_text_background_see_through shaders have been merged into new core/text_background shaders. The IS_SEE_THROUGH define is availble for handling see-through backgrounds.
| |||||||
When the games graphics api is set to Vulkan, some minor pre-processing is now done to shaders. Notably, gl_VertexID is replaced with gl_VertexIndex and gl_InstanceID is replaced with gl_InstanceIndex.
| |||||||
The core/rendertype_crumbling.vsh no longer has a vec3 Normal vertex attribute.
| |||||||
The core/item shaders have been updated slightly. The item pipelines now have an overlay texture similar to entity pipelines; sampler2d Sampler1. The vertex program now defines two varyings vec4 lightMapColor and vec4 overlayColor. These are then mixed and multiplied onto the base texture color in the fragment program.
| |||||||
The core/entity.vsh shader no longer imports the minecraft:light.glsl include when both PER_FACE_LIGHTING and NO_CARDINAL_LIGHTING are not defined.
| |||||||
| This snapshot has a bug which prevents the game from loading any shaders from resourcepack after the initial resource load. This only applies when the graphics api is set to Vulkan MC-307311. | |||||||
| snap2 | MC-307311 has been fixed, allowing shaders to be loaded from resourcepacks properly again. | ||||||
The core/rendertype_beacon_beam.fsh has been updated slightly to account for the reversed depth buffer, as it was missed in 26.1-snapshot-1.
| |||||||
| pre3 | The ALPHA_CUTOUT define in the core/terrain shader is now defined as 0.1 for translucent quads instead of 0.01 as a fix for MC-308245
| ||||||
Issues relating to "Shader" are maintained on the bug tracker. Issues should be reported and viewed there.
| Resource packs | |||||
|---|---|---|---|---|---|
| Components |
| ||||
| Built-in |
| ||||
| Tutorials | |||||