public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings) { if (this.FEnabled[0]) { context.CleanShaderStages(); } if (this.FLayerIn.IsConnected) { for (int i = 0; i < this.FLayerIn.SliceCount; i++) { this.FLayerIn[i][context].Render(this.FLayerIn.PluginIO, context, settings); } } }
public void Render(DX11RenderContext context) { if (this.lasthandle != this.Handle) { if (this.swapchain != null) { if (this.swapchain.Contains(context)) { this.swapchain.Dispose(context); } } this.lasthandle = this.Handle; } if (!this.swapchain.Contains(context)) { this.swapchain[context] = new DX11SwapChain(context, this.Handle, SlimDX.DXGI.Format.R8G8B8A8_UNorm, new SampleDescription(1, 0)); } if (this.resized) { this.swapchain[context].Resize(); } if (this.FEnabled[0]) { context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV,new SlimDX.Color4(0,0,0,0)); } if (this.FIn.PluginIO.IsConnected && this.FEnabled[0]) { int id = this.FIndex[0]; if (this.FIn[id].Contains(context)) { context.RenderTargetStack.Push(this.swapchain[context]); var rs = new DX11RenderState(); if (FAlpha[0]) { rs.Blend = DX11BlendStates.Instance.GetState("Blend"); context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV, FInBgColor[0].Color); } context.RenderStateStack.Push(rs); context.CleanShaderStages(); context.Primitives.FullTriVS.GetVariableBySemantic("TEXTURE").AsResource().SetResource(this.FIn[id][context].SRV); context.Primitives.FullScreenTriangle.Bind(null); context.Primitives.ApplyFullTri(); context.Primitives.FullScreenTriangle.Draw(); context.RenderStateStack.Pop(); context.RenderTargetStack.Pop(); context.CleanUpPS(); } } }
public void Render(IPluginIO pin, DX11RenderContext context, DX11RenderSettings settings) { if (this.spmax > 0) { if (this.FEnabled[0]) { context.CleanShaderStages(); QuadShaderDeviceData qd = quaddata[context]; qd.quadshader.SetBySemantic("VIEWPROJECTION", settings.ViewProjection); if (this.BeginQuery != null) { this.BeginQuery(context); } bool multisampler = this.FInSamplerState.SliceCount > 1 && this.FInTexture.IsConnected; if (this.FInState.SliceCount > 1 || this.FInTexture.SliceCount > 1 || multisampler) { if (this.FInTexture.IsConnected) { this.RenderTextured(context); } else { this.RenderBasic(context); } } else { if (this.FInTexture.IsConnected) { this.RenderInstancedTextured(context); } else { this.RenderInstanced(context); } } if (this.EndQuery != null) { this.EndQuery(context); } } } }
public void Render(DX11RenderContext context) { if (this.lasthandle != this.Handle) { if (this.swapchain != null) { if (this.swapchain.Contains(context)) { this.swapchain.Dispose(context); } } this.lasthandle = this.Handle; } if (!this.swapchain.Contains(context)) { this.swapchain[context] = new DX11SwapChain(context, this.Handle, SlimDX.DXGI.Format.R8G8B8A8_UNorm, new SampleDescription(1, 0),60,1); } if (this.resized) { this.swapchain[context].Resize(); } if (this.FEnabled[0]) { context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV,new SlimDX.Color4(0,0,0,0)); } if (this.FIn.IsConnected && this.spreadMax > 0 && this.FEnabled[0]) { int id = this.FIndex[0]; if (this.FIn[id].Contains(context) && this.FIn[id][context] != null) { context.RenderTargetStack.Push(this.swapchain[context]); var rs = new DX11RenderState(); if (FAlpha[0]) { rs.Blend = DX11BlendStates.Instance.GetState("Blend"); context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV, FInBgColor[0].Color); } context.RenderStateStack.Push(rs); context.CleanShaderStages(); context.Primitives.FullTriVS.GetVariableBySemantic("TEXTURE").AsResource().SetResource(this.FIn[id][context].SRV); EffectSamplerVariable samplervariable = context.Primitives.FullTriVS.GetVariableByName("linSamp").AsSampler(); SamplerState state = null; if (this.FInSamplerState.IsConnected) { state = SamplerState.FromDescription(context.Device, this.FInSamplerState[0]); samplervariable.SetSamplerState(0, state); } else { samplervariable.UndoSetSamplerState(0); } context.Primitives.FullScreenTriangle.Bind(null); context.Primitives.ApplyFullTri(); context.Primitives.FullScreenTriangle.Draw(); context.RenderStateStack.Pop(); context.RenderTargetStack.Pop(); context.CleanUpPS(); samplervariable.UndoSetSamplerState(0); //undo as can be used in other places if (state != null) { state.Dispose(); } } } }