Page 1 of 1

transparency in the ogre viewer

Posted: Wed Mar 02, 2005 4:48 pm
by hacky
is it possible to see alpha-channeled textures like png really transparant in the ogre viewer? I only see it fully opaque.

thanks in advance.

Posted: Wed Mar 02, 2005 4:57 pm
by haffax
Since the meshviewer just uses Ogre to render things, it should handle all materials just fine. Because we recently experimented with alpha transparency in pngs I happen to know that they work in the Meshviewer. Maybe it is a problem with your material?

Posted: Thu Mar 03, 2005 10:09 am
by hacky
here is the material file. should I add a line to tell the renderer that it is an alpha-material?

Code: Select all

material pinematerial/bark
{
    technique
    {
        pass
        {
            ambient 0.588235 0.588235 0.588235
            diffuse 0.588235 0.588235 0.588235
            specular 0.9 0.9 0.9 0.0
            emissive 0.0 0.0 0.0
            texture_unit
            {
                texture pine1.png 
            }
        }
    }
}

material pinematerial/leafs
{
    technique
    {
        pass
        {
            ambient 0.588235 0.588235 0.588235
            diffuse 0.588235 0.588235 0.588235
            specular 0.9 0.9 0.9 0.0
            emissive 0.0 0.0 0.0
            texture_unit
            {
                texture a_pine1.tga 
            }
        }
    }
}


Posted: Thu Mar 03, 2005 11:39 am
by :wumpus:
Yes, you need to either specify alpha thresholding (fast, utilizes normal zbuffer) or alpha blending (slow, needs depth sorting pass to be done by ogre)

Posted: Fri Mar 04, 2005 4:22 pm
by hacky
I added :

colour_op alpha_blend

to the texture_unit.

Still no alpha in the viewer. I'll take a look at some samples if I can find 'em.

Posted: Fri Mar 04, 2005 10:31 pm
by sinbad
You need to use the 'scene_blend' pass attribute - see the manual for full details.