static FloorComponent() { VertexShader.CreateFromFile("res/shader/FloorVertexShader.hlsl"); PixelShader.CreateFromFile("res/shader/FloorPixelShader.hlsl"); VertexLayout.Create(new VertexElement[] { new VertexElement("POSITION", 0, Format.Float3, 0, 0, VertexElement.Classification.VertexData, 0), new VertexElement("NORMAL", 0, Format.Float3, 1, 0, VertexElement.Classification.VertexData, 0), new VertexElement("TEXCOORD", 0, Format.Float2, 2, 0, VertexElement.Classification.VertexData, 0), }, VertexShader); GraphicsModel.CreateBillBoard(); GraphicsModel.Texture = new Texture2D(); GraphicsModel.Texture.Create("res/texture/wall.png", Accessibility.None); Program.ResourceManager.Register("res/shader/FloorVertexShader.hlsl", (path) => VertexShader); Program.ResourceManager.Load("res/shader/FloorVertexShader.hlsl"); Program.ResourceManager.Register("res/shader/FloorPixelShader.hlsl", (path) => PixelShader); Program.ResourceManager.Load("res/shader/FloorPixelShader.hlsl"); Program.ResourceManager.Register("FloorVertexLayout", (path) => VertexLayout); Program.ResourceManager.Load("FloorVertexLayout"); Program.ResourceManager.Register("FloorGraphicsModel", (path) => GraphicsModel); Program.ResourceManager.Load("FloorGraphicsModel"); }
static AircraftFlameComponent() { VertexShader.CreateFromFile("res/shader/AircraftFlameVertexShader.hlsl"); PixelShader.CreateFromFile("res/shader/AircraftFlamePixelShader.hlsl"); VertexLayout.Create(new VertexElement[] { new VertexElement("POSITION", 0, Format.Float3, 0, 0, VertexElement.Classification.VertexData, 0), new VertexElement("TEXCOORD", 0, Format.Float2, 1, 0, VertexElement.Classification.VertexData, 0), }, VertexShader); Textures.Create("res/texture/flame.dds", Accessibility.None); GraphicsModel.CreateBillBoard(); }
static GunFlushComponent() { VertexShader.CreateFromFile("res/shader/GunFlushVertexShader.hlsl"); PixelShader.CreateFromFile("res/shader/GunFlushPixelShader.hlsl"); VertexLayout.Create(new VertexElement[] { new VertexElement("POSITION", 0, Format.Float3, 0, 0), new VertexElement("TEXCOORD", 0, Format.Float2, 1, 0), }, VertexShader); GraphicsModel.CreateBillBoard(); GraphicsModel.Texture = new Texture2D(); GraphicsModel.Texture.Create("res/texture/flash.dds", Accessibility.None); }
static ExplosionComponent() { VertexShader.CreateFromFile("res/shader/ExplosionVertexShader.hlsl"); PixelShader.CreateFromFile("res/shader/ExplosionPixelShader.hlsl"); VertexLayout.Create(new VertexElement[] { new VertexElement("POSITION", 0, Format.Float3, 0, 0, VertexElement.Classification.VertexData, 0), new VertexElement("TEXCOORD", 0, Format.Float2, 1, 0, VertexElement.Classification.VertexData, 0), }, VertexShader); for (int i = 0; i < TextureCount; i++) { Textures[i] = new Texture2D(); Textures[i].Create(string.Format("res/texture/explos/explos ({0}).png", i + 1), Accessibility.None); } GraphicsModel.CreateBillBoard(); }