e****r 发帖数: 166 | 1 can opengl read the rendered scene not from frame buffer, but rather from
an offiline buffer, the reason for this is if you read from frame buffer,
you will get trash pixel value if your window is overlaping, so it's better
to do it 'offline', but seems glreadpixel can only support framebuffer mode.
any tricks? | l**p 发帖数: 474 | 2 You can render to a P-buffer, and then read back.
New graphics cards support this feature.
【在 e****r 的大作中提到】 : can opengl read the rendered scene not from frame buffer, but rather from : an offiline buffer, the reason for this is if you read from frame buffer, : you will get trash pixel value if your window is overlaping, so it's better : to do it 'offline', but seems glreadpixel can only support framebuffer mode. : any tricks?
| e****r 发帖数: 166 | 3 thanks man, seems i have to use wgl extension, never touched it before,
if i have time i will implement it.
better
mode.
【在 l**p 的大作中提到】 : You can render to a P-buffer, and then read back. : New graphics cards support this feature.
| l**p 发帖数: 474 | 4 to Init PBuffer
void InitPbuffer(){
m_glhdc = wglGetCurrentDC();
m_glhrc = wglGetCurrentContext();
//-------------------------------------------------------------------------
// Create a p-buffer for off-screen rendering.
//-------------------------------------------------------------------------
pbuffer.hpbuffer = NULL;
pbuffer.width = m_nWndWidth;
pbuffer.height = m_nWndHeight;
//
// Define the minimum pixel format requirements we will need for our
// p-buffer. A p-buffer is just like a fram
【在 e****r 的大作中提到】 : thanks man, seems i have to use wgl extension, never touched it before, : if i have time i will implement it. : : better : mode.
| e****r 发帖数: 166 | 5 thanks again, i also found some sample code from google,
i didn't use windows api to program, pure opengl/glut,
so i have to figure out how to adapt it to fit my program,
the frame work is there already, shouldn't be too tedious i guess.
【在 l**p 的大作中提到】 : to Init PBuffer : void InitPbuffer(){ : m_glhdc = wglGetCurrentDC(); : m_glhrc = wglGetCurrentContext(); : //------------------------------------------------------------------------- : // Create a p-buffer for off-screen rendering. : //------------------------------------------------------------------------- : pbuffer.hpbuffer = NULL; : pbuffer.width = m_nWndWidth; : pbuffer.height = m_nWndHeight;
|
|