Skip to content

Commit 5bb9084

Browse files
committed
Try to integrate a test Material with a HLSL shader resource
It didn't work, hence veldrid/veldrid-spirv#2
1 parent e431c86 commit 5bb9084

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Game/Content/Shaders.cs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Game.Content
2+
{
3+
// TODO: Generate these constants via build script
4+
public static class Shaders
5+
{
6+
public const string Flat = "flat.hlsl";
7+
}
8+
}

Game/Game.cs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Engine.Assets;
77
using Engine.Components;
88
using Engine.Entities;
9+
using Game.Content;
910
using Veldrid;
1011
using Veldrid.OpenGL;
1112
using Veldrid.Sdl2;
@@ -58,6 +59,7 @@ protected override void Initialize()
5859
AssetDirectoryPaths.Add(AssetType.Shader, "Game.Content.Shaders");
5960

6061
World.Add(EntityFactory.Create<Camera>());
62+
World.Add(EntityFactory.Create(new Material("TestMaterial", Shaders.Flat)));
6163

6264
_commandList = ResourceFactory.CreateCommandList();
6365
}

0 commit comments

Comments
 (0)