All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Common.MatDefs.Misc.UnshadedNodes.j3md Maven / Gradle / Ivy

The newest version!
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
                InputMappings {
                    modelPosition = Global.position
                    boneMatrices = MatParam.BoneMatrices
                    boneWeight = Attr.inHWBoneWeight
                    boneIndex = Attr.inHWBoneIndex
                }
                OutputMappings {
                    Global.position = modModelPosition
                }
            }
            ShaderNode UnshadedVert {
                Definition : CommonVert : Common/MatDefs/ShaderNodes/Common/CommonVert.j3sn
                InputMappings {
                    worldViewProjectionMatrix = WorldParam.WorldViewProjectionMatrix
                    modelPosition = Global.position.xyz
                    texCoord1 = Attr.inTexCoord : ColorMap || (LightMap && !SeparateTexCoord)
                    texCoord2 = Attr.inTexCoord2 : SeparateTexCoord
                    vertColor = Attr.inColor : VertexColor
                }
                OutputMappings {
                    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
                InputMappings {
                    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
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy