Sign in to follow this  

Cg output question

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

This topic is 4530 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.

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