transparency in the ogre viewer

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply

does the exporter show the models the way you like it?

yes, completely the way I design my models.
1
20%
yes, if you stick to the modeling 'rules'.
3
60%
no, only the engine in-game shows it right.
1
20%
no, it's impossible to get my modeling needs to export to ogre
0
No votes
I have no idea. I don't export to ogre.
0
No votes
 
Total votes: 5

hacky
Gnoblar
Posts: 4
Joined: Wed Mar 02, 2005 4:38 pm
Location: The Netherlands
Contact:

transparency in the ogre viewer

Post 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.
Imagine what you could do if you could do what you imagine...
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post 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?
team-pantheon programmer
creators of Rastullahs Lockenpracht
hacky
Gnoblar
Posts: 4
Joined: Wed Mar 02, 2005 4:38 pm
Location: The Netherlands
Contact:

Post 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 
            }
        }
    }
}

Imagine what you could do if you could do what you imagine...
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post 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)
hacky
Gnoblar
Posts: 4
Joined: Wed Mar 02, 2005 4:38 pm
Location: The Netherlands
Contact:

Post 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.
Imagine what you could do if you could do what you imagine...
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

You need to use the 'scene_blend' pass attribute - see the manual for full details.
Post Reply