A few graphics questions...

Blitz3D Forums/Blitz3D Beginners Area/A few graphics questions...

Matt Vinyl(Posted 2007) [#1]
Hi all,

I've been playing around with Photoshop since I purchased v8.0 a while back. I like to think I've got pretty good with it and have made some impressive 'layouts' and designs...

I'm into making 2D puzzle games with Blitz, such as word games / picture shuffle games / tile games, and would like to use a lot of the things I design in photoshop within Blitz. Now, I can obviously use anything I design in it as backdrops, tiles, icons etc, but I'd like to be able to go further and don't really know where to turn.

For example, I'd love to have some of the shadow effects dynamically implemented, and have transparency etc. I'd like to use some of the great looking text I can design as, for example, the 'score' in a game, or the number of lives remaining...

I see some of you guys have lovely smooth 2d graphic effects showing themselves to my eyes, but I wouldn't know where to start... :(

Effectively, to sum up, how do I implement transparency and shadows in a 2D game using B3D?

Cheers!
M


caff_(Posted 2007) [#2]
For transparency, use EntityAlpha. Check the examples in the help file, then have a look through the code archives.

To get 2D in Blitz3D, you can change the camera projection mode using CameraProjMode, and set to orthographic mode. This is quite tricky to get right - again have a look at the example in the help file.

Shadows aren't easy - with Blitz3D you've got many options, but it's best to pick one that suits your particular need. Again have a look through the code archives at some of the more complex techniques.

If you just want a simple circular soft shadow below a model, you can place a small quad (flat square) below the model, with a shadow texture on.

To make a shadow texture, you start with a black square as a normal image. Then you use the 'alpha' channel of your image to determine how strong the shadow is, what shape it is etc (have a look at Photoshop tutorials on the alpha channel).

Say you want a circular, soft edged shadow, you would use something on the ALPHA CHANNEL like this:



The shadow will be strongest in the centre (where the alpha channel has white pixels) and fade out where it is black. Remember, the RGB picture will just be a completely black square - the alpha channel determines how much of this black you see, hence you get a shadow in the shape above.


Matt Vinyl(Posted 2007) [#3]
Hiya, thanks for your reply, will take a look through some of the archived code. I guess it's because I've been mainly using B3D in a 2D capacity (using Graphics instead of Graphics3D and loading images etc..)

;)