Jump to content
  • Advertisement
Sign in to follow this  
dreddlox

OpenGL How to Render To Vertex Buffer?

This topic is 5121 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I've a wicked idea for a game engine design, but the problem is that its HEAVILY vertex-processor limited. I was wondering if there is a way to use pixel shaders to output data into a simple vertex buffer(I was thinking of rendering the streams individually, stream 0 = position, stream 1 = normal, etc.)? I have seen ATI mention this capability a few times, and I believe there is an OpenGL extension for this.

Share this post


Link to post
Share on other sites
Advertisement
Thanks for replying, but the first link applies to OpenGl only, and the second talks about D-Maps.
I have found the OpenGL extension: GL_EXT_pixel_buffer_object but unfortunately this has no use in D3D.
I wonder if typecasting between VBs and RTs would work...

Share this post


Link to post
Share on other sites
Render to VB, or uber buffers is currently OpenGL only. I'm sure DirectX Next will change this, but for now, D3D cannot render to a VB.

You can render to a texture, and use VS3.0 (GeForce6800, 6600 only, or software processing) vertex texture lookup, which will be slow... especially if you render the texture in hardware then try software processing for texture lookup.

Share this post


Link to post
Share on other sites
IDirect3DDevice has a "ProcessVertices" function that sounds like it will do what you want. However, I am not certain that it does the transformation of vertices in hardware.

Share this post


Link to post
Share on other sites
Process vertices forces software processing.

It's also a bit of pain to use. For example, if you have 1 set of UVs, but you use them on two stages, then do a tex-coord generation on another stage, you must give it an output VB that has D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX3... so you really need to know the output format from your effect and have a bunch of buffer types ready.

It's only use is if your lighting, skinning, etc cost is so high that you don't want to repeat if for multi-pass, OR if your data isn't going to change frame to frame (ie: no mesh, world, camera, or light changes) and you want to precalculate it... not very practical in most cases.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!