Similar Threads:
1.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 :)
2.vertex buffer, index buffer
there is setup time internally both for a VB and for a particular
FVF/components. its less if you stay with the same format/stride, but there
is still some cost with switching just the VB.
minimize it if you can without heroic rewriting, but dont worry about it if
its a huge rewrite unless you measure thats a significant factor in your
particular performance signature.
tools are required for measurement. VTune or other static performance
analysis tool and a dynamic analysis tool like Pix that shows your API usage
per frame is good, you can zero in on most issues that way.
"Hanna-Barbera" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
> Hi,
>
> Does switching VB and IBs a lot cost too much?
> Is it better to store multiple things to be rendered in one VB/IB?
> Is it considered one of the costliest things, that must be dealt with.
> What about the size of the buffers.
> I know 16 bit indices are recommended, which is what I use.
>
> I know my question is abstract, but I would like to know in relative
> terms,
> compared to swithcing textures, switching shaders, and so on.
>
> Right now, my engine may be switching texture, and VB and IB per object.
> Shader are not switched so often cause the object's share the same shader.
>
> Thanks
>
>
3.Problem cleaning up after using vertex buffer.
Ok.. so I tried to take my first step to create a 3D object with VertexBuffers but I have a problem cleaning up. For some reason, after I do CreateVertexBuffer call and I try to exit the application, it keeps saying "reference count for D3D object is non-null". I am releasing the vertex buffer before I exit the application, and I'm using D3DPOOL_MANAGED for vertex buffer.
Am I missing an important step here? Tutorial doesn't really have any special clean up either but it works fine for tutorials and samples. If anyone can give me few pointers or things to watch out for, I would appreciate it. Or if anyone can tell me what I"m doing wrong, that would even be better. ^^; Thanks.
4.performance problem of the vertex buffer
I have a vertex buffer of about 4000 vertices and also a index buffer of
8000 indices. The problem: when I render all these vertices I got a very
poor performance, 1 or 2 frame per sec. But the cpu usage is only 4%. I
don't know why.
The vertex buffer and index buffer were created with D3DPOOL_MANAGED. I
tried D3DPOOL_SYSTEMMEM, but no improvement.
thanks.
5.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
6. Vertex Buffer Objects Problem
7. Large Vertex Buffers and Vertex Streams?
8. Vertex Arrays, Vertex Buffer Objects