Sign in to follow this  
helenj

render to texture

Recommended Posts

Hi, how can I render the result of vertex shader to a texture and process it in the pixel shader? Is there anything like SetRenderTarget() in D3D? Thanks a lot.

Share this post


Link to post
Share on other sites
this has been answered alot in these forums, you should try the forum search (which is just a google search with a site qualitfier)

anyway, a few topics which i have posted into:
http://www.gamedev.net/community/forums/topic.asp?topic_id=321786&whichpage=1?
http://www.gamedev.net/community/forums/topic.asp?topic_id=320802&whichpage=1?

the quickest/easiest way is to use glCopyTexSubImage2D but that will incur a performance penalty. (implementation details are available in those threads)

Share this post


Link to post
Share on other sites
Thanks a lot for your answer.

Actually I know glCopyTexSubImage2D can copy from the frame buffer to a texture.But there's one thing I'm not clear about. Does the output of vertex shader go to pixel shader and then been written into the frame buffer? So if I just want to render the output of vertex shader to texture, does glCopyTexSubImage2D still work?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this