Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

(Unfortunately couldn't find the answer myself)

Does a neat way to cache the geometry shader results in Direct3D10 or OpenGL exist? (preferably Direct3D10).

I'm building my geometry based on texture sampling and I want to do it only once. So, when the first frame of the scene is rendered, this geometry is build and I want to substitute the geometry building process with simple vertex / index buffer rendering.

I hope this can be achieved without intervening into the non-shader code, but if it doesn't, what should I do? I guess the geometry can somehow be "snapshotted" right before the rasterizing stage, can it?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

Yes; the feature that does this is called "stream-out". For D3D10, the documentation can be found here. It captures the geometry shader output to a vertex buffer you specify, which can then be re-used.

For OpenGL, the same functionality exists under the name "transform feedback". The relevant OpenGL spec can be found here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.