opengl - Reading current framebuffer -


is there way read fragment framebuffer rendered?

so, i'm looking way read color information fragment that's on place current fragment overwrite. so, exact position of fragment rendered.

i found gl_fragdata , gl_lastfragdata added ext_ extensions shaders, if need, explain how use those?

i looking either opengl or opengl es 2.0 solution.

edit:

all time searching solution allow me have kind of read&write "uniform" accessible shaders. out there searching similar thing, opengl version 4.3+ support image , buffer storage types. allow both reading , writing them simultaneously, , in combination compute shaders proved powerful tool.

your question seems rather confused.

part of question (the first sentence) asks if can read framebuffer in fragment shader. answer is, no. there an opengl es 2.0 extension lets so, it's supported on hardware. in desktop gl 4.2+, can use arbitrary image load/store same effect. can't render image anymore; have write data using image storing functions.

gl_lastfragdata pretty simple: it's color sample in framebuffer overwritten fragment shader. can wish, if available.

the second part of question (the second paragraph) different question. there, you're asking fragments potentially never written framebuffer. can't read fragment shader; can read images. , if fragment fails depth test, it's data never rendered image. can't read it.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -