MaterialDef UnshadedNodes {
    MaterialParameters {
        Texture2D ColorMap
        Texture2D LightMap
        Color Color (Color) 
        Boolean VertexColor (UseVertexColor) 
        Boolean SeparateTexCoord
        Float AlphaDiscardThreshold (AlphaTestFallOff) 
        Int NumberOfBones
        Matrix4Array BoneMatrices
    }
    Technique {
        WorldParameters {
            WorldViewProjectionMatrix
            WorldViewMatrix
        }
        VertexShaderNodes {
            ShaderNode GpuSkinning {
                Definition : BasicGPUSkinning : Common/MatDefs/ShaderNodes/HardwareSkinning/HardwareSkinning.j3sn
                Condition : NumberOfBones
                InputMapping {
                    modelPosition = Global.position
                    boneMatrices = MatParam.BoneMatrices
                    boneWeight = Attr.inHWBoneWeight
                    boneIndex = Attr.inHWBoneIndex
                }
                OutputMapping {
                    Global.position = modModelPosition
                }
            }
            ShaderNode UnshadedVert {
                Definition : CommonVert : Common/MatDefs/ShaderNodes/Common/CommonVert.j3sn
                InputMapping {
                    worldViewProjectionMatrix = WorldParam.WorldViewProjectionMatrix
                    modelPosition = Global.position.xyz
                    texCoord1 = Attr.inTexCoord : ColorMap || (LightMap && !SeparateTexCoord)
                    texCoord2 = Attr.inTexCoord2 : SeparateTexCoord
                    vertColor = Attr.inColor : VertexColor
                }
                OutputMapping {
                    Global.position = projPosition
                }
            }
        }
        FragmentShaderNodes {
            ShaderNode MatColorMult {
                Definition : ColorMult : Common/MatDefs/ShaderNodes/Basic/ColorMult.j3sn
                InputMappings {
                    color1 = MatParam.Color
                    color2 = Global.outColor
                }
                OutputMappings {
                    Global.outColor = outColor
                }
                Condition : Color
            }
            ShaderNode VertColorMult {
                Definition : ColorMult : Common/MatDefs/ShaderNodes/Basic/ColorMult.j3sn
                InputMappings {
                    color1 = UnshadedVert.vertColor
                    color2 = Global.outColor
                }
                OutputMappings {
                    Global.outColor = outColor
                }
                Condition : VertexColor
            }
            ShaderNode ColorMapTF {
                Definition : TextureFetch : Common/MatDefs/ShaderNodes/Basic/TextureFetch.j3sn
                InputMappings {
                    texCoord = UnshadedVert.texCoord1
                    textureMap = MatParam.ColorMap
                }
                OutputMappings {
                }
                Condition : ColorMap
            }
            ShaderNode ColorMapMult {
                Definition : ColorMult : Common/MatDefs/ShaderNodes/Basic/ColorMult.j3sn
                InputMappings {
                    color1 = ColorMapTF.outColor
                    color2 = Global.outColor
                }
                OutputMappings {
                    Global.outColor = outColor
                }
                Condition : ColorMap
            }
            ShaderNode AlphaDiscardThreshold {
                Definition : AlphaDiscard : Common/MatDefs/ShaderNodes/Basic/AlphaDiscard.j3sn
                Condition : AlphaDiscardThreshold
                InputMapping {
                    alpha = Global.outColor.a
                    threshold = MatParam.AlphaDiscardThreshold
                }
            }
            ShaderNode LightMapTF {
                Definition : TextureFetch : Common/MatDefs/ShaderNodes/Basic/TextureFetch.j3sn
                InputMappings {
                    textureMap = MatParam.LightMap
                    texCoord = UnshadedVert.texCoord2 : SeparateTexCoord
                    texCoord = UnshadedVert.texCoord1 : !SeparateTexCoord
                }
                OutputMappings {
                }
                Condition : LightMap
            }
            ShaderNode LightMapMult {
                Definition : ColorMult : Common/MatDefs/ShaderNodes/Basic/ColorMult.j3sn
                OutputMappings {
                    Global.outColor = outColor
                }
                InputMappings {
                    color1 = LightMapTF.outColor
                    color2 = Global.outColor
                }
                Condition : LightMap
            }
        }
    }
}