2d Alpha

Blitz3D Forums/Blitz3D Beginners Area/2d Alpha

Liberator(Posted 2005) [#1]
Ok so here's my problem - I want to add an interface (health bar, cool loading screens, drop down menus) bla bla everything that is '2d' to be found in a normal 3d game. A lot of it I would love to have use a transparent or semi-transparent backround, not just the filtering out of one color like with the image command. Now I see that many people are using 3D sprites to create this effect but there are two problems I can see with doing this: The edges of the sprites are blurred from the 3d hardware...which is fine, it looks great on the meshes in the game...but not on the interface which I want to be perfectly crisp. Also, how in the world are you supposed to place the sprites on the screen using pixel values and not approximate guesses?? I have an interface that has hundreds of very small, very precise buttons that need to be placed in just the right spot on top of one another....how can I possibly do this by making a 3d sprite and guessing where it "looks good" based on distance from the camera and whatnot.

So my question in a nutshell - can the image commands use alpha channels that can make things semi-transparent and not just filter out one solid color? If not, is there a way to make the 3D sprites used to imitate an interface use real pixel values so I don't have to spend the rest of my life trying to allign the damned things!?

Thanks for any help!


Sledge(Posted 2005) [#2]
At any given z distance from the camera the x and y distances from one edge of the screen to the other can be considered in terms of the "blitz units" they span. So if a camera-facing quad takes up the entire width of the display and is one unit wide, you know that to move it one pixel to the right you will have to shift it (1.0/horizontal resolution) units on the x axis. Operating in this manner while using as large a bunch of textures as possible is probably your best bet with B3D, although I understand that a certain amount of blurring is inevitable.

EDIT: Oh, and orthographic projection may be worth a punt.


Liberator(Posted 2005) [#3]
This is true....but do tell, how does one make the projection orthographic??


Sledge(Posted 2005) [#4]
http://www.blitzbasic.com/b3ddocs/command.php?name=CameraProjMode&ref=3d_cat


BlackJumper(Posted 2005) [#5]
... or take the easy way out and use something like nSprite by GoSsE:

nSprite