Unwanted Transparency

Blitz3D Forums/Blitz3D Programming/Unwanted Transparency

JoeGr(Posted 2003) [#1]
I just attempted to use the LoadSprite() command for the first time in ages, but was surprised to see the resulting sprites being rendered with transparency. It appears that the colour map is being used as an alpha map (ie darker areas are more transparent) as happens when using an alpha flag on a texture with no alpha channel.

I don't remember this happening before. Surely sprites should be completely opaque by default? As ever, apologies if I'm being really stupid, but how can I make my sprites opaque again?


Perturbatio(Posted 2003) [#2]
LoadSprite("Yourfile.bmp",1)?


Michael Reitzenstein(Posted 2003) [#3]
Have you set any Texture Filters?


JoeGr(Posted 2003) [#4]
Flag 1 doesn't fix it. That was the first thing I tried. The nearest I can get to opaque using the flags is with 4 (masked) but obviously there are holes in black areas of the image.

I haven't set any texture filters. In fact pretty much all I've done is load a .b3d level exported from Maplet. No fancy stuff at all. Bizarre.

But thanks, and keep the suggestions coming.


JoeGr(Posted 2003) [#5]
Okay, I've switched to using textured quads now which works fine, but I'd still like to know if anyone can shed some light on this.


Yan(Posted 2003) [#6]
This has always been the case AFAIR.

Try...

sprite = CreatSprite()
tex = LoadTexture("sprite.bmp", 1)
EntityTexture sprite, tex
FreeTexture tex
YAN


Perturbatio(Posted 2003) [#7]
Hmmm... it's happening to me as well, the sprite is washed with red unless flag 4 is used in which case it's just masked.

Graphics3D 800,600,32,2

SetBuffer BackBuffer()

Global spr1 = LoadSprite("test.bmp",1)
EntityAlpha spr1,1
Global light = CreateLight()

Global camMain = CreateCamera()
CameraClsColor camMain,255,0,0

PositionEntity spr1,0,0,2

While Not KeyDown(1)
		
	UpdateWorld
	RenderWorld
			
	Flip
	Cls
	
Wend

End