public RenderTexture(int width, int height)
 {
     view          = new View(new Viewport(0, height, width, 0), new Vector2(0, 0), new Vector2(width, height));
     depthBuffer   = new DepthBuffer(width, height);
     framebuffer   = new Framebuffer();
     deviceTexture = new DeviceTexture(DefaultShader.DEFFAULT_TEXTURE_UNIFORM_NAME, width, height, false);
     deviceTexture.Bind();
     framebuffer.Bind();
     deviceTexture.CopyRawData(IntPtr.Zero, 0);
     framebuffer.AttachDepthBuffer(depthBuffer);
     framebuffer.AttachTexture(deviceTexture);
     deviceTexture.Unbind();
     framebuffer.Use();
     framebuffer.Check();
     texture = Texture.FromDeviceTexture(deviceTexture);
     framebuffer.Unbind();
 }
Exemplo n.º 2
0
 public void Set(ShaderPipeline pipeline)
 {
     deviceTexture.Bind();
     deviceTexture.Set(pipeline);
     deviceTexture.Unbind();
 }