Home » Community » Forums » » OpenGL FrameBuffer Object 201
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 OpenGL FrameBuffer Object 201
Post Reply 

example 2

GLenum mrt[] = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT0_EXT } // typo 2x *0_EXT ??
glDrawBuffers(2, mrt);

/Aki

 User Rating: 1015    Report this Post to a Moderator | Link

opps, my bad... I'll let Gaiiden know about the correction, good catch

 User Rating: 1936   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

What real world gaming examples are there for binding multiple textures to an FBO. Especially given that the textures must be the same size, and that the shaders used in the rendering are the same? Right?

Thanks.

 User Rating: 1025   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Using this technique on ATI drivers might be unsatisfying. I got this mail from devrel@ati.com in november '06:

---
MRTs with FBOs are really slow, and it appears to be because the driver is recompiling the shader every time you switch the number of draw buffers. We have an EPR against this issue, though I cannot say when it will be addressed.

The only workaround is to not change the number of draw buffers. That's not really possible with FBOs since you need a single draw buffer once you want to render to the backbuffer again. If you use pBuffers it can be worked around though in most cases since the number of draw buffers is specific to each context, and the pBuffer has a context of its own.
---

I don't know whether this issue is still there.


 User Rating: 1015    Report this Post to a Moderator | Link

glGetIntergeri(GL_MAX_COLOR_ATTACHMENTS, &maxbuffers);

glGetIntegeri you mean? :P

 User Rating: 1015    Report this Post to a Moderator | Link

101 and 201 great tutorial! straight forward and simple!

using latest glee and vs2005 having problem on compiling. does im the only one facing the problem? got it working anyway.

just want to share.. no need for freeglut, changing #include <cstdlib> to #include <stdlib.h> (put it on top) and removing libc.lib (in configuration) and everythings compiled/run perfectly.

great job rob! waiting for your tutorial on water/ocean shader and glsl shadow mapping. :)


 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Yer - very nice tute :)
You're doing one on water shaders?! Excellent!

 User Rating: 1093   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

Hi there,

When I tried to use MRT, I had a warning such as 'warning C7531: global variable gl_FragData requires "#extension GL_ARB_draw_buffers : enable" before use'. Then I added "#extension GL_ARB_draw_buffers : enable" on the first line in my fragment shader, I got another warning:"warning C7508: extension GL_ARB_draw_buffers not supported". Does anyone run into the same problem?

Thanks,

Ben

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I cannot download the source code of the examples due to some server error. can someone please send that to me at me_here_me@yahoo.com

regards

 User Rating: 1001   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

BenColumbus,
For the following GLSL pixel shader code:
#version 110
#extension GL_ARB_draw_buffers : enable

I am seeing the same warning you see. Does anyone have a fix? I'm using a Dell XPS laptop with a 6800.

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

hmm, i might be blind but where is the link to the sourcecode (didn't find it for the first tutorial either but then in the forum)?

 User Rating: 1020   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Quote:
Original post by ghostd0g
hmm, i might be blind but where is the link to the sourcecode (didn't find it for the first tutorial either but then in the forum)?


Well, currently, there is 2 versions of the tutorial on gamedev. First one is not "formated" and you can't find any link to the source code: http://www.gamedev.net/reference/articles/article2333.asp

The second one: http://www.gamedev.net/reference/programming/features/fbo2/ gives you a formated version with a nice "table of contents" on the right and an also very nice "Source code" icon (on the right too).

For the second example (named "MRT example"), don't forget to modify the shader "mrt.fs" with the code:

#extension GL_ARB_draw_buffers : enable

at the beginning. Else on certain cards the shader don't compile and you have the 2 same images in the 2 cubes (no shader called in fact).

For cyrfer and BenColumbus (too late no ?) try to update your driver. In my 6800 Go with new drivers it's ok.

 User Rating: 1031   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

aaah thx jmaupay. i realized that i was looking at the printer-friendly version ...

 User Rating: 1020   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Hi, thanks for the nice tutorial. I have a quick question regarding frame buffer objects. Im blending some points and disable the depth test. In this case do I still have to attach the depthbuffer or is there a more suitable renderbuffer to use?

Thanks

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

hi board

Im having trouble tourning MRT once i enable it.
What im trying to achieve is to store my eyespace depth in a second color texture
during my early-z pass and then disable the second colortexture.

I do :

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbColor);
GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT, GL_COLOR_ATTACHMENT1_EXT };
glDrawBuffers(2,buffers);

before the early-z and then just :

GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT };
glDrawBuffers(1,buffers);


after the early-z pass.

The problem is that all the subsequent passes still draw to COLOR_ATTACHMENT1, destroying my nicely formatted depth data.

Any ideas?

Greetz David





 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I tried to compile the code for linux or OS x (i dont have an access to a windows computer at all, sorry! :p) but the code is too customised to a particular setup, and for windows i guess, so i just gave up.

I am not ranting that people should provide setup for every available platform, and what about just using universal include paths: instead of "..\fish.h" just use "../fish.h" (dont worry windows can understand it!!! ;)). Why not use as much glut.h as possible. There are usually no problems when you download a code with dsp or sln you can copy a standard makefile.

Could anyone try make the code more platform independent please?

also is it possible to have it without glee?

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Hi ,

Thanks for the great tutorial. Ive modified the code to work in Linux. Im not sure how to share it on gamedev.

Regards
nithin

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: