MC core shaders

To add more information and be more organized, I have moved all of the data from this page into a Github Wiki.

Overview

In the 1.17 snapshot 21w10a, more shader types were added for resource packs to be able to edit. As the game’s OpenGL version was upgraded, more possibilities were added for customisable shaders. This is a document which attempts to record and document each of the new core shader types.

 

If dealing with shaders which have something to do with translucent, cutout or cutout_mipped, here is a useful list by boq for all blocks of those specific types:

https://gist.github.com/boq/4514320b590de1fbe84349d23b542b28

 

The document lays out unknown shaders (for now) at the end of their sections.

Non-Rendertype

There are several shaders which are not prefixed with rendertype_. These seem to be for more general targets, such as the sky or all particles.

blit_screen

Blit copies one buffer to another, however this cannot be overridden in a resource pack.

particle

All particles. The alpha value specified in the shader will override the particle’s inbuilt transparency e.g. in the sneeze particle.

position

The colour of the sky.

position_color

The black transparent background on UI elements such as the chat field or the pause menu, the red Mojang loading background, highlighting over item slots, hover text backgrounds, durability bars, as well as the transparent lower hemisphere overlay on the sky approximately between times 11315 to 14150 (sunset) and 21830 to 24670 (sunrise). Also affects the black bars when scoped in with a spyglass. For UI elements Position is the screen size divided by the gui scale. E.g. 1920x1080 with GUI scale 3 means Position for x will be [0,640] and for y [0,360].

position_tex

sun, moon, worldborder, gui texture, hotbar texture, powder snow overlay, vignette, pumpkin blur and crosshair, skin player in tab, mojang logo

position_tex_color_normal 

Clouds.

position_color_tex 

Fire overlay when the player is burning.

position_tex_color

The End sky, main menu panorama, and menu backgrounds.

Rendertype

These are shaders which are targeted towards a specific element of the display.

For each shader name here, assume that it is prefixed with rendertype_.

Partial frame shader customization based on distance

Most frame shaders contain a “vertexDistance” input variable that indicates the amount of blocks from the player. Some shaders also affect items in inventories or other components in GUIs. To prevent customized shaders from altering these parts, you could exclude customized code based on this distance value. The exact values seem to change based on resolution, so excluding anything with a vertexDistance of above 800 should be good to exclude all GUI parts, without affecting in-world visuals (up to 50 chunks). The following distances were discovered for a 1080p screen:

Component

vertexDistance value

Affected by shaders

Advancement pop-out icons

1450 - 1550

entity_cutout

entity_no_outline

entity_solid

entity_cutout_no_cull

entity_translucent_cull
entity_cutout_no_cull_z_offset

Items that are being moved between slots

1600 - 1750

Items in inventory

1750 - 1825

Advancement icons

1825 - 1875

Items in hotbar

1875 - 1950

Player doll in inventory

1950 - 2000

entity_translucent

Blocks

solid

All solid blocks, lava, and when in fast mode, leaves. Also affects non-translucent falling blocks

cutout

All non-cube-hitbox blocks: saplings, glass, rails,rails, cobwebs, grass, fern, dead bushes, seagrass, flowers, mushrooms, torches, fire, redstone, repeater, comparator, crops, crop stems, cocoa, cactus, sugarcane, kelp, vines (+ glow lichen), lily pad, sea pickles, bamboo, berry bushes, nether sprouts, nether fungus, nether roots, chorus plants, coral, spore blossoms, azalea, moss carpet, dripleaf, hanging roots, sculkshulk sensor, flower pots, doors, trapdoors, ladders, brewing stands, beacons, spawners, conduits, scaffolding, stonecutters, lanterns, campfires, pointed dripstone, amethysts, end rods, lightning rods.

cutout_mipped

Some blocks: grass blocks, iron bars, glass panes, tripwire hooks, hoppers, chains (leaves when using fancy or fabulous graphics)

translucent

Translucent blocks: water (still and flowing), ice, nether portal, stained and tinted glass (not normal glass), slime and honey, bubbles. I have strong suspicion to believe that Sampler2 is the tint overlay used with biomes, since vertexColor tints the water.

translucent_moving_block

Blocks which are translucent and are being moved by a piston. The one below is stained glass.

tripwire

The middle section(s) of a tripwire.

lines

The outline when hovering over a block, as well as the debug crosshair and hitboxes.

And structure blocks preview. Also fishing lines.

crumbling

The block cracks when mining a block. Has some in-built transparency.

beacon_beam

The beam of a beacon. Seems to get rendered behind clouds.

end_portal

The strange image in the end portal. Appears in end gateways, but not in the dimension background.

Entities

entity_cutout_no_cull

All entities, guardian beams and shulker boxes (both placed and in inventory).

entity_translucent

Translucent entities and parts of entities: slimes, players (possibly outer layers of player skins?), markings on horses, shulker bullets, elder guardian particle effect.

entity_solid

Certain entities or entity-style objects: the base of banners, shulker heads, books on lecterns/enchantment tables, shields, beds, bell part of bells, capes, shells of conduits, paintings, tridents, the ears on the Deadmau5 skin.

With item frames, the item frame entity itself is part of the shader, however items on it are not. Only the filled in parts of maps placed on an item frame are part of the shader.

Also includes the first person bottom skin layer and the conduit item (in inventory).

entity_translucent_cull

Flat texture items held by entities (and in the inventory). Only applies in non-Fabulous mode. Also affects translucent items in non-Fabulous mode, but does not affect normal glass or glass pan(If Fabulous is on see item_entity_translucent_cull)

armor_cutout_no_cull

Armour on entities.

armor_entity_glint

The glint on enchanted armour. Slight transparency is inbuilt and unchangeable.

energy_swirl

Charged creeper swirling outline.

eyes

A shader for the entire body of an entity that has glowing eyes (not the eyes themselves). This is not fully opaque.

leash

Leads on entities and fences.

entity_shadow

The blocks that are affected by an entity’s shadow, but not the shadow itself. This is locked to the block grid.

entity_cutout_no_cull_z_offset

Skulls on entities and as an item. Also renders shulker's shell

entity_cutout

Items in the inventory, head (e.g. of armor stands) hand that are blocks (not flat textures)? Doesn’t seem to work with shulker boxes. Also targets chests in minecarts.

entity_decal

Colors the Ender Dragon while it’s dying.

item_entity_translucent_cull

Dropped items which are translucent (here is white stained glass). Only works in Fabulous mode. Does not work in inventory

entity_smooth_cutout

End crystal beams.

entity_no_outline

The color and pattern of banners.

armor_glint

Unknown.

entity_alpha

Used in the death animation of the dragon. Seemingly only affects the dragon’s wings, possibly messed with in code?

 

water_mask

Hides the water in a boat. Changing the color does not seem to have an effect, but changing the position does. Pictured left is moving the mask down by 64, pictured right is moving it to the right by 2.

outline

Glowing effect on entities. This buffer only draws the already-outlined and semi-transparent glowing, not covering the entire entity like pre-snapshot.

UI

These are shaders which affect some part of the UI - these are not explicitly block or entity, so fall under this.

text

All parts of text, including the shadow. This encompasses all text rendered including: F3 Menu, Menu button text, Entity names, Item names, descriptions & amounts in the inventory and the Chat etc. It also does the explored parts of maps

 

text_see_through

The background nameplate of an entity’s custom name.

 

Unknown Shaders

These are shaders that exist in the files that we do not currently know the purpose of. More testing is needed for these.

block

Has 2 ins (UV0 and UV2) and 2 outs (texCoord0 and texCoord2), no math other than what’s included in most other shaders. Not observed ingame, may only be used as a base.

new_entity

Has 3 ins (UV0, UV1, and UV2) and 3 outs (texCoord0, texCoord1, and texCoord2), no math other than what’s included in most other shaders. Not observed ingame, may only be used as a base.

position_color_lightmap

Similar to position_color, but includes a second sampler for lightmap calculations. Not observed ingame.

position_color_tex_lightmap

Similar to position_color_tex, but includes a second sampler for lightmap calculations. Not observed ingame.

position_tex_lightmap_color

Similar to position_tex_color, but includes a second sampler for lightmap calculations. Not observed ingame.

rendertype_text_intensity

Functionally the same as rendertype_text, except it uses the red value for every color in the texture calculation. Not observed ingame, may only be used for internal calculations. 

rendertype_text_intensity_see_through

Functionally the same as rendertype_text_see_through, except it uses the red value for every color in the texture calculation. Not observed ingame, may only be used for internal calculations.

 

Leave a Comment

Your email address will not be published.