publicreadonlyGUIContentlayerMapMaskText=newGUIContent("Layer Mask","Layer mask (multiplied by vertex color if enabled)");
publicreadonlyGUIContentlayerMapVertexColorText=newGUIContent("Use Vertex Color","If no layer mask is set, vertex color values between 0 and 1.0 are used as final mask.\nIf a layer mask is set, vertex color values are remapped between -1 and 1 and added to the mask (neutral at 0.5 vertex color).");
publicreadonlyGUIContentvertexColorModeText=newGUIContent("Vertex Color Mode","Mode multiply: vertex color is multiply with the mask. Mode additive: vertex color values are remapped between -1 and 1 and added to the mask (neutral at 0.5 vertex color).");
publicreadonlyGUIContentuseHeightBasedBlendV2Text=newGUIContent("Use Height Based Blend V2","Layer will be blended with the underlying layer based on the height.");
publicreadonlyGUIContentuseHeightBasedBlendV2Text=newGUIContent("Use V2","Layer will be blended with the underlying layer based on the height.");
publicreadonlyGUIContentinheritBaseNormalText=newGUIContent("Inherit Base Layer Normal","Inherit the normal from the base layer.");
publicreadonlyGUIContentinheritBaseHeightText=newGUIContent("Inherit Base Layer Height","Inherit the height from the base layer.");
publicreadonlyGUIContentinheritBaseColorText=newGUIContent("Inherit Base Layer Color","Inherit the base color from the base layer.");
publicreadonlyGUIContentinheritBaseNormalText=newGUIContent("Normal influence","Inherit the normal from the base layer.");
publicreadonlyGUIContentinheritBaseHeightText=newGUIContent("Heightmap influence","Inherit the height from the base layer.");
publicreadonlyGUIContentinheritBaseColorText=newGUIContent("BaseColor influence","Inherit the base color from the base layer.");
// // The idea here is to lerp toward vertex normal. This way when we don't want to inherit, we will combine layer 1/2/3 normal with a vertex normal which is neutral.
// // Blend layer 1/2/3 normals before combining to the base layer. Again we need to have a neutral value for base layer (vertex normal) in case all weights are zero.
// Compute how much we want to inherit from base layer normal base on the mask. Base layer always fully inherit from "itself" if it's the visible layer.
// Mask Values : Layer 1, 2, 3 are r, g, b. Always use layer0 parametrization for the mask
// Mutually exclusive with _HEIGHT_BASED_BLEND
#if defined(_LAYER_MASK_VERTEX_COLOR_MUL) // Used when no layer mask is set
#if defined(_LAYER_MASK_VERTEX_COLOR_MUL)
#elif defined(_LAYER_MASK_VERTEX_COLOR_ADD) || defined(_HEIGHT_BASED_BLEND_V2) // When layer mask is set, color is additive to enable user to override it.
#if defined(_LAYER_MASK_VERTEX_COLOR_MUL) // Used when no layer mask is set
inputMaskValues *= input.color.rgb;
#elif defined(_LAYER_MASK_VERTEX_COLOR_ADD) || defined(_HEIGHT_BASED_BLEND_V2) // When layer mask is set, color is additive to enable user to override it.