{
  "materials": {
    "version": "1.0.0",

    "terrain_base": {
      "vertexShader": "shaders/renderchunk.vertex",
      "vrGeometryShader": "shaders/renderchunk.geometry",
      "fragmentShader": "shaders/renderchunk.fragment",

      "+defines": [ "LOW_PRECISION", "TEXEL_AA", "ATLAS_TEXTURE" ],
      "+states": [ "DisableAlphaWrite" ],

      "+samplerStates": [
        {
          "samplerIndex": 0,
          "textureFilter": "TexelAA"
        },
        {
          "samplerIndex": 1,
          "textureFilter": "Bilinear"
        },
        {
          "samplerIndex": 3,
          "textureFilter": "Point"
        },
        {
          "samplerIndex": 4,
          "textureFilter": "Point"
        }
      ],

      "vertexFields": [
        { "field": "Position" },
        { "field": "UV1" },
        { "field": "Color" },
        { "field": "UV0" }
      ],
      "msaaSupport": "Both",

      "variants": [
        { "fog": { "+defines": [ "FOG" ] } },
        { "lit": { "+defines": [ "ALWAYS_LIT" ] } },
        { "underwater": { "+defines": [ "FOG" ] } },
        { "fog.underwater": {} },
        { "fading": { "+defines": [ "FOG", "ALLOW_FADE" ] } }
      ]
    },
    "terrain_opaque:terrain_base": {

      "+variants": [
        { "underlava": { "+states": [ "DisableCulling" ] } }
      ]
    },
    "terrain_opaque_seasons:terrain_base": {
      "+defines": [ "SEASONS" ],
      "+samplerStates": [
        {
          "samplerIndex": 0,
          "textureFilter": "TexelAA"
        },
        {
          "samplerIndex": 1,
          "textureFilter": "Bilinear"
        },
        {
          "samplerIndex": 2,
          "textureFilter": "Point"
        }
      ]

    },

    "terrain_blend:terrain_base": {
      "+defines": [ "BLEND" ],
      "depthFunc": "LessEqual",
      "+states": [
        "Blending"
      ],
      "+variants": [
        { "underwater": { } },
        { "fog.underwater": { } }
      ]
    },

    "terrain_blend_far:terrain_blend": {
      "+defines": [ "FOG" ]
    },

    "terrain_blend_no_culling:terrain_blend": {
      "+states": [
        "DisableCulling"
      ]
    },

    "terrain_doubleside:terrain_base": {},
    "terrain_alpha_single_side:terrain_base": {
      "+defines": [ "ALPHA_TEST" ],
      "+states": [ "DisableCulling", "EnableAlphaToCoverage" ]
    },
    "terrain_alpha_seasons:terrain_base": {
      "+defines": [ "ALPHA_TEST", "SEASONS" ],
      "+states": [ "DisableCulling", "EnableAlphaToCoverage" ],
      "+samplerStates": [
        {
          "samplerIndex": 0,
          "textureFilter": "TexelAA"
        },
        {
          "samplerIndex": 1,
          "textureFilter": "Bilinear"
        },
        {
          "samplerIndex": 2,
          "textureFilter": "Point"
        }
      ]

    },
    "terrain_alpha:terrain_alpha_single_side": {
      // z-fighting fix
      "depthBias": 0.0,
      "slopeScaledDepthBias": 0.1,
      "depthBiasOGL": 0.0,
      "slopeScaledDepthBiasOGL": 0.5
    },
    "terrain_far:terrain_base": {
      "+defines": [
        "FOG",
        "LOW_PRECISION"
      ]
    },
    "terrain_far_alpha_single_side:terrain_base": {
      "+defines": [
        "FOG",
        "LOW_PRECISION"
      ]
    },
    "terrain_seasons_far:terrain_opaque_seasons": {
      "+defines": [
        "FOG",
        "LOW_PRECISION"
      ]
    },
    "terrain_seasons_far_alpha:terrain_opaque_seasons": {
      "+defines": [
        "FOG",
        "LOW_PRECISION",
        "SEASONS_FAR"
      ]
    },
    "terrain_inside_block": {
      "depthFunc": "LessEqual",

      "vertexShader": "shaders/position.vertex",
      "vrGeometryShader": "shaders/position.geometry",
      "fragmentShader": "shaders/current_color.fragment",
      "vertexFields": [
        { "field": "Position" }
      ],
      "msaaSupport": "Both"

    }

  }
}
