Original Post
🔒 Locked
GSL
Advertisement
The shading language is designed to write pixel shaders and vertex shaders with. If you want to do some post-proccesing effects, render to a texture and than manipulate the texture with pixel shaders.
Yes, but it's slowly...
For exemple, if I use the fonction : glReadBuffer, this one get data of the Video Ram to the Ram... That it slow... And stupid to do : Video Ram <-> Ram <-> Texture in video ram
I would like use GLSL to process my data, it is logical because the backbuffer is in the video card...
You are no ok with me ?
For exemple, if I use the fonction : glReadBuffer, this one get data of the Video Ram to the Ram... That it slow... And stupid to do : Video Ram <-> Ram <-> Texture in video ram
I would like use GLSL to process my data, it is logical because the backbuffer is in the video card...
You are no ok with me ?
You are right, glReadPixels() is quite slow. What you want to look into is "render to texture," and/or the "framebuffer object;" you should be able to find plenty of results if you Google for one phrase or the other.
Pixel shaders are designed to output fragment values to the final stage of the pipeline -- they are not, themselves, the final write stage. You cannot use them (alone) to provide precise blending control -- they cannot read back from the current framebuffer, although they can read from textures so thats how you can get around that to some extent. You can render to texture and bind that texture without incurring a CPU readback (and thus, without incurring the massive pipeline stall).
Pixel shaders are designed to output fragment values to the final stage of the pipeline -- they are not, themselves, the final write stage. You cannot use them (alone) to provide precise blending control -- they cannot read back from the current framebuffer, although they can read from textures so thats how you can get around that to some extent. You can render to texture and bind that texture without incurring a CPU readback (and thus, without incurring the massive pipeline stall).
You should use a Frame Buffer Object (ATI has a paper included in their oktober SDK, or see the other thread on these forums) to render the original image, then post-process it as a texture with your pixel shader.
For systems which do not support FBO's, you must unfortunately fall-back to p-buffers, which are kinda annoying as you will need an additional context for it, etc (but is works).
For systems which do not support FBO's, you must unfortunately fall-back to p-buffers, which are kinda annoying as you will need an additional context for it, etc (but is works).
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement