Quantcast
Channel: AMD Developer Forums: Message List
Viewing all articles
Browse latest Browse all 4104

Re: [W600] how to use DOPP to do color calibration

$
0
0

Hi,

 

the DOPP SDK contains sample code that illustrate how to acquire the desktop texture and how to render it using a shader. Please make sure to download the DOPP_SDK_1.0.zip from our web-page: http://developer.amd.com/tools-and-sdks/graphics-development/firepro-sdk/

 

Please have a look at the GLDOPPEngine class (DOPPSDK_1.0\DOPPEffectOpenGL\DOPPWin32\GLDOPPEngine.cpp). The GLDOPPEngine::initDOPP shows how to get access to the desktop texture and how to attach a present texture to a FBO. Later you can render the desktop texture to the FBO using your shader that changes the RGB values have the OS using the present texture as desktop.

 

1: get desktop texture

 

m_uiDesktopTexture = wglGetDesktopTextureAMD();

 

glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

...

 

2: Attach present texture to FBO:

 

m_uiPresentTexture = wglGenPresentTextureAMD();

....

 

glBindFramebuffer(GL_FRAMEBUFFER, m_uiFBO);

glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_uiPresentTexture, 0);

 

 

3: Render to present texture

 

 

// Bind FBO with attached present texture

glBindFramebuffer(GL_FRAMEBUFFER, m_uiFBO);

 

// Bind your shader

m_pShader->bind();

...

glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);

 

// Draw desktop texture using shader

glBindVertexArray(m_uiVertexArray);

glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

glBindVertexArray(0);


m_pShader->unbind();

 

You will find all this code in the DOPP SDK.

 

Please make sure to have windows Aero enabled.

 

 

DOPPenable.exe will simply activate DOPP since it is not on by default. You just need to do it once after the driver is installed.

 

Chris

 


Viewing all articles
Browse latest Browse all 4104

Trending Articles