Jump to content
  • Advertisement
Sign in to follow this  
behjat

Cg output question

This topic is 4811 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 all, I have written a simple fragment program in cg, my output type is struct out { float4 col : COLOR; float4 depth: DEPTH; }; how to write these values to textures? i am able to write them if the output is of type float4 by glBegin(GL_QUADS); glMultiTexCoord2f(GL_TEXTURE0, 0.0, 1.0); ... but I can't figure out how to write to textures when the output is a struct. thanks

Share this post


Link to post
Share on other sites
Advertisement
you cant write directly to a texture as standard, all outputs must go to a colour buffer, however you can use the Framebuffer Object extension to allow you to setup a texture as the target for a render operation.

So, take a look at the framebuffer object spec, it has examples towards the bottom

Also, can you please give your threads titles in the future, I'll edit this thread for now to give it one.

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!