shader()
{
    Cull("ccw")
//	Shaderquality(3) //gf3
    pass()
    {
        vertexshader(vshTerrain)
        Pixelshader("Terrain.psh")

        stream()
        {
            position( "float3", "SS_POSITION" )
        }
        tmu()
        {
            texture()
            {
                Image(txTerrainColor)
                addressfunc("clamp", "clamp", "clamp")
            }
        }

        tmu()
        {
            texture()
            {
                Image(txTerrainDetails)
            }
        }

        tmu()
        {
            texture()
            {
                Image(txTerrainCliffs)
            }
        }

        tmu()
        {
            texture()
            {
                Image(txTerrainCliffs)
            }
        }
    }

    lightpass()

    !include("..\\lights\\spot_shadowmap.mtt")

}

/*
shader()
{
    cull("ccw")

    // pass z mapa koloru i detalem
    pass()
    {
        stream()
        {
            position( "float3", "SS_POSITION" )

            texcoord( 0, "float3", "SS_POSITION" )
            texcoord( 1, "float3", "SS_POSITION" )
        }

        tmu()
        {
            texgen( "user_texgen" )

            texture()
            {
                usermap()
                addressfunc("clamp", "clamp", "clamp")
            }
        }

        tmu()
        {
            texgen( "user_texgen" )

            texture()
            {
                usermap()
            }
        }
    }

    // pass dla swiatel
    lightpass()

    !include("..\\templates\\lights\\spot_shadowmap.mtt")

    light("omni")
    {
        pass()
        {
            stream()
            {
                position("float3", "SS_POSITION")
                texcoord(0, "float3", "SS_POSITION")
            }

            tmu()
            {
                texgen("user_texgen")

                texture()
                {
                    usermap()
                    addressfunc("clamp", "clamp", "clamp")
                }

                colorop("mul", "texture", "tfactor", "current")
                alphaop("mul", "texture", "tfactor", "current")
            }

            !include("..\\templates\\lights\\omni_core.mtt")
        }
    }

    light("spot_spotmap")
    {
        pass()
        {
            stream()
            {
                position("float3", "SS_POSITION")
                texcoord( 0, "float3", "SS_POSITION" )
                texcoord( 1, "float3", "SS_POSITION" )
            }

            tmu()
            {
                texgen( "user_texgen" )

                texture()
                {
                    usermap()
                    addressfunc("clamp", "clamp", "clamp")
                }

                colorop("mul", "texture", "tfactor", "current")
                alphaop("mul", "texture", "tfactor", "current")
            }

            tmu()
            {
                texgen( "user_texgen" )

                texture()
                {
                    usermap()
                }

                colorop("mul", "texture", "current", "current")
                alphaop("mul", "texture", "current", "current")
            }

            tmu()
            {
                texgen("spotlight")

                texture()
                {
                    image("spot.png")
                    addressfunc("clamp", "clamp", "clamp")

                    filtering("linear_no_mip")  //FIXIT
                }

                colorop("mul", "texture", "current", "current")
                alphaop("mul", "texture", "current", "current")
            }

            tmu()
            {
                texgen("spotlight_z_att")

                texture()
                {
                    image("spot_z.png")
                    addressfunc("clamp", "clamp", "clamp")
                    filtering("linear_no_mip")
                }

                colorop("mul", "texture", "current", "current")
                alphaop("mul", "texture", "current", "current")
            }

            tfactor(1,1,1,1)
            colorgen("tfactor", "user", 0,0,0, "user", 0,0,0)

            blendfunc("one", "one")
            depthfunc("lequal", 0)

            blackfog()
        }
    }
}


shader()
{
    cull("ccw")

    // pass z mapa koloru i detalem
    pass()
    {
        stream()
        {
            position( "float3", "SS_POSITION" )

            texcoord( 0, "float3", "SS_POSITION" )
            texcoord( 1, "float3", "SS_POSITION" )
        }

        tmu()
        {
            texgen( "user_texgen" )

            texture()
            {
                usermap()
                addressfunc("clamp", "clamp", "clamp")
            }
        }

        tmu()
        {
            texgen( "user_texgen" )

            texture()
            {
                usermap()
            }
        }
    }

    // pass dla swiatel
    lightpass()

    !include("..\\templates\\lights\\spot_shadowmap.mtt")
    !include("..\\templates\\lights\\omni_2TMU.mtt")

    light("spot_spotmap")
    {
        pass()
        {
            stream()
            {
                position("float3", "SS_POSITION")
            }

            tmu()
            {
                texgen("spotlight")

                texture()
                {
                    image("spot.png")
                    addressfunc("clamp", "clamp", "clamp")

                    filtering("linear_no_mip")  //FIXIT
                }

                colorop("mul", "texture", "tfactor", "current")
                alphaop("mul", "texture", "tfactor", "current")
            }

            tmu()
            {
                texgen("spotlight_z_att")

                texture()
                {
                    image("spot_z.png")
                    addressfunc("clamp", "clamp", "clamp")
                    filtering("linear_no_mip")
                }

                colorop("mul", "texture", "current", "current")
                alphaop("mul", "texture", "current", "current")
            }

            tfactor(1,1,1,1)
            colorgen("tfactor", "user", 0,0,0, "user", 0,0,0)

            blendfunc("one", "one")
            depthfunc("lequal", 0)

            blackfog()
        }
    }
}

*/