Transparency not quite transparent

Problems building or running the engine, queries about how to use features etc.
Post Reply
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
Contact:

Transparency not quite transparent

Post by Vectrex » Tue Nov 06, 2007 3:29 pm

Hi. My sun glare billboard isn't quite transparent (not just against the sky)
Image
The ogre flare.png also does this
The texture doesn't actually have an alpha channel but I'm using the add blend mode and I'm sure the black is black (0,0,0 in photoshop)

Here's my material

Code: Select all

material Sun/Flare
{
	technique
	{
		pass
		{
			lighting off
			scene_blend add
			depth_write off
			depth_check off

			texture_unit
			{
				tex_address_mode clamp
				filtering none
				texture sun_mawbs_medContrast.png
			}
		}
	}
}
thanks
0 x

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
Contact:

Post by Kencho » Tue Nov 06, 2007 3:55 pm

I was having the exact same problem with the flare texture bundled with Ogre. It's really a texture problem. The best way is to open it, go to "Adjust levels", and use the colour picker to pick the "black" colour. You should pick not in a corner, but in the midpoint of any side (and preferrably, a bit inside, not the border itself). Better to waste some texture space than to notice cropped borders ;)
0 x
Image

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
Contact:

Post by Vectrex » Wed Nov 07, 2007 7:21 am

yeah, that's what I thought too, but I'm SURE it's black :D Here's the texture
http://users.on.net/~edan/cam/Ogre/sun_ ... ntrast.png
0 x

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
Contact:

Post by Kencho » Wed Nov 07, 2007 1:18 pm

Uh, you're right. Try removing mipmaps, just to ensure it's not a corrupted mipmap.
0 x
Image

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 964
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
Contact:

Post by Crashy » Wed Nov 07, 2007 1:56 pm

Do you have any fog on the scene?
0 x
Follow la Moustache on Twitter or on Facebook
Image

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
Contact:

Post by Kencho » Wed Nov 07, 2007 2:04 pm

Didn't even notice. He seems to be using Caelum, so I guess it has. Good catch Crashy.

Add fog_override true none to the pass.
0 x
Image

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
Contact:

Post by Vectrex » Wed Nov 07, 2007 2:21 pm

yes! That was it. Thanks for helping. The little stars gave it away eh? :D
0 x

User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
Contact:

Post by Kencho » Wed Nov 07, 2007 2:25 pm

Yup, hehehe :)
0 x
Image

Post Reply