Alpha maps and transparency !??

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
M&M
Kobold
Posts: 25
Joined: Thu Feb 24, 2005 9:12 pm
Location: Egypt
Contact:

Alpha maps and transparency !??

Post by M&M »

I have a scene with some trees in them. Thier texture is comprised of 2 files, the tree texture and an alpha map. No matter how hard i try they just don't seem to work right. The trees ends up looking like this. It works fine in max btw.
Image
I've been reading this part of the wiki. It describes how to get a tree texture working if the texture had an alpha layer on it. But in my case the alpha layer is a seperate texture. I tried quite alot of the ideas in that page and altered them abit, but none of them seem to work. My end result is pretty much the same. if not worse at some times. Here are both the textures.
Image

Image
My material file is something like this.

Code: Select all

material 05_-_Default
{
    technique
    	{
    		pass
    		{
    			lighting off
    
    			ambient 1 1 1 1
    			diffuse 1 1 1 1
    			specular 0 0 0 0
    			emissive 0 0 0
    
    			scene_blend alpha_blend
    			depth_write off
    
    			texture_unit
    			{
    				texture tree_03.jpg
    				tex_coord_set 0
    				colour_op modulate
    			}
    			texture_unit
			{
			  	texture tree_03_alpha.jpg
			    	tex_coord_set 0
			    	colour_op modulate
    			}
    		}
    	}

}
can anyone tell me what i'm doing wrong ? or do transparent maps have to be a single texture with alpha layer ?
Image
User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

why dont you combine them into one with .TGA format
also check
http://www.ogre3d.org/wiki/index.php/Ma ... parent_map
I 've added some snippet that help when making something like forest
M&M
Kobold
Posts: 25
Joined: Thu Feb 24, 2005 9:12 pm
Location: Egypt
Contact:

Post by M&M »

why dont you combine them into one with .TGA format
i'll probably end up doing something like that if i can't find a solution. I did check the transparent map but it didn't help. I'm not quite trying to make a forest, just a bunch of trees.

Also about the wiki, the link to the forum topic is mistyped. I think you made http// instead of http:// or something, in anycase its not working properly.
Image
User avatar
maxxoros
Greenskin
Posts: 130
Joined: Tue Feb 22, 2005 7:18 pm

Post by maxxoros »

even a bunch of tree... check my problem and know why we must change material script
http://www.ogre3d.org/phpBB2/viewtopic.php?t=12690
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

ogre cannot load a 8 bits gray texture as an alpha layer in a material.
It thinks it's luminance.
In my code, I do load it in C++ specifying the PF_A8 mode.
so do that or use a 32bits image files, with alpha in it.
M&M
Kobold
Posts: 25
Joined: Thu Feb 24, 2005 9:12 pm
Location: Egypt
Contact:

Post by M&M »

i guess i'll do the first then and save myself all the trouble, thanks. The material script will probably come in handy when we start detailing the park.
Image
Post Reply