Archive

Posts Tagged ‘GLSL’

Settingup Texture to read the Frame Buffer

April 26, 2008 Leave a comment

<good link http://www.mathematik.tu-dortmund.de/~goeddeke/gpgpu/saxpy_glsl.cpp>

These are basic steps to take

For each texture do the following things

1) Generate the texture 

glGenTextures(1, texId);

2) Then Bind the texture to what target you want 

glBindTexture( GL_TEXTURE_RECTANGLE_ARB, tex);

3) Setup the properties to avoid the wraping on edges, min-mapping,

glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
//clamp so that it does not excede where you do want to write
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP);

4) Use the  glTexImage2D to setup the properties like for format, type, height and width of the texture

 

Categories: C++, GLSL, Opengl Tags: , ,

OpenGl Shader Programming: Getting Started

March 19, 2008 Leave a comment

Download “The OpenGL Extension Wrangler Library” and put the files as described there.

Run glewinfo.exe to see if your graphics card supports the Opengl GLSL Shader library.

Try some code, I downloaded the program given my TA.

But there was error coming as

main.obj : error LNK2001: unresolved external symbol __imp____glewGetInfoLogARB
main.obj : error LNK2001: unresolved external symbol __imp____glewGetObjectParameterivARB
main.obj : error LNK2019: unresolved external symbol __imp__glewInit referenced in function “bool __cdecl init(void)” (?init@@YA_NXZ)
main.obj : error LNK2001: unresolved external symbol __imp____glewUniform1i
main.obj : error LNK2001: unresolved external symbol __imp____glewUniform4f
main.obj : error LNK2001: unresolved external symbol __imp____glewGetUniformLocation
main.obj : error LNK2001: unresolved external symbol __imp____glewUseProgram
main.obj : error LNK2001: unresolved external symbol __imp____glewLinkProgram
main.obj : error LNK2001: unresolved external symbol __imp____glewAttachShader
main.obj : error LNK2001: unresolved external symbol __imp____glewCreateProgram
main.obj : error LNK2001: unresolved external symbol __imp____glewCompileShader
main.obj : error LNK2001: unresolved external symbol __imp____glewShaderSource
main.obj : error LNK2001: unresolved external symbol __imp____glewCreateShader
Debug/test2.exe : fatal error LNK1120: 13 unresolved externals

To resolve this error I searched on the internet and found this

http://www.gamedev.net/community/forums/topic.asp?topic_id=472791

“Expand Configuration Properties>Linker>Input
add glew32.lib (for example) to the Additional Dependencies box.” by Matthughes

Categories: GLSL, Opengl Tags: , ,