Jump to content
  • Advertisement
Sign in to follow this  
TtDTtW

Dumb question about Vertex Shaders

This topic is 5043 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

Sorry if this is a dumb question but I'm new to programmable shaders, but uhmm, is their a way to make the effects of a shader permanent since editing the elements of a vertex buffer seems slow while a shader does all the transforms relatively speedy like on the card. (ex: Say I'm doing a cloth demo where each vertex is affected by a force each frame, now I store said forces (D3DXVECTOR3) in a texture and send it on it's way to the shader, which applies the forces per vertex and I get one frame of movement, but they (the vertices) reset after said frame... I want them NOT to reset, but to keep that transform... that make sense?) So yeah, any way or is that just wishful thinking?

Share this post


Link to post
Share on other sites
Advertisement
I wrote a fairly long answer to this and it appears the board lost it somewhere. So, here's the shortened version:

You can sort of do it with shader model 3, in that you need to render to a texture then use that texture as a source in your vertex shader the next time around. Apart from that I don't know of any HW accelerated way of doing it.

-Mezz

[Edited by - Mezz on November 28, 2004 9:12:35 PM]

Share this post


Link to post
Share on other sites
To add more detail. Yes in SM3 you can render to a texture, then sample it in the vertex shader, however this is apparently painfully slow (perhaps the next SM3 cards will help fix the issues here)... and unfortunately in D3D this is the best you can do. In OpenGL you can create "uber buffers" where you can treat memory as texture or vertex buffer. In this case you render to a texture, then use that texture as vertex data. It's slightly different from the SM3 method, as the card knows which memory to fetch ahead of time. Things like the SH meta language reqire OpenGL specifically for this functionality.

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!