|
|
View previous topic - View next topic |
Author |
Message |
God_Cells Milk Maid
Joined: 29 May 2002 Posts: 40 Location: Canada[Quebec]->Saguenay;
|
Posted: Fri Oct 04, 2002 3:08 am Post subject: Fenix Blade... |
[quote] |
|
I replayed Fenix blade yesterday, Sirocco, this game is extra!!!
So I noticed one thing about your engine, how MeobusFX manage translucency? I want to add translucency to my project, but I dont have any idea about alpha blending in 8 bits... Could you give me a few tricks? _________________ Be vigilant, uncle Sam is looking at you...
Take a look to my project at : L'odyssée de Zed
|
|
Back to top |
|
|
Sirocco Mage
Joined: 01 Jun 2002 Posts: 345
|
Posted: Fri Oct 04, 2002 1:16 pm Post subject: Spoo. |
[quote] |
|
Well, if you're using Allegro it's pretty simple. First ,you set up your palette, then you make a lookup table (or sixteen, heh) and then you're good to go :)
The reason FB gets away with such relatively adequate transparencies/fades/blends is due to the entire game sharing a single palette. Granted, there are reserved colors for the GUI, and bands of colors that are held for palette rotation, but the other 230+ colors never change. If you carefully pick your colors, you can get away with it.
This allows you to make certain assumptions about the way things work.
This also allows you to 'cheat' and make a ton of lookup tables so you can do nifty stuff like scanlines, interpolation, and fades -- stuff no one expects in 8bpp color modes. Yay.
Shadows work off a 'dark' color map (where all colors progress toward 0,0,0), highlights work on a 'bright' color map (where all colors progress toward 63,63,63), translucency works off a map based upon luma values, and then there are 16 color maps for regular transparency so you can do sprite fades. Yeah, it sucks up a bit of RAM, but it's not like we're working on 386s anymore ;)
If you can basic, 'cheap' translucency, you can take the luminosity value for the color and use it to map it to another color. For example, if you have 64 colors of blue in a smooth gradient from dark to light, you could take each pixel and use it's luma value to map it to a blue color. Since those calculations are time consuming, make a lookup table instead :)
I suppose that's all kinda vague, but keep asking questions if there's more you need to know.
.
|
|
Back to top |
|
|
XMark Guitar playin' black mage
Joined: 30 May 2002 Posts: 870 Location: New Westminster, BC, Canada
|
Posted: Fri Oct 04, 2002 8:55 pm Post subject: |
[quote] |
|
If you're using 16bpp do you need to use lookup tables? _________________ Mark Hall
Abstract Productions
I PLAYS THE MUSIC THAT MAKES THE PEOPLES FALL DOWN!
|
|
Back to top |
|
|
Sirocco Mage
Joined: 01 Jun 2002 Posts: 345
|
Posted: Fri Oct 04, 2002 10:04 pm Post subject: Nope. |
[quote] |
|
Not normally, although you might find uses for it with certain paletted images. High/true color video modes bypass palettes entirely, so you gain flexibility at the expense of speed.
.
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Fri Oct 04, 2002 10:20 pm Post subject: |
[quote] |
|
- Nexus 13 provides some open-source routines for using Translucency in 13h mode. _________________ - Jaeda
|
|
Back to top |
|
|
God_Cells Milk Maid
Joined: 29 May 2002 Posts: 40 Location: Canada[Quebec]->Saguenay;
|
Posted: Sat Oct 05, 2002 5:01 am Post subject: |
[quote] |
|
Ok, I understand, I thought that you use another technique for translucencies... A guy on internet (named Randy Reit, the coder of zdoom) gave me some clues about making full 256 translucencies with only 97 k of table... instead of megs... but his explanations wasn't clear... so I don't know how to code that. If you want, we could take look at those explanations together, you could even find a purpose for FB ^_^. I still have the forum post. I guess that Randy's way to do translucencies is more time consuming than lookup tables way, but he said that this is the quickest way to make translucencies without a bunch of lookup table...
So, a bunch of table for translucencies isn't apropriate in the case of my project, the palette change constantly from scenes to scenes, I shared my palette into 2 parts, background color and sprite color... sprites colors do not change often... Scenes do change often, so I can't allow a recalculation of 100 * 64k trans. table... in evry scenes... I'm stuck...
Thank you!
Where are Nexus 13 publications? _________________ Be vigilant, uncle Sam is looking at you...
Take a look to my project at : L'odyssée de Zed
|
|
Back to top |
|
|
Sirocco Mage
Joined: 01 Jun 2002 Posts: 345
|
Posted: Sat Oct 05, 2002 8:00 pm Post subject: Sirocco does not dance. |
[quote] |
|
Yeah, email me his post, or the link, or whatever. I'm always interested in efficiency :)
Unfortunately, the way it works in 8bpp is: either create a lookup table (or two...heh), or you slug the CPU into oblivion doing countless calculations per frame.
If you want raw flexibility, hicolor is the way -- but if you want rock-solid frame rates (and support) across a huge array of machine specs, 8bpp is the road to look at. In your case, I'd suggest going with 16bpp.
.
|
|
Back to top |
|
|
God_Cells Milk Maid
Joined: 29 May 2002 Posts: 40 Location: Canada[Quebec]->Saguenay;
|
Posted: Sat Oct 05, 2002 11:46 pm Post subject: |
[quote] |
|
Ok, I putted the message on my website's ftp to allow RPGDX community reading it. It's located at :
http://pixidream.iquebec.com/pixidream/tutoriels/trans.htm
I don't want to work with 16 bpp, my computer is pretty old (pentium 120) and its hardware do not support 320x200x16... 640x480x16 using pixel doubling... is a "mangeur de cycle", a CPU time eater, I hate non-performance! You probably know what I mean!
So, haves a good reading ^_^. _________________ Be vigilant, uncle Sam is looking at you...
Take a look to my project at : L'odyssée de Zed
|
|
Back to top |
|
|
janus Mage
Joined: 29 Jun 2002 Posts: 464 Location: Issaquah, WA
|
Posted: Mon Oct 07, 2002 6:28 pm Post subject: |
[quote] |
|
You could do the pixel doubling using hardware acceleration. Well, maybe. :P Or you could render internally in 16-bit and then dither it down to 8-bit at runtime. That generates some pretty nice results.
|
|
Back to top |
|
|
Sirocco Mage
Joined: 01 Jun 2002 Posts: 345
|
Posted: Tue Oct 08, 2002 2:58 am Post subject: |
[quote] |
|
Well, the approach mentioned in the article WORKS (seen it a few years ago in a scrolly), but it's not as fast as a straight table lookup, which is why I stuck with using normal tables.
But if you're really strapped for memory, or have a palette that changes often, this may be a more viable option.
.
|
|
Back to top |
|
|
God_Cells Milk Maid
Joined: 29 May 2002 Posts: 40 Location: Canada[Quebec]->Saguenay;
|
Posted: Tue Oct 08, 2002 3:52 am Post subject: |
[quote] |
|
Sure, it's slower than look up tables! ^_^, this is a rule in the world of optimisation, more memory used to store precalculation = more speed.
But, as you say it's effective when the palette does change often... but, I dont realy understand all of his explanations... this is why i'm looking for an ingenious 8bit translucency algorithm... that appear to be hard to find, since game programming nearly abandonned 8 bit mode... today. I will continu my resaerch! Thank you.
Janus : I don't think that my card support any hardware acceleration ^_^, it do not support vesa 2.0, even when scitech display doctor is installed... grbl £¢@#, if I could have a better graphics card... _________________ Be vigilant, uncle Sam is looking at you...
Take a look to my project at : L'odyssée de Zed
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Tue Oct 08, 2002 4:56 am Post subject: |
[quote] |
|
- Nexus 13 v2.0
- The translucency table is about 48KB total. Check the generateTrnsLut sub for details. It's achieved by not storing repeat values. The translucency works quite well, you can generate it on the fly if you have to (for different palettes and such). _________________ - Jaeda
|
|
Back to top |
|
|
janus Mage
Joined: 29 Jun 2002 Posts: 464 Location: Issaquah, WA
|
Posted: Tue Oct 08, 2002 8:12 am Post subject: |
[quote] |
|
A good trick would be to use 3-2-2 as your color mode - 8-bit color, without the hassle of palettes... you can use palette tricks, but you don't have to use lookup tables, as the first 3 bits of the index is red, the next 2 is green, the next 2 is blue - it looks decent enough, and it's easy to do graphics manipulation on.
|
|
Back to top |
|
|
God_Cells Milk Maid
Joined: 29 May 2002 Posts: 40 Location: Canada[Quebec]->Saguenay;
|
Posted: Wed Oct 09, 2002 5:02 pm Post subject: |
[quote] |
|
3-3-2 palette is not realy good, did you see what look like a 332 palette? There's only 2 gradients of gray... There's only a few gradiant of pure red... that's ugly.
Thank you tenshi i'll check in those sources, I'll try to remember my Qbasic knowledges. _________________ Be vigilant, uncle Sam is looking at you...
Take a look to my project at : L'odyssée de Zed
|
|
Back to top |
|
|
|
Page 1 of 1 |
All times are GMT
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|