I can successfully display the transparent image as a texture on a simple rectangular geometry.
But, I would like to be able to "see through" to the background wherever the image is transparent.
I've utilized the osgHelp program "GeometryTexture" as a baseline and I can load my image, but the transparent parts of the image show through to the default gray material of the underlying geometry. I see a gray rectangle with my image on top of it. Even though my image has many transparent areas.
I would like to be able to see through the transparent areas of the image into the background. i.e. If all I have on the screen is a single rectangular geometry with my transparent image, then I'd like to see the blue background through the transparent parts of my image.
Can anyone give me a pointer or advise?
Thanks in Advance.
Tim
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29503#29503
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
did you enable blending in your scene? What format texture are you loading?
jp
--
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.
I've experimented with enabling blending by calling pStateSet->setMode(GL_BLEND) on my geometry. I've also experimented with creating a material for the geometry that has an alpha value. Unfortunately, this does not have the desired effect. Applying an alpha value to the material for the geometry makes the entire geometry and image partially transparent. I would like to have the transparency level determined by the alpha values within my image. The image has some areas that are completely transparent and some areas that are completely opaque. The Image is a TGA image with alpha transparency.
I can confirm that the transparency of the image is intact, because if I change the color of the geometry's material, I can see that color "behind" the image.
But, my goal is to have the geometry on which the image placed be invisible so that all that is seen is the image. And, the user can see through the transparent elements of the image to the background or to other geometries that may be behind.
I've attached the small source file and my actual image.
Thank you for your assistance.
Tim
J.P. Delport wrote:
> Hi,
>
> did you enable blending in your scene? What format texture are you loading?
>
> jp
>
> On 29/06/10 23:34, Tim Larson wrote:
>
> > 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
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> ------------------
> Post generated by Mail2Forum
------------------
Read this topic online here:
I think there's something wrong with your texture. I've just done
"colour to alpha" in gimp on the .tga (see modified texture attached).
Then it works fine. See also the .png attached, it also works.
Also, check the change in setMode to use StateAttribute::ON
cheers
jp
> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
Yes... there was a probelm with my texture. I had lost the Alpha information in my TGA when converting from an original PNG file.
Thanks again... And for anyone reading this thread, please see the files attached by JP in the previous post for a complete working example.
Tim.
[quote="J.P. Delport"]Hi,
I think there's something wrong with your texture. I've just done
"colour to alpha" in gimp on the .tga (see modified texture attached).
Then it works fine. See also the .png attached, it also works.
Also, check the change in setMode to use StateAttribute::ON
cheers
jp
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=29532#29532