Texture Feedback

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Shaun Shaun 1 week, 4 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #55417
    Profile photo of john
    john
    Member

    Has anyone tried using an RGBA texture as both and output and input. I realise this is not advised but I wonder if it would be possible to use the R channel as the output while reading from the B channels. Technically it is feedback but I would have thought it could be possible if they were on separate color channels, using a glcolor mask to ensure B channel is not written to ?

    Thanks for any info

    #55418
    Profile photo of Shaun
    Shaun
    Member

    Hi John,

    As far as I am aware reading & writing to the same texture (FBO attachment) could result in undefined behavior (may return garbage data); to prevent this the attachment should only be a data source or target not both at the same time. I would recommend using two textures, i.e. fill the first texture with some data then set it as an input to the next stage in your pipeline and use the second texture as an output. If you only require one channel you can set the texture format to R8 which will give you a texture with a single 8 bit channel.

    Kind regards,
    Shaun

    • This reply was modified 1 week, 4 days ago by Profile photo of Shaun Shaun.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.