[Solved] Alpha Flag and Animated Sprites 3D

Blitz3D Forums/Blitz3D Programming/[Solved] Alpha Flag and Animated Sprites 3D

RustyKristi(Posted 2016) [#1]
I'm trying to use LoadAnimImage3D in SpriteControl with Textures that has alpha on them (cut out) but cannot get it to work. Masking works but it still does not look good.

@Kryzon
I also tried your solution 10 years ago here:
http://www.blitzbasic.com/Community/post.php?topic=64426&post=720004

but it still does not work, image is messed up :/

@Jim Brown?
Any ideas? thanks.
http://www.blitzbasic.com/codearcs/codearcs.php?code=456


RemiD(Posted 2016) [#2]
You could use a quad+texture and load your texture with loadtexture("texture.png",1+2,framescount) and write the alpha value of each texel with your own procedure
and then use EntityTexture(Mesh,Texture,FrameN-1) to texture your mesh

what are you trying to achieve with this sprite control lib ?


RustyKristi(Posted 2016) [#3]
Just basic UI and hud stuff with alphas on them. Gave up on Sprite Control, it seems it has no direct alpha support.

I will just look for another replacement. Thanks RemiD.


RemiD(Posted 2016) [#4]
@RustyKristi>>btw, if you want to create your own HUD/GUI system you can use images, as long as there are not too many and they are not too big, it will be fast enough.

see this simple test : (old code, a little ugly)

(press tab to show/hide the 3d world or the 2d world (with the GUI elements), press space to update the "displaystate" of the GUI elements)

Or you can create your own HUD/GUI system using quads+textures, and my recent code here : http://www.blitzbasic.com/Community/posts.php?topic=106954 (post #1)
demonstrates how to create a quad (and texture) which will use the exact same pixels area (width,height) used by an image of the same size (width,height)


RustyKristi(Posted 2016) [#5]
Thanks again RemiD! Actually I'd prefer existing and ready made gui libs because eventually I will need more functionality but for now I can try these codes.


Kryzon(Posted 2016) [#6]
Wow, ten years ago. I must've been 16 when I wrote that post. I don't remember much about this, I don't have the files anymore.

Things like that "sprite control" library are for doing 2D-in-3D graphics under a perspective camera, which is a challenge.
With what we have available now this is much easier, like BlitzMax with its Max2D module that does exactly that. You can have pixel-perfect 2D graphics on top of your MiniB3D scene by calling a couple of functions.


RustyKristi(Posted 2016) [#7]
ha that was really a long time ago! anyway thats ok, yes I'm doing 2D in 3D just like any game with HUDs in it.

I'm putting this on hold while I try RemiD's suggestions.


RemiD(Posted 2016) [#8]
If your HUD images are small enough, and not many, just draw them on top of your 3dscene rendered image, it will be fast enough (see my code example in post #4)


RustyKristi(Posted 2016) [#9]
thanks!


RemiD(Posted 2016) [#10]
another example to create an HUD with a quad + a texture : http://www.blitzbasic.com/codearcs/codearcs.php?code=529