Shader with Render-Target integration in OpenGL
Posted 14 June 2009 - 09:04 PM
I programmed Shaders that use some RenderTargets together in RenderMonkey, where they work well together. Now I am going to integrate them into an OpenGL project.
I think I understood the principles of integrating a Shader into an OpenGL project, except one thing: How are the RenderTargets handled? Do I have to declare them or something? Is there an example I can download?
Posted 14 June 2009 - 09:14 PM
Posted 14 June 2009 - 09:23 PM
Posted 15 June 2009 - 05:43 AM
Posted 15 June 2009 - 10:13 AM
I think I understood now, how to do this. As example I took the filter-demo and the tutorial on http://wiki.delphigl...amebufferobject. But there is still an error.
This is a piece of my global code:
GLuint fbobj, texobj;
const int NUM_FRAMEBUFFERS = 4;
and this is a piece of my initialization:
for (int i = 0; i < NUM_FRAMEBUFFERS; ++i)
The compiling works very well, but while running the program, the error "Unbehandelte Ausnahme bei 0x00000000 in GLSL Example.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x00000000.", which means an access violation while reading at position 0x00000000, shows up.
What is wrong here?
Posted 15 June 2009 - 10:25 AM
Posted 15 June 2009 - 10:29 AM
It occurs at the line glGenFramebuffersEXT(1, &fb[i].fbobj);
Posted 15 June 2009 - 04:27 PM
cout<<&fb[i].fbobj (or perhaps just fb[i].fbobj)
or to a file by using:
Using the console is the easier option, but I know that in C++ if you don't already have it open, getting it to while running a windowed app is a pain in the ass.
Good luck and don't hesitate to ask if you need more details. :)
EDIT: btw, just so you're not confused, the console is not usually open by default in openGL or directX examples, so in that case cout won't do anything. I would suggest looking around google for how to open the command console in C++. The code looks like a nightmare, but its suprisingly straight forward, and well worth the effort to be able to output any information you want to help you debug (or anything else you please).
EDIT AGAIN: oh wait... slightly misread your code. I'll make corrections to my suggestions later. I this I may see the problem.
ANOTHER EDIT: oh! haha :D I'm not sure, but try replacing the "++i" with "i++"
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
Posted 15 June 2009 - 06:24 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users