Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!  (Read 2814 times)

0 Members and 1 Guest are viewing this topic.

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Well, I know it isnt in Youki's code, but I found a way to get 15 levels of alpha channel (16 if you count transparent) into one image (but you need to use 4 images at 4 different alpha overlaping, and use the "clear color" to selectivly chose which "plane" gets to add in it opacity for each pixel). Needless to say, doing this by hand is difficult, so when I get time I will write a simple program that will take a source image and an alpha mask and spit out the 4 pics needed to get the 16 level alpha. Anyways, as proof of concept I decided to take a simple blue bar and alpha blend it from transparent to near opaque. But any image can be used.

Here are some pics: (Note the alpha blended blue bar is over the snapshot part of the screen)

full size links:
http://s102.photobucket.com/albums/m105/protoplatapus/?action=view&current=alpha2.jpg
http://s102.photobucket.com/albums/m105/protoplatapus/?action=view&current=alpha1.jpg








Ok, now how did I do it, that is the important part. To test this out yourself, DL the 4 following pngs

http://s102.photobucket.com/albums/m105/protoplatapus/?action=view&current=10a.png
http://s102.photobucket.com/albums/m105/protoplatapus/?action=view&current=20a.png
http://s102.photobucket.com/albums/m105/protoplatapus/?action=view&current=40a.png
http://s102.photobucket.com/albums/m105/protoplatapus/?action=view&current=80a.png


Then go into Atomic layout editor and VERY important, make sure your "clear color" or "transparent color" is set to 255 red 0 green and 255 blue (the purple color in the PNGs)

Next, over lap the images PERFECTLY! EXACT SAME COORDS!

next stage, set the alpha for:
10a.png to 26
20a.png to 52
40a.png to 104
80a.png to 160


If you did this correctly you will see a range of translucency going from near transparent to almost opaque in 15 steps.

Remember, the blue bar was just for a test, any image can be used, you just need to know what areas of the 4 copies of the same image to "transparent out"

How does it work?

Well, if you look at the pngs from left to right, you will notice that the left most edge only shows blue on the 10a(26 alpha) pic, and the next line over only shows blue on the 20a(52 alpha) pic, but notice that the third line shows blue on both 10a and 20a? Well, 10a is about 10% opaque and 20a is about 20% opaque, so the next line is 20%+10% = approx 30%.

For those of you familiar with binary numbers, you will see the same basic pattern as counting in binary. Anyways, I hope you guys enjoyed this proof of concept. It would be really hard to make a complex alpha mask by hand this was (as you would have to deal with each pixel seperately on 4 identical pics, but a simple program could be written to do this (And I plan on making one as soon as I have some free time, and as soon as that happens, AtomicFE will have decent alpha handling!  ;D)

BTW, for having to use 4 translucent pics to do this, it still runs at almost the same speed as it did before!
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #1 on: August 01, 2008, 03:57:40 am »
Hi Protokatie,

I think i have mistunderstood you , because what i see is already doable in standard in Atomic 0.19.

It is what i call Gradual Alpha blending. (on the "Mask" tab , there is a Gradual Alpha using mask option)

you can do this kind of thing :

[youtube]http://fr.youtube.com/watch?v=vA49MpCDKI8[/youtube]

It is used also here ,look it for as example :



Do i miss something? 


protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #2 on: August 01, 2008, 04:28:55 am »
WAY TO RUIN MY HIGH, YOUKI! Ok, so I didnt see (prior to now) that you had alpha channel capabilities... But, at the same time, what I discovered could be used for other FE's that have only translucency with transparency... Oh well....

Still,  hope my effort is somewhat admirable...


:sulks in silence:  :'(
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #3 on: August 01, 2008, 04:37:05 am »
I'm really sorry.   :-[


youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #4 on: August 01, 2008, 04:43:32 am »
I was also used in that variant of the layout here :


Ummon

  • Trade Count: (+13)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5244
  • Last login:June 09, 2010, 06:37:18 pm
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #5 on: August 02, 2008, 04:44:46 pm »
Hahah, funny.
Yo. Chocolate.


"Theoretical physics has been the most successful and cost-effective in all of science."

Stephen Hawking


People often confuse expressed observations with complaint, ridicule, or - even worse - self-pity.

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #6 on: August 02, 2008, 11:29:12 pm »
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #7 on: August 05, 2008, 10:55:26 pm »
Ok, I know my method is obsolete, but I decided to put it in my layout anyways, even if out of shear spite :P

Some pics:

http://s102.photobucket.com/albums/m105/protoplatapus/?action=view&current=alpha3.jpg

http://s102.photobucket.com/albums/m105/protoplatapus/?action=view&current=alpha4.jpg

I know it would have looked a bit better if I used the built-in 8 bit alpha channel, but it doesnt that bad for being only a 4 bit alpha channel...
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #8 on: August 06, 2008, 03:58:21 am »
Very nice  :D

don't forget to send it to me , when completed.

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #9 on: August 06, 2008, 04:14:21 am »
Very nice  :D

don't forget to send it to me , when completed.

It pretty much is, but I do not know HOW to send it. Besides, the layout uses so many odd tricks, it would be awkward for someone to mod it for their own use. (Like I have said before, I have been trying to find every odd trick in your software to get this thing to this point). And YES, as per your PM, I WILL find a way to trick 3D out of it! (It may be slow tho :P and be only a trick...)

It may not look like I used odd tricks (outside the faux alpha channel) but I did do a lot of odd things to get it to this stage. I am sure there are many other layouts for AFE that are much better, but if you want, I will send it.
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #10 on: August 06, 2008, 04:38:23 am »
You can send it on my mail :  y  o u k i (at) a t o m i c f e . c o m

I'm curious to see your tricks.  :)

Seeing the picture, at the first look, i don't see where you tricked. :-[  (except your alpha chanelling).

Cakemeister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1002
  • Last login:May 31, 2024, 06:23:16 pm
  • I'm a llama!
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #11 on: August 06, 2008, 08:56:40 am »
Is .20 going to have full alpha blending?
Old, but not obsolete.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #12 on: August 06, 2008, 09:03:16 am »
Is .20 going to have full alpha blending?

Full alpha channel support would bring DirectDraw to it's knee's and not really a fair expectation I would think.

Cakemeister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1002
  • Last login:May 31, 2024, 06:23:16 pm
  • I'm a llama!
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #13 on: August 06, 2008, 09:09:28 am »
Is .20 going to have full alpha blending?

Full alpha channel support would bring DirectDraw to it's knee's and not really a fair expectation I would think.

I thought that it would only be one small step from "Gradual Alpha" to full alpha blending.
Old, but not obsolete.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #14 on: August 06, 2008, 09:15:03 am »
I thought that it would only be one small step from "Gradual Alpha" to full alpha blending.

If it's used sparingly then yeah, like with the video showing a reflection that would be quite CPU intensive so you couldn't have the effect on every graphic object on a complex themes with several layers. The problem is since DD only support color keying you literally need to process each pixel per frame to do the blending. I think Youki has done a great job pushing the limits though since he does test on a lower spec machine AFAIK.

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #15 on: August 06, 2008, 09:20:18 am »
What you mean by Full Alpha blending ?

From my point of view it already has full alphablending using my gradual mask.   The gradual mask can be considered as a 8bit alpha channel.  

The gradual mask allows other interresting effects that you can do with simple alpha channel integrated to the image. i think.

Atomic works only in 16bit/pixel , i won't change that  , at least in that engine .



Cakemeister

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1002
  • Last login:May 31, 2024, 06:23:16 pm
  • I'm a llama!
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #16 on: August 06, 2008, 09:54:53 am »
What you mean by Full Alpha blending ?

From my point of view it already has full alphablending using my gradual mask.   The gradual mask can be considered as a 8bit alpha channel.  

The gradual mask allows other interresting effects that you can do with simple alpha channel integrated to the image. i think.

Atomic works only in 16bit/pixel , i won't change that  , at least in that engine .




I mean using the alpha channel that is coded within a 32-bit RGB image, a la Dragon King.

Your external mask blending is also a great feature which allows blending with 16-bit images. It's actually non-trivial to implement the external mask blending in OpenGL because you have to set up multitexturing and that is a hassle.

I guess, with a little effort in Photoshop or GIMP, you can create gradual masks for any image you want to alpha blend.

I didn't realize that Atomic worked in 16 bits per pixel only. I was wondering how it could be so fast using only DirectDraw.
Old, but not obsolete.

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #17 on: August 06, 2008, 10:20:23 am »
Quote
Your external mask blending is also a great feature which allows blending with 16-bit images. It's actually non-trivial to implement the external mask blending in OpenGL because you have to set up multitexturing and that is a hassle.

Just an idea, i didn't use Open GL for years, i think the only time i used it was in 1993 at school!  , so may be i say something studid.

Could it be possible, instead of using multiple textures , to use only one , but you create the texture dynamically  mixing the image data and the mask data and then use the result as one texture and blend it normaly as a normal alpha channeled texture.

In fact, you take a 24bit/pixel image  , you take a 16bit par pixel image for the mask, and you build a 32bit pixel image from both....

Quote
I didn't realize that Atomic worked in 16 bits per pixel only. I was wondering how it could be so fast using only DirectDraw.

For 3 years my development machine for  AtomicFe was my old Celeron 533Mhz with 256mega of ram....so  it makes think how to optimize... ;)

And few year ago, i read a interview of George Luckas about special effect in Star war.  He said that before Star war ,  teams spent 70% of their time to finalise details that you won't really see on screen in the action.  So to reduce the cost , it decided to spent only 10% of the time for details , and use the 90% to create effects.  If it is not perfect it is not problem as almost nobody won't see the default at least they pause the film.

If you look closely at Star war special effect (first film) they are very bad... but who did notice that?

I use the same "approach".   Atomic is not pixel perfect!.  And why to use 24bit or 32bit/pixel image, anyway your eye on a arcade screen won't really the difference.   But your processor and memory Yes!! ;)

Atomic is just a Front End , it is not Photoshop or a modelling tool.  So , don't need to have perfect timing, rendering etc..etc..   Just have to be nice and fast and usefull!  :D


Space Fractal

  • Wiki Master
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1888
  • Last login:September 26, 2023, 11:32:13 am
  • Space Fractal
    • Space Fractal
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #18 on: August 06, 2008, 04:35:45 pm »
if you can cheat without users notice, you can do that. Programmers of course cheat to a easier way, since it not allways need to been perfect, because users doscent notice that.

I did some "cheat" tricks too in Java Space Taxi (http://www.spacetaxi.net) (before I found arcadecontrols.com) in some years ago to compress so much of possible with a fine quality, so they was fast to download. On the title screen, the logo is really a jpg with a offscreen 2 color gif transparency file, so the stars could been checking if its should appear or not. That jpg compressed much better than gif with a better quality. The stars was needed to move in the front layer due some mystery FPS problem on some machines, and in the fact jpg doesn't support transparency. I guess that only can been spotted on taxi light, if you look close, but that was ok.

Even the help screen was a mix of gif and jpg to take much advance of the compression type as possible and save space on that way.

So with Fe like AtomicFE, if it really not need to been pixel perfect, that is simple doesn't need to that....
« Last Edit: August 06, 2008, 04:40:19 pm by Space Fractal »
Decade Old Work: MultiFE, ArcadeMusicBox
Today Works: Various Spectrum Next games from Rusty Pixels and html5 games.

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #19 on: August 06, 2008, 06:56:56 pm »
Space Taxi!!!  One of my favorite game on C64!!    "Hey Taxi!"...

I wanted to try yours but link seems broken.   :'(

Quote
So with Fe like AtomicFE, if it really not need to been pixel perfect, that is simple doesn't need to that....

Sorry, surely due to my English, but i don't understand this sentence?  ???

Space Fractal

  • Wiki Master
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1888
  • Last login:September 26, 2023, 11:32:13 am
  • Space Fractal
    • Space Fractal
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #20 on: August 07, 2008, 07:21:51 am »
Just say I was agree with you about pixel perfection.....

Space Taxi should work again. But in some browers the speed might go insane (should run about 30fps). I look what it happens when I went home.

I really loved the Amiga version of the game, but also C64 too. It a nice concept. I need to create a arcadecab friendly of this game a day (like Cheeky Mouse Deluxe)...
Decade Old Work: MultiFE, ArcadeMusicBox
Today Works: Various Spectrum Next games from Rusty Pixels and html5 games.

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: And Youki said it wasnt possible in .19! HA! ALPHA CHANNELING DONE!
« Reply #21 on: August 07, 2008, 09:37:13 am »
Thanks, i tried the game, it is excellent!!  Great Job!  :applaud: