STREAM_DRAW vs DYNAMIC_DRAW

Could somebody explain the difference between the two? an usage example would be nice. I’ve tested both under ATI hardware and got similar performance.

Stream means you are going to create it once, set it once, and use it once. Dynamic means you are going to create it once, change it a lot, and use it a lot. Static means you are going to create it once, set it once, and use it a lot.

But, these are just usage hints to the driver to tell it how you are going to be using the buffer. The driver is free to implement them the same way.

Sounds like stream is what will be used for displacement mapping once uber-buffers appear. Output the fragment program to a vertex buffer, which is used to tessellate the object, then after rendering release the buffer. Repeat process. (At least, that’s how I understand it works based on one of the GDC presentations. . .)

Ostsol, your usage pattern would be realized by DYNAMIC_COPY, I think.

Originally posted by Hampel:
Ostsol, your usage pattern would be realized by DYNAMIC_COPY, I think.

Well, like I intimated, I’m not entirely sure. . . :stuck_out_tongue: Here’s what the GDC presentation says, though:

1st pass
-Displacement fragment shader
-Output to Vertex, Normal, TexCoord Buffer

2nd pass
-Vertex shader uses displaced Vertex Buffer
-Fragment shader does bump mapped lighting
http://www.ati.com:80/developer/gdc/GDC2003-DisplacementMapping.pdf http://www.ati.com:80/developer/gdc/GDC2003-DisplacementMappingNotes.pdf

(Sorry for taking the thread OT. . .)

I believe the difference between STREAM and DYNAMIC is that you will fill STREAM with data, and then render it, and then not return to it. Meanwhile, DYNAMIC means you might re-render the data after a little while, but you’re likely to re-write the data every so often. Last, STATIC means you re-write the data very seldom (or not at all) and render it a lot.

The way I think about it, write:render is something like 1:1 for STREAM; something like 1:2-1:10 for DYNAMIC, and something like 1:100 or more for STATIC.