2D in 3D. No, the other 2D in 3D.

Blitz3D Forums/Blitz3D Programming/2D in 3D. No, the other 2D in 3D.

I have no speed issues but another sprite issue. I've been giving SpriteControl a go and modified the ImageToSprite function tro write other values than $FF to the alpha byte of the texture (see the for..next x,y) in that function. It seems that transparancy becomes either full or none. I have used the alpha flag on the texture in case you wonder. Mine, and I believe many others's reason for using 2d-in-3d sprite libs is to have fast alpha. While the 'mixing 2d & 3d' example that comes with SprteControl surely demonstrates alpha on the sprite (the logo) it does this by setting one EntityAlpha for the whole sprite. I'm not very familiar with 3d programming, but I expected writing the alpha byte would set a value for that particular pixel

Is it fundamentally impossible or is it just me that's made a bug in the for..next x/y loop? For example (in spritecontrol.bb ImageToSprite function, if we use a 256x256 image):

	For x=0 To iw-1
		For y=0 To ih-1
			rgbc=ReadPixelFast(x,y,ib) And $00ffffff
			If rgbc=((r Shl 16)+(g Shl 8)+b)
				WritePixelFast x,y,($00000000),tb
			Else
				WritePixelFast x,y,(x Shl 24 Or rgbc),tb ; changed from $ff alpha byte
			EndIf
		Next
	Next