![]() ![]() This default set of buffers is called the window-system-provided framebuffer. In normal rendering there is a font-buffer, a back-buffer, a depth buffer and (optionally) a stencil buffer allocated for you when you create the OpenGL graphics context associated with your window. Pixel buffer (pbuffers for short) are fixed-function off-screen memory areas on the video card that replace the normal back-buffer as the destination for rendering. In this article we’re going to talk about scenario number three exclusively as this is approach most likely taken by your existing code base. ![]() This is the best since no copies are involved. Render to the texture image directly on the video card.This is better since it keeps the pixel data on the video card, but it is still making a copy. Render to back buffer, copy the pixels to the texture image via glTexCopy2D.This isn’t very performant since the pixel data is moving from video card, back to CPU ram, and then back to the video card again. Render to back buffer, read the pixels back via glReadPixels, and then set the texture image using those pixels via glTexImage2d or glTexSubImage2d.There a few ways you could have done this in your fixed-function applications: It involves taking the results of one rendering pass and using those produced pixels as a texture image in another rendering pass. Render to texture is used in a variety of graphical techniques including shadow mapping, multi-pass rendering and other advanced visual effects. In this article I’m going to talk about one of those advanced features, render-to-texture. Welcome back! Last time we talked about texturing, lighting and geometry in regards to porting fixed function OpenGL to Modern OpenGL and while it covered the basic features in OpenGL programs, it left out a lot of advanced techniques that your fixed-function code may have used. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |