Material States

By default Bedrock defines a number of states in each .material file. These states each render something important, so we're going to walk through them here.

 

Important note: This page describes Minecraft: Win10 version 1.1.5. Everything on this page may change in a future version

 
 
Minecraft_ Windows 10 Edition 12-Sep-17 11_37_27 PM.png

terrain_opaque

The terrian_opaque state does a lot. It's responsible for the opaque parts of the terrain, as one might expect from its name. In the image to the left, things drawn with this state are green while everything else with the terrain material is drawn in red. You'll notice that leaves, grass, water, and other objects where alpha is a concern are not rendered with this state. The terrain_opaque state also sets up a lot of rendering state that is important for other states:

  • Specifying the vertex, geometry, and fragment shaders to be shaders/rendererchunk (with the appropriate extension)
  • Disables alpha writing
  • Sets up a sampler that performs texel anti-aliasing at sampler index 0, and a bilinear sampler in sampler index 1
  • Specifies that vertices need to have a position, color, and two UV coordinates
  • Declares that texture index 0 is the terrain atlas, texture index 1 is the lightmap, and texture index 2 is the season foliage texture (still trying to figure out what the season foliage is...
  • Defines the LOW_PRECISION, TEXEL_AA, and ATLAS_TEXTURE symbols
 
Minecraft_ Windows 10 Edition 12-Sep-17 11_49_37 PM.png

terrain_opAQue_seasons

Terrain_opaque_seasons (and other seasons states) are used to render leaves in biomes where there might be snow. In Minecraft (not the Java Edition), leaves become white as it snows, then fade back to their usual color when it's not snowing.

  • Extends terrain_opaque, so everything that is true there is true here except:
  • terrain_opaque_seasons defines a third sampler at sampler index 2. This one is a point sampler. In the shaders this is used to sample the SeasonFoliage texture, which is used to fade the leaves from green to white and back again
  • Defines the SEASONS symbol
 

terrain_blend

This state doesn't seem to render anything itself, but it does set up some things for states further down the inheritance chain:

  • Enables blending
  • Defines the BLEND symbol
 

terrain_water

This state sets up a number of values that