Sign in to follow this  
behjat

Cg output question

Recommended Posts

behjat    122
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
_the_phantom_    11250
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

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