コード例 #1
0
ファイル: Skybox.cs プロジェクト: uzbekdev1/veldrid
 public static Skybox LoadDefaultSkybox()
 {
     return(new Skybox(
                Image.Load <Rgba32>(AssetHelper.GetPath("Textures/cloudtop/cloudtop_ft.png")),
                Image.Load <Rgba32>(AssetHelper.GetPath("Textures/cloudtop/cloudtop_bk.png")),
                Image.Load <Rgba32>(AssetHelper.GetPath("Textures/cloudtop/cloudtop_lf.png")),
                Image.Load <Rgba32>(AssetHelper.GetPath("Textures/cloudtop/cloudtop_rt.png")),
                Image.Load <Rgba32>(AssetHelper.GetPath("Textures/cloudtop/cloudtop_up.png")),
                Image.Load <Rgba32>(AssetHelper.GetPath("Textures/cloudtop/cloudtop_dn.png"))));
 }
コード例 #2
0
 public static Skybox LoadDefaultSkybox()
 {
     return(new Skybox(
                new ImageSharpTexture(AssetHelper.GetPath("Textures/cloudtop/cloudtop_ft.png")),
                new ImageSharpTexture(AssetHelper.GetPath("Textures/cloudtop/cloudtop_bk.png")),
                new ImageSharpTexture(AssetHelper.GetPath("Textures/cloudtop/cloudtop_lf.png")),
                new ImageSharpTexture(AssetHelper.GetPath("Textures/cloudtop/cloudtop_rt.png")),
                new ImageSharpTexture(AssetHelper.GetPath("Textures/cloudtop/cloudtop_up.png")),
                new ImageSharpTexture(AssetHelper.GetPath("Textures/cloudtop/cloudtop_dn.png"))));
 }
コード例 #3
0
        public static byte[] LoadBytecode(GraphicsBackend backend, string setName, ShaderStages stage)
        {
            string stageExt = stage == ShaderStages.Vertex ? "vert" : "frag";
            string name     = setName + "." + stageExt;

            if (backend == GraphicsBackend.Vulkan || backend == GraphicsBackend.Direct3D11)
            {
                string bytecodeExtension = GetBytecodeExtension(backend);
                string bytecodePath      = AssetHelper.GetPath(Path.Combine("Shaders", name + bytecodeExtension));
                if (File.Exists(bytecodePath))
                {
                    return(File.ReadAllBytes(bytecodePath));
                }
            }

            string extension = GetSourceExtension(backend);
            string path      = AssetHelper.GetPath(Path.Combine("Shaders.Generated", name + extension));

            return(File.ReadAllBytes(path));
        }