6
\$\begingroup\$

(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?

\$\endgroup\$
8
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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