![]() |
| [[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]] |
|
|
#1 |
|
DevMaster Editor
Join Date: Jan 2005
Posts: 54
|
Using OpenGL's Vertex Buffer Extension (ARB_vertex_buffer_object)
Author: Luke Philpot Description: This short tutorial explains how to use vertex buffers in OpenGL using the the ARB_vertex_buffer_object extension. This extension provides a method of storing vertex information in direct AGP memory which could drastically improve performance. Post your discussions/comments here by clicking on Add Reply. |
|
|
|
|
|
#2 |
|
New Member
Join Date: Jul 2003
Posts: 2
|
HI,
do you know if it's possible to use multitexture with this extension? How does it works? Thank you very much. |
|
|
|
|
|
#3 |
|
New Member
Join Date: Jan 2003
Posts: 7
|
Should be the same as using multitexturing with normal vertex arrays.
___________________________________________
On Demand IT Solutions - http://www.odits.com.au |
|
|
|
|
|
#4 |
|
New Member
Join Date: Jan 2003
Posts: 7
|
Hmmm, there are some bugs in the tutorial:
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 1); should be glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffer); And I forgot how to use glDeleteBuffersARB... but I'll let you guys figure out how to do that ;7
___________________________________________
On Demand IT Solutions - http://www.odits.com.au |
|
|
|
|
|
#5 |
|
New Member
Join Date: Jul 2003
Posts: 2
|
Hi,
here there is an example using multitexture. I hope it will be useful to somebody. Code:
Vicenç. vgarcia@salleurl.edu |
|
|
|
|
|
#6 |
|
New Member
Join Date: Jul 2003
Posts: 2
|
Here's an example using indexing with vertex-buffers:
Code:
note to self: NO, INDEX_ARRAYS have nothing to do with vertex-indices. They are used for color-indexing :) Regards, \\hornet |
|
|
|
|
|
#7 |
|
New Member
Join Date: Jul 2003
Posts: 2
|
...and a version using mapping instead
Code:
Note: There is no reason you shouldn't map both buffers at the same time - I just do it this way for simplicity. \\hornet |
|
|
|
|
|
#8 |
|
New Member
Join Date: Sep 2003
Posts: 22
|
Vertex Buffers modify input data.
Code:
After this code, object verticies change ! I have tried to use vertex array without and with this code and I have seen different results. Can anyone help me ? When I use vertex array with indicies, I have no problem. With vertex buffer all polygons are worst. |
|
|
|
|
|
#9 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
could you post the code where you draw the vertices including the glVertexPointer calls, etc. ?
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#10 |
|
New Member
Join Date: Sep 2003
Posts: 22
|
Now, I have solved the previous problem, but is it possible that I have more fps with vertex array ?
|
|
|
|
|
|
#11 |
|
New Member
Join Date: Sep 2003
Posts: 15
|
Hello
![]() I've been messing with VBO's ![]() First I use VBO to render the static scene data. Second I try using normal vertex arrays for the dynamic objects. But they don't show ![]() When I use glDeleteBuffersARB before using my normal vertex arrays, then they do render just fine.... Is there a way to make them show up without having to call glDeleteBuffers for every frame ? This is a huge performance drop of course ![]() Isn't there something like glUnBufferARB ??? Thanks. Kris. |
|
|
|
|
|
#12 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
do you map your buffers for writing ? i'm not sure wether that could somehow influence vertex array behaviour. why would you want to mix the two in the first place ??? in combination with vertex programs you should be able to elimnate the need for storing vertex data in application memory most of the time. i don't know anything about what you are doing so i'm just giving hints
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#13 |
|
New Member
Join Date: Sep 2003
Posts: 15
|
Here it is
![]() I'm using normal vertex arrays for the dynamic data. But I will probably change it, now that I think of it, I could use VBO for those too ![]() Code:
|
|
|
|
|
|
#14 |
|
New Member
Join Date: Sep 2003
Posts: 15
|
Well, after all, it probably isn't possible to use VBO for the dynamic data...
What penalty comes with uploading the data to the video memory ? Anybody knows ? I would have to upload new data almost every frame because I'm also using animated characters in the application. So, I'm still looking for an answer to my initial question ![]() Greetz. K |
|
|
|
|
|
#15 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
well, you upload it every frame anyway then... either way, VBOs or vertex arrays
![]() you have seperate buffers for vertices, normals, etc. ???????? that's not necessary at all. just use one buffer for all of them ![]() if you want i'll send you my implementation ( in D though )
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#16 |
|
New Member
Join Date: Sep 2003
Posts: 15
|
Somebody on OpenGL.org forum gave me a solution (simple actually):
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); Hehe ![]() Oh, yes, I know I can use only 1 arrays and then use the offset, but I prefer keeping data separated ![]() PS: What is D ? New language ? PPS: Yes, show me your implementation, I'm always happy to learn new stuff ![]() Kris |
|
|
|
|
|
#17 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
well, i guess you could do it that way
![]() yeah, i will send it your way. as to D. yep it's a new language. check it out. i think your email address might be hidden...
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#18 |
|
New Member
Join Date: Sep 2003
Posts: 15
|
email= AsshenArgon@hotmail.com (not used for MSN)
I've taken a look at D ![]() Looks cool, but for now I'll stick to Visual C++. Does there exists a graphical interface (like visual studio) for D ? K |
|
|
|
|
|
#19 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
there is one in development called DIDE but i think it would be no problem to integrate the D compiler into vs.net if you wanted to. i'll send you the code. i even found an old c++ version. might be more useful for you...
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#20 |
|
New Member
Join Date: Sep 2003
Posts: 15
|
Thank you very much
![]() |
|
|
|
|
|
#21 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
sorry that i didn't send it to you. you probably won't see it before friday night because i'm away till then. i will .rar it up as soon as i get back
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#22 |
|
New Member
Join Date: Sep 2003
Posts: 15
|
No problem
![]() I'm still experimenting anyway. I'm coding a little game (who isn't huh), and just figuring out which approach is faster for my specific needs ![]() K |
|
|
|
|
|
#23 |
|
New Member
Join Date: Aug 2004
Posts: 2
|
When I try
Code:
I want to know what the problem is. Thank you |
|
|
|
|
|
#24 |
|
DevMaster Staff
Join Date: Apr 2003
Location: Germany
Posts: 2,328
|
what is the error message ?
what is the error ? be more specific
___________________________________________
If Prolog is the answer, what is the question ? |
|
|
|
|
|
#25 | |
|
New Member
Join Date: Aug 2004
Posts: 2
|
Quote:
it's memory problem and I solve it. Thanks. But, I met another problem. It is Color array problem how can I update the color array regularly when I pushed the color array into GPU memory at vert begining. For example, I use Code:
If I update the content of colorptr, how can I refresh the GPU memory which is allocated for colorptr? Can I use: Code:
Thank you |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|