Hi,
On 01/06/10 09:19, alessandro terenzi wrote:
Thanks,
anyway I need to add the alpha channel only during a preprocess stage
while the shader approach will do it every time I draw a frame, I guess.
You can e.g. put the RTT camera under a switch and switch it off after
the first frame. The output texture would stay usable.
I found a post that suggested to 'change/set' the internal format to
something like RGBA if the image is not already in that format, but then
I wonder how to access the content/channels of the image...am I supposed
to manually read the _data member (that is unsigned char*), extract RGB
values and modify it accordingly?
You can have a different image format (CPU) than texture format (GPU)
and OpenGL will do some conversion (sometimes slow) when copying. E.g.
an RGB texture can be read into a LUMINANCE image and OpenGL will then
unhelpfully by default sum the RGB channels.
If you access the _data member (or data()) then you are doing processing
on the CPU. Is this what you want? Where is your texture coming from? I
can maybe help if you provide a bit more info.
jp
Thanks
Alessandro
On Tue, Jun 1, 2010 at 8:35 AM, J.P. Delport <jpdelp...@csir.co.za
<mailto:jpdelp...@csir.co.za>> wrote:
Hi,
have a look at the render to texture examples (grep for "attach").
You create an RTT camera, attach your RGB texture as input, create
an RGBA output texture and attach this as the output, then in a
shader do your sums.
jp
On 31/05/10 18:15, alessandro terenzi wrote:
I have an Image coming from a texture, and I'd like to add an alpha
channel with values that are an average of the corrensponding
pixel RGB
values. Is there any example that could help?
Thanks.
Alessandro
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
<mailto: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. MailScanner thanks
Transtec Computers for their support.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
<mailto:osg-users@lists.openscenegraph.org>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
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. MailScanner thanks Transtec Computers for their support.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org