public void Create(Device1 device) { var shaderBytecode = ShaderBytecode.CompileFromFile("Resources\\PosNormTex3D.fx", "fx_4_0", shaderFlags: ShaderFlags.None); Effect = new Effect(device, shaderBytecode); Technique = Effect.GetTechniqueByIndex(0); var pass = Technique.GetPassByIndex(0); InputLayout = new InputLayout(device, pass.Description.Signature, InputLayouts.PosNormColTex); }
public void Create(Device1 device) { //Create effect var shaderSource = File.ReadAllText("Resources/Effects/PosColNorm3DSkinned.fx"); var shaderByteCode = ShaderBytecode.Compile(shaderSource, "fx_4_0", ShaderFlags.None, EffectFlags.None); Effect = new SharpDX.Direct3D10.Effect(device, shaderByteCode); Technique = Effect.GetTechniqueByIndex(0); //Create inputLayout var pass = Technique.GetPassByIndex(0); InputLayout = new InputLayout(device, pass.Description.Signature, InputLayouts.SkinnedVertex); }
public void Create(Device1 device) { CompilationResult shaderByteCode = ShaderBytecode.CompileFromFile(FxFileName, "fx_4_0", ShaderFlags.None); if (shaderByteCode.Bytecode == null) { throw new Exception($"Failed to compile shader, message: {shaderByteCode.Message}"); } InputParameters = CreateInputLayout(device); Effect = new Effect(device, shaderByteCode); Technique = Effect.GetTechniqueByIndex(0); var pass = Technique.GetPassByIndex(0); InputLayout = new InputLayout(device, pass.Description.Signature, InputParameters); }
public void Create(Device1 device) { var filepath = System.AppDomain.CurrentDomain.BaseDirectory; filepath += "\\Resources\\Shaders\\PosNormTex3D.fx"; var shaderBytecode = ShaderBytecode.CompileFromFile(filepath, "fx_4_0", shaderFlags: ShaderFlags.None); Effect = new Effect(device, shaderBytecode); Technique = Effect.GetTechniqueByIndex(0); var pass = Technique.GetPassByIndex(0); // InputLayout = new InputLayout(device, pass.Description.Signature, InputLayouts.PosNormTex); InputLayout = new InputLayout(device, pass.Description.Signature, InputLayouts.PosNormColTex); }
public override void Initialize() { CompilationResult result = ShaderBytecode.CompileFromFile("./Resources/Shaders/PhysicsDebug.fx", "fx_4_0"); if (result.HasErrors) { return; } Effect = new Effect(Context.Device, result.Bytecode); Technique = Effect.GetTechniqueByIndex(0); InputElement[] vertexLayout = { new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0, InputClassification.PerVertexData, 0) }; InputLayout = new InputLayout(Context.Device, Technique.GetPassByIndex(0).Description.Signature, vertexLayout); LoadShaderVariables(); }