예제 #1
0
파일: Material.cs 프로젝트: Zamir7/urho
 public static Material FromColor(Color color)
 {
     var material = new Material();
     var cache = Application.Current.ResourceCache;
     material.SetTechnique(0, color.A == 1 ? CoreAssets.Techniques.NoTexture : CoreAssets.Techniques.NoTextureAlpha, 1, 1);
     material.SetShaderParameter("MatDiffColor", color);
     return material;
 }
예제 #2
0
파일: Material.cs 프로젝트: sami1971/urho
        public static Material FromColor(Color color)
        {
            var material = new Material();
            var cache    = Application.Current.ResourceCache;

            material.SetTechnique(0, color.A == 1 ? CoreAssets.Techniques.NoTexture : CoreAssets.Techniques.NoTextureAlpha, 1, 1);
            material.SetShaderParameter("MatDiffColor", color);
            return(material);
        }
예제 #3
0
        public static Material FromColor(Color color, bool unlit)
        {
            var   material  = new Material();
            var   cache     = Application.Current.ResourceCache;
            float tolerance = 0.001f;

            if (unlit)
            {
                material.SetTechnique(0, Math.Abs(color.A - 1) < tolerance ? CoreAssets.Techniques.NoTextureUnlit : CoreAssets.Techniques.NoTextureUnlitAlpha, 1, 1);
            }
            else
            {
                material.SetTechnique(0, Math.Abs(color.A - 1) < tolerance ? CoreAssets.Techniques.NoTexture : CoreAssets.Techniques.NoTextureAlpha, 1, 1);
            }
            material.SetShaderParameter("MatDiffColor", color);
            return(material);
        }