public QuadShaderDeviceData(DX11RenderContext context) { string basepath = "VVVV.DX11.Nodes.effects.quad.fx"; DX11Effect effect = DX11Effect.FromResource(Assembly.GetExecutingAssembly(), basepath); quadshader = new DX11ShaderInstance(context, effect); texturevariable = quadshader.Effect.GetVariableBySemantic("INPUTTEXTURE").AsResource(); samplervariable = quadshader.Effect.GetVariableBySemantic("SAMPLERSTATE").AsSampler(); Quad quad = new Quad(); quad.Size = new Vector2(1.0f); quadgeometry = context.Primitives.QuadNormals(quad); quadlayouts = new List <InputLayout>(); for (int i = 0; i < 4; i++) { InputLayout layout; quadshader.SelectTechnique(i); bool res = quadgeometry.ValidateLayout(quadshader.GetPass(0), out layout); quadlayouts.Add(layout); } }
public void Update(IPluginIO pin, DX11RenderContext context) { if (quadshader == null) { string basepath = "VVVV.DX11.Nodes.effects.quad.fx"; DX11Effect effect = DX11Effect.FromResource(Assembly.GetExecutingAssembly(), basepath); quadshader = new DX11ShaderInstance(context, effect); texturevariable = quadshader.Effect.GetVariableBySemantic("INPUTTEXTURE").AsResource(); samplervariable = quadshader.Effect.GetVariableBySemantic("SAMPLERSTATE").AsSampler(); Quad quad = new Quad(); quad.Size = new Vector2(1.0f); quadgeometry = context.Primitives.QuadNormals(quad); quadlayouts = new List <InputLayout>(); for (int i = 0; i < 4; i++) { InputLayout layout; quadshader.SelectTechnique(i); bool res = quadgeometry.ValidateLayout(quadshader.GetPass(0), out layout); quadlayouts.Add(layout); } } if (this.spmax > 0) { if (!this.FOutLayer[0].Contains(context)) { this.FOutLayer[0][context] = new DX11Layer(); this.FOutLayer[0][context].Render = this.Render; } } }