/// <summary> /// Begins a Texture Cube Rendering Pass. /// </summary> /// <param name="texture"></param> /// <param name="face"></param> public void Begin(TextureCube colorTextureCube, DepthBuffer depthBuffer, TextureCubeFace face, ViewPort viewPort) { Gl.glBindFramebufferEXT(Gl.GL_FRAMEBUFFER_EXT, this.handle); Gl.glFramebufferTexture2DEXT(Gl.GL_FRAMEBUFFER_EXT, Gl.GL_COLOR_ATTACHMENT0_EXT, (int)face, colorTextureCube.Handle, 0); Gl.glFramebufferRenderbufferEXT(Gl.GL_FRAMEBUFFER_EXT, Gl.GL_DEPTH_ATTACHMENT_EXT, Gl.GL_RENDERBUFFER_EXT, depthBuffer.Handle); this.CheckStatus(Gl.glCheckFramebufferStatusEXT(Gl.GL_FRAMEBUFFER_EXT)); Gl.glPushAttrib(Gl.GL_VIEWPORT_BIT); this.device.ViewPort = viewPort; }
/// <summary> /// Binds a ColorBuffer and Depth Buffer. A Frame Buffer "must" be bound with a depth buffer if you intend on /// rendering geometry with this FrameBuffer. /// </summary> /// <param name="buffer"></param> /// <param name="depthBuffer"></param> public void Begin(ColorBuffer colorBuffer, DepthBuffer depthBuffer, ViewPort viewPort) { Gl.glBindFramebufferEXT(Gl.GL_FRAMEBUFFER_EXT, this.handle); Gl.glFramebufferRenderbufferEXT(Gl.GL_FRAMEBUFFER_EXT, Gl.GL_COLOR_ATTACHMENT0_EXT, Gl.GL_RENDERBUFFER_EXT, colorBuffer.Handle); Gl.glFramebufferRenderbufferEXT(Gl.GL_FRAMEBUFFER_EXT, Gl.GL_DEPTH_ATTACHMENT_EXT, Gl.GL_RENDERBUFFER_EXT, depthBuffer.Handle); this.CheckStatus(Gl.glCheckFramebufferStatusEXT(Gl.GL_FRAMEBUFFER_EXT)); this.width = colorBuffer.Width; this.height = colorBuffer.Height; Gl.glPushAttrib(Gl.GL_VIEWPORT_BIT); this.device.ViewPort = viewPort; }
/// <summary> /// Begins a FrameBuffer Pass. Binds a CubeTexture and a DepthBuffer as the RenderTargets. Will automatically set the /// devices Viewport to match the dimensions of the Texture. /// </summary> /// <param name="buffer"></param> /// <param name="depthBuffer"></param> public void Begin (TextureCube colorTextureCube, DepthBuffer depthBuffer, TextureCubeFace face) { this.Begin(colorTextureCube, depthBuffer, face, new ViewPort(0, 0, colorTextureCube.Width, colorTextureCube.Width)); }
/// <summary> /// Begins a Texture Cube Rendering Pass. /// </summary> /// <param name="texture"></param> /// <param name="face"></param> public void Begin (TextureCube colorTextureCube, DepthBuffer depthBuffer, TextureCubeFace face, ViewPort viewPort) { Gl.glBindFramebufferEXT (Gl.GL_FRAMEBUFFER_EXT , this.handle); Gl.glFramebufferTexture2DEXT (Gl.GL_FRAMEBUFFER_EXT , Gl.GL_COLOR_ATTACHMENT0_EXT, (int)face, colorTextureCube.Handle, 0); Gl.glFramebufferRenderbufferEXT(Gl.GL_FRAMEBUFFER_EXT, Gl.GL_DEPTH_ATTACHMENT_EXT, Gl.GL_RENDERBUFFER_EXT, depthBuffer.Handle); this.CheckStatus(Gl.glCheckFramebufferStatusEXT(Gl.GL_FRAMEBUFFER_EXT)); Gl.glPushAttrib(Gl.GL_VIEWPORT_BIT); this.device.ViewPort = viewPort; }
/// <summary> /// Begins a FrameBuffer Pass. Binds a Texture and a DepthBuffer as the RenderTargets. Will automatically set the /// devices Viewport to match the dimensions of the Texture. /// </summary> /// <param name="buffer"></param> /// <param name="depthBuffer"></param> public void Begin (Texture2D colorTexture, DepthBuffer depthBuffer) { this.Begin(colorTexture, depthBuffer, new ViewPort(0, 0, colorTexture.Width, colorTexture.Height)); }
/// <summary> /// Begins this Render Buffer with a Texture bound. Depth Buffer is required if rendering Geometry. /// </summary> /// <param name="texture"></param> public void Begin (Texture2D colorTexture, DepthBuffer depthBuffer, ViewPort viewPort) { Gl.glBindTexture (Gl.GL_TEXTURE_2D, colorTexture.Handle); Gl.glBindFramebufferEXT (Gl.GL_FRAMEBUFFER_EXT, this.handle); Gl.glFramebufferTexture2DEXT (Gl.GL_FRAMEBUFFER_EXT, Gl.GL_COLOR_ATTACHMENT0_EXT, Gl.GL_TEXTURE_2D, colorTexture.Handle, 0); Gl.glFramebufferRenderbufferEXT(Gl.GL_FRAMEBUFFER_EXT, Gl.GL_DEPTH_ATTACHMENT_EXT, Gl.GL_RENDERBUFFER_EXT, depthBuffer.Handle); this.CheckStatus(Gl.glCheckFramebufferStatusEXT(Gl.GL_FRAMEBUFFER_EXT)); this.width = colorTexture.Width; this.height = colorTexture.Height; Gl.glPushAttrib(Gl.GL_VIEWPORT_BIT); this.device.ViewPort = viewPort; }
/// <summary> /// Binds a ColorBuffer and Depth Buffer. A Frame Buffer "must" be bound with a depth buffer if you intend on /// rendering geometry with this FrameBuffer. /// </summary> /// <param name="buffer"></param> /// <param name="depthBuffer"></param> public void Begin (ColorBuffer colorBuffer, DepthBuffer depthBuffer) { this.Begin(colorBuffer, depthBuffer, new ViewPort(0, 0, colorBuffer.Width, colorBuffer.Height)); }
/// <summary> /// Begins a FrameBuffer Pass. Binds a CubeTexture and a DepthBuffer as the RenderTargets. Will automatically set the /// devices Viewport to match the dimensions of the Texture. /// </summary> /// <param name="buffer"></param> /// <param name="depthBuffer"></param> public void Begin(TextureCube colorTextureCube, DepthBuffer depthBuffer, TextureCubeFace face) { this.Begin(colorTextureCube, depthBuffer, face, new ViewPort(0, 0, colorTextureCube.Width, colorTextureCube.Width)); }
/// <summary> /// Begins a FrameBuffer Pass. Binds a Texture and a DepthBuffer as the RenderTargets. Will automatically set the /// devices Viewport to match the dimensions of the Texture. /// </summary> /// <param name="buffer"></param> /// <param name="depthBuffer"></param> public void Begin(Texture2D colorTexture, DepthBuffer depthBuffer) { this.Begin(colorTexture, depthBuffer, new ViewPort(0, 0, colorTexture.Width, colorTexture.Height)); }
/// <summary> /// Binds a ColorBuffer and Depth Buffer. A Frame Buffer "must" be bound with a depth buffer if you intend on /// rendering geometry with this FrameBuffer. /// </summary> /// <param name="buffer"></param> /// <param name="depthBuffer"></param> public void Begin(ColorBuffer colorBuffer, DepthBuffer depthBuffer) { this.Begin(colorBuffer, depthBuffer, new ViewPort(0, 0, colorBuffer.Width, colorBuffer.Height)); }