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.Streaming large amounts of data to vertex / fragment programs
Hi,
This is my first post here, I use OpenGL for programming as a hobby. I'm
french so please excuse my bad english :)
Here is my problem : in the context of an hardware accelerated raytracer
I get horrible performance when using vertex programs + fragment
programs + VBO.
My aim is to balance the calculations needed between the GPU and the CPU.
I get good performances using opengl fixed path with this method:
- get intersection points on the CPU
- set some non projective projection and render the diffuse pass,
lighting is done on the GPU
- set a perspective projection and modelview matching raytraced scene
and render specular pass with "imposters" (polygonal objects roughly
representing the raytraced scene)
I implemented another version using Cg :
- get intersection points on the CPU
- render scene once per light
The second aproach looks promising (especially for big scenes where the
specular pass becomes costly), but I get worse performances than with
fixed path.
Here are my results for about 57k intersections (less than 228k sent to
the GPU ; vertices weight 40 bytes (color, normal and position) for
fixed path version, and 48 bytes for Cg (color, normal, 2D position,
world space position)) ; each line gives the FPS with 1 and 4 lights :
- fixed path immediate mode :
FPS = (13.4721, 12.8229)
- fixed path, rendering defered through classic vertex arrays
FPS = (12.6694, 11.4943)
- fixed path, rendering defered through one big VBO
FPS = (11.4602, 10.8844)
- Cg, rendering defered through one big VBO
FPS = (8.65896, 3.77475)
The rendered data is all GL_QUADS of varying screen size (the raytracing
is done with some adaptive quadtree subdivision scheme).
Of course the scene looks better (no artifacts on specular highlights)
and Cg opens lots of interesting effect so I can live with the ~40% perf
dropdown, but why does it gets so bad when the number of lights increases ?
++
3.Update a stream in vertex buffer
I have a vertex buffer created with D3DUSAGE_WRITEONLY and
D3DPOOL_MANAGED flags. The FVF is as below
#define HD3D_FVF_PT_NML (D3DFVF_XYZ|D3DFVF_NORMAL)
I have a requirement where in I need to change the normal data in my
vertex buffer. This has to be done on every update cycle. I was
thinking that I could just Lock the vertex buffer again and overwrite
the existing normal data with the new one. But what I found was, when
I Lock second time, DirectX doesn't give me back all my vertex buffer
data, it just gives me some memory location to write. I am using '0'
as flag for Lock function since I didn't find any other flags
relevant.
To summerize, how can I overwrite a specific stream of data in vertex
buffers and leave the other untouched?
How efficient is this method over creating a whole new vertex buffer?
Is there any other better way?
Thanks,
Rajesh
4.Mutiple streams, single vertex buffer
can I put multiple streams in single vertex buffer. I would like to do vertex
tweening but instead of having vertex buffer for each stream, can I have
different part of vertex buffer as stream?
5.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.
6. vertex buffer, index buffer
7. Vertex shader and multi streams
8. Vertex blending to vertex shader