Hi,

On 03/01/2012 15:55, wang shuiying wrote:
Hello,

In my programme, the fourth element of gl_FragColor is changed by
fragment shader to be a random number between 0 and 1. But when I access
this element by the corresponding image, the element is always 1.

What image are you talking about here? Are you saving an image? How are you accessing the data?

What target are you rendering to? An FBO? Normal frame buffer?

We are using the fourth channel in FBO as pure data stores, so this should work.

jp

I got
to know that in the rendering pipeline after fragment operation, there
should be alpha test and blend and so on. When I turn off all those
functions, the fourth element of gl_FragColor, which corresponds to the
value of alpha, should not be affected by those tests, right? But it
remains to be 1. Is there anybody who can give me some advice on that? I
want to make use of the fourth element to record the material index of
the objects attached to the camera in question.


Thank you in advance!

Shuiying
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to