Hello, This isn't the way VBOs work. Only one buffer can be bound per buffer target (and there's only GL_ARRAY_BUFFER_ARB for that kind of stuff) at any time, so all vertex attributes must be stored in the same VBO. What your code actually does is using the same data from your vboColourBuffer-array as vertex coordinates, texcoords, normals and colors. Regards, Marcel -- Marcel Heinz | < XXXX@XXXXX.COM > | PGP-KeyID: E78E9442 "Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint-Exupy
Hello, Oh, you are right. I forgot that there is a VBO binding point for every array type. Regrads, Marcel -- Marcel Heinz | < XXXX@XXXXX.COM > | PGP-KeyID: E78E9442 "Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint-Exupy
My app seems to work in windows xp pro under the .net framework 1.1 using vbos so I think it must be something wrong with my nvidia linux ogl drivers and/or mono. Not sure what to do about this now because there isn't a good way to know whether or not using vbos will work when my application starts up...it doesn't even know if it's in windows or linux... :( G!
So your terrain shifts orientation? It sounds like there's a 90 degree rotation on the whole thing? --- Strange
Yeah, only in linux, windows is fine. The x and z axis are meant to be longitude and latitude and y axis is height of the terrain. When I use vbos in linux the y axis is used for latitude and the z axis is used for height, which is very odd. It also looks like the winding of the triangle strip is backwards so a mountain looks like a pit. The only thing I can think to do is to try to render a square using vbos at initialisation then read some pixel colours from the back buffer and check if it's correct. If not then assume this bug is in effect and disable vbos... So say I draw a red square and the clear colour is black, if the orientation is wrong I will be reading black from the screen buffer instead of red. G!
I can't believe that VBO's are that broken on Linux. Indeed, I know that they are not, in general. Which leaves us with something in how you initialize Linux vs Windows which is different. A mixup in going from X11 coordinates to OpenGL maybe? (forgetting to flip Y). jbw
1.Vertex Buffer Object problem
Hello, I've just implement the ARB_vertex_buffer_objet in one my my program, all works perfectly, but ... All run Twice SLOWER than a normal loop. I create all things like that : GLuint vbo_v,vbo_nv...; glGenBuffersARB(1,&vbo_v); glBindBufferARB(GL_ARRAY_BUFFER_ARB,vbo_v); glBufferDataARB(GL_ARRAY_BUFFER_ARB,3*nbrv*sizeof(float),v,GL_STATIC_DRAW_AR B); glGenBuffersARB(1,&vbo_nv); glBindBufferARB(GL_ARRAY_BUFFER_ARB,vbo_nv); glBufferDataARB(GL_ARRAY_BUFFER_ARB,3*nbrv*sizeof(float),nv,GL_STATIC_DRAW_A RB); ... Where v and nv and pointers on 2 arrays (vertices and vertices normals) - i do the same with vertex color, tex coords ... glGenBuffersARB(1,&vbo_f); glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,vbo_f); glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB,3*nbrf*sizeof(int),f,GL_STATIC_D RAW_ARB); For indexs When i bind all that glEnableClientState(GL_COLOR_ARRAY); glBindBufferARB(GL_ARRAY_BUFFER_ARB,vbo_vc); glColorPointer(4,GL_UNSIGNED_BYTE,0,NULL); glEnableClientState(GL_NORMAL_ARRAY); glBindBufferARB(GL_ARRAY_BUFFER_ARB,vbo_nv); glNormalPointer(GL_FLOAT,0,NULL); glEnableClientState(GL_VERTEX_ARRAY); glBindBufferARB(GL_ARRAY_BUFFER_ARB,vbo_v); glVertexPointer(3,GL_FLOAT,0,NULL); // DRAWING glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,vbo_f); glDrawElements(GL_TRIANGLES,3*nbrf,GL_UNSIGNED_INT,NULL); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_COLOR_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); I have with a normal loop about 60 fps and 30 fps when using VBO I run on an AMD ATHLON 2Ghz 512Mo GeForce4MX All Works perfectly but TWICE slower than normal loop with glNormals, glVertex, glTexCoord ... Why ? Did i do something wrong ? Isn't vertex buffer objects are supposed to increase the number of fps and not make your programs run slower ? Help ! Thanks in advanced for your help
2.Vertex Arrays, Vertex Buffer Objects
Hi list. I implemented rendering using display lists, vertex arrays, and vertex buffer objects. And guess what was the faster ? ... display lists ! It should mean that I implemented badly those array stuff. For the VBO part, I'm quite sure that today drivers are not correctly implemented - systematically crash on some ATI hardware, even if extention is detected, poor perfs on nVidia. After all, it runs as fast as plain vertex arrays. For the VA part ... I guess all static geometry could be rendered using glLockArray() ... ? I think this is called compiled vertex array ? Is this an improvement compared to plain vertex arrays ? Will I have to go to VAR to achieve correct perfs ? Thx for enlightments SeskaPeel.
3.Changing vertex color after vertex buffer and index buffer definition
Hi, Say you have this custom vertex structure: struct CUSTOMVERTEX { float x, y, z; DWORD color; }; Is it possible once you've defined values for a vertex buffer using that structure to subsequently change the color for a vertex that you defined? If so, how? Thanks :)
4.Multiple objects in a single vertex buffer.
The book I'm reading shows as illustration example, multiple objects in a single v-buffer. These more primitive though: sphere, box and a cylinder. Is it wise to have a v-buffer handle more than one object?
5.how scale a pVB vertex buffer object ?
I have a vertex buff obj, it's a meshed(tessulated) square in D3DX8, Vertex *v; g_pd3dDevice->CreateVertexBuffer( g_nTriCount*3*sizeof(Vertex), D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_MANAGED, &g_pWallVB ); g_pWallVB->Lock( 0, 0, (BYTE**)&v, 0 ); float dX = 1.0f/(g_nNumVertsX-1); float dZ = 2.0f/(g_nNumVertsZ-1);//dz=1.0f/ int i = 0; for( int z = 0; z < (g_nNumVertsZ-1); ++z ) { for( int x = 0; x < (g_nNumVertsX-1); ++x ) { v[i].p = D3DXVECTOR3(10*x*dX, 0.0f, 10*z*dZ ); v[i].n = D3DXVECTOR3(0.0f, 1.0f, 0.0f); ++i; v[i].p = D3DXVECTOR3(10*x*dX, 0.0f, 10*(z+1)*dZ ); v[i].n = D3DXVECTOR3(0.0f, 1.0f, 0.0f); ++i; v[i].p = D3DXVECTOR3(10*(x+1)*dX, 0.0f, 10*(z+1)*dZ ); v[i].n = D3DXVECTOR3(0.0f, 1.0f, 0.0f); ++i; v[i].p = D3DXVECTOR3(10*x*dX, 0.0f, 10*z*dZ ); v[i].n = D3DXVECTOR3(0.0f, 1.0f, 0.0f); ++i; v[i].p = D3DXVECTOR3(10*(x+1)*dX, 0.0f, 10*(z+1)*dZ ); v[i].n = D3DXVECTOR3(0.0f, 1.0f, 0.0f); ++i; v[i].p = D3DXVECTOR3(10*(x+1)*dX, 0.0f, 10*z*dZ ); v[i].n = D3DXVECTOR3(0.0f, 1.0f, 0.0f); ++i; } } g_pWallVB->Unlock(); How can I rescale its size.
6. Vertex buffer objects: how to improve speed further ?
7. GL_OUT_OF_MEMORY ( vertex buffer objects )
8. Missing Function Definitions for Vertex Buffer Objects (VBOs) on Linux
Users browsing this forum: No registered users and 52 guest