Is anyone using alpha masks?

Plombo

OpenBOR Developer
Staff member
Way back in 2010, I added a command called alphamask to the engine that enabled sprites to have fully custom alpha values for each pixel. It didn't really have an immediate uptake. The feature was never especially well known, and the requirements for making them were a bit scary: the fully transparent pixels in the alpha mask had to match exactly with the transparent pixels in the original sprite.

Recently, I've been thinking about and working with alpha masks a lot more than usual, improving their support in the engine and developing PalApply v2 which can create alpha masks. So I'm curious about how many OpenBOR games in the last 9 years have used alpha masks. I remember at least one game using them ages ago, so the number isn't zero, but are there more? Have any of you used them or tried to use them in a game before? I'd like to hear about it!
 
Plombo
The only time I have heard of anyone using this feature was Naota with his Psyco Soldier X mod he used it with Kensu's flash kick type move (see the video).

This could be used for a light sabre like Zero in Megaman . To be honest I never understood how it works an example mod would have be more useful then the guide we for me at least.

 
sorry for the ignorance, but how do alpha masks works in openbor? i am unable to keep an alpha mask on a png or gif after saving it. use to work a lot with alpha masks on bmp, tga, dds, but the mask was allways included on the same image, been on alpha chanel or a mirror like mask, though for what i read around here, openbor sems to work with a separated file from the actual image?
 
Gurtag said:
sorry for the ignorance, but how do alpha masks works in openbor? i am unable to keep an alpha mask on a png or gif after saving it. use to work a lot with alpha masks on bmp, tga, dds, but the mask was allways included on the same image, been on alpha chanel or a mirror like mask, though for what i read around here, openbor sems to work with a separated file from the actual image?

Yeah, the alpha mask is a separate image. You can save a PNG as RGB (not indexed) with your editor to keep the alpha mask, and then use PalApply v2 to turn it into a separate indexed image and alpha mask.

From there, use the "alphamask" command in OpenBOR; you can look it up in the manual.
 
I also experimented with it a couple of times but it was too much work to make characters like this ( alpha and separate png file for one frame)so i passed on it after realizing what it would take + most importantly i did not had acive project that would use this feature, i wanted to use it to blend characters with bacground more nicely without any jagged pixels visible on borders of the sprites.
Im still using gifs converted from pngs in first palapply because of palettes customization but having 24bit pngs would be great for some projects.
I think most of us use pixel art for graphics so there wasnt that much alpha effects needed with sprites.
 
I use them sparingly. For me, most transparency  is for particle effects. In those cases, it's always more practical to keep them as a separate model and the effect sprites are usually drawn to leverage model level alpha transparency without need of a mask.

That said, once in a while they are an unbelievable tool, and there's no real substitute. Yeah it's a pain making the masks, but they work perfectly. I definitely want to see what you have in store Plombo.

DC
 
I've only used this in 2 frames of animation but it is useful when needed.
64nfkkA.png

79p2UGt.png
 
i want to make cutscenes in realtime featuring animations in layers that use gradient transparency, but it seems that using the alphamask method will take at least twice the MB
the automated tools that exist for making APNGS seem to work well & gives files with a reasonable size
maybe by figuring out how to make APNGs work in openbor

butterfly.png


you have to use firefox to see this.

  (think of a complex animation using sprites, like the ninja gaiden cutscenes, but layered with transparencies & whatnot)

then it may be able to display png's without the need for the alphamasks?
 
oldyz said:

APNG support is not happening, for multiple reasons. As for alpha masks, they consume exactly twice the RAM, no more and no less, since each alpha mask is another image. Why is this a problem? Sprites in OpenBOR are very efficient - the entirety of SF3 Chun-Li 1000+ sprites is ~4MB in memory. Make it 8MB if you alpha masked every single frame.

In any case, you should also be aware OpenBOR supports WebM, so if you really want smooth transitions in a cut-scene that's another option for you.

DC
 
Damon Caskey

it was not RAM that i was concerned about, its the eventual size of the .pak file

example with my current experiment:

with the current method, the multilayer cutscenes components , including the alphas, are about 60mb in size

on the other hand, if OpenBor could support APNG, the total size of the files are 38mb

USing WebM, ill have to see if a friend with video editing software could do a render to see what it looks like & find out what total size is going to be... 

the issue is not smooth transitions, its the fact that layering the components works best for the 3D mode...
and the fact that the "movies" could have different elements depending on characters used, or items collected
so using the webm method means that for every littel detail you would have to render a new Webm (unless webms feature transparency & layering)

I kinda understand why it might not be possible tho, i read the manual & it seems that the current method is the best because its less taxing, so it seems that currently its an either or situation

either you feature optimized  PNGs/APNG with gradient transparency & reduced size, but force the engine to do a lot
OR use alpha mask layers with bigger size, but make things run smooth
 
Have you tried optimizing your webm video firstly make it the same size as your mod as anything bigger will be downscaled anyway and play with bit rates untill you get the perfect balance between quality and compression .  Two pass encoding always has better results but takes longer also not all encoders support it.  The audio rate and encoder could also make a difference.
 
I have experience with this , yes

unfortunately, the more you optimize , the more likely it is that it looks "more blurry"

in the other hand , the PNG frames method keeps things sharp, and it allows you to have a cinema display that can have Different characters or things removed or added in real-time.
using the mask layer or allowing gradient transparency allows for out of focus effects or light coronas & "real time" shadows to be displayed

For example, if you play single player mode, the cinema display only has a single character, play with 3 friends & the cinema will feature the other 3 characters,
Go further & the characters displayed can also change, lets say you finish the level with Chris, Ash Williams,  Jake & Hong hua, that is what you will get in the cinema.

On the other hand, if you finish the level with Blade, Jake, jasmine & Colonel Sanders, the cinema will feature Them.

EDIT:

also , take into account that the cinemas are ninja gaiden-like, not many frames are used , but there is layer scrolling to make an illusion of depth
(basically you move the still or cut out sprites around) so using webms will take too much data in comparison.
of course if webms allow for transparency & layering then there is no problem, the only increase in size come from the fact that each slight movement of the layer is an actual frame  instead of a command that moves the frame

for an example of this type of cinema displays that i want to implement , take a look a this video & the first 2 cinemas:


https://www.youtube.com/watch?v=PDnLF6eXw04

 
bWWd

well ,there is no other way , its a data size issue, it is better to have "movie" layer entities than multiple webmS

i ran the numbers & using webms will probably end up taking 200mb (300 to 400mb if they are 3D movies)

using "movie"entities composed of multiple layers & layers that appear based on the characters used take less -

example - currently we have 4 characters, each character has about 6 cinemas, so that means rendering 24 different webms for each characer
and that is without taking into account the combinations of characters.
on the other hand, making cinemas using entities, you recycle the same elements, & just change a layer or 2 - An when displayed in 3d it will look better

I will see if webms can be used during levels, if that's the case maybe i will replace the layer works with a background webm & foreground character layers
 
Back
Top Bottom