render to vertex array

Started by
3 comments, last by michael84 16 years, 9 months ago
hi, it is almost the same problem than in this topic : http://www.gamedev.net/community/forums/topic.asp?topic_id=372387 the thing is that it is a bit old now (2006 the last answer).... I just want to take from my FBO the position of particle and put in a VBO for rendering. is the PBO/VBO is always the best solution? I heard about superbuffers?vertex texture? Is there any example available for render to vertex array (I can't find one!!!just people speacking about) thanks
Advertisement
"Render to Vertexbuffer in OpenGL (HowTo)" at:
http://www.devmaster.net/forums/showthread.php?t=7457

/Mike
thank's a lot!

I will read it and work on it.
hello,

I used the tutorial

I choose to copy to a PBO and after to the VBO

but it doesn't work!!!!.........................; :evil: :twisted: :x :( :cry:
is it the good way to do it?? look at my code :

void DrawGLScene(){	if (!p1->check() || !p2->check() || !p3->check() || !p4->check()){			// Calling glFinish() is only neccessary to get accurate timings,			// and we need a high number of iterations to avoid timing noise.    			glFinish();    			start = clock();			p1->resetForce();			p2->resetForce();			p3->resetForce();			p4->resetForce();			p1->computeForce();			p2->computeForce();			p3->computeForce();			p4->computeForce();			bindToText();			initFBO();			performComputation();			transferFromTexture(data,0);			transferFromTexture(data2,1);			transferFromTexture(force,2);			setParticle();				copyFBOtoPBO();	drawVBO();				glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT, target, 0, 0);			glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT1_EXT, target, 0, 0);			glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);			glFinish();			end = clock();			total += (end-start);			printf("total time = %lf\n",total);	}}


the function VBO/PBO are the same that the tutorial:
void copyFBOtoPBO(void){	glReadBuffer(attachmentpoints[flag]);	glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, vbo_vertices_handle);	glReadPixels(0, 0, texSize, texSize, GL_RGBA, GL_FLOAT, 0);	glReadBuffer(GL_NONE);	glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, 0 );}void drawVBO(void){	glBindBufferARB(GL_ARRAY_BUFFER_ARB, vbo_vertices_handle);	glEnableClientState(GL_VERTEX_ARRAY);	glVertexPointer  ( 4, GL_FLOAT,4*sizeof(float), (char *) 0);	glDisable(GL_LIGHTING);	glColor3f(1, 1, 1);	glDrawArrays( GL_TRIANGLES, 0,texSize*texSize );	glEnable(GL_LIGHTING);	glDisableClientState(GL_VERTEX_ARRAY);}


and I init the VBO in the main with :
void initVBO(void){	glGenBuffersARB(1, &vbo_vertices_handle);	glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, vbo_vertices_handle);	glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT, texSize*texSize*4*sizeof(float),NULL, GL_STREAM_DRAW_ARB );}


without the VBO when I do a transferFromTexture I have the good thing in the array "data" but with the VBO it is not the same....
I should just read from my Attachmentpoint and not write on it (with the VBO)..isn't it?
no one to help me pleaseeeeeeeeeeeeeeeeeeeeeeeee

it doesn't dysplay anything

This topic is closed to new replies.

Advertisement