collapse

Author Topic: Antialias (for indexed sprites)  (Read 1593 times)

0 Members and 1 Guest are viewing this topic.

Offline Arias

  • Stage Creator
  • *****
  • Posts: 355
  • Country: United States us
  • Last Login:June 18, 2023, 06:33:08 PM
Antialias (for indexed sprites)
« on: January 11, 2019, 09:46:07 PM »
A quick guide for Hi-res stuff, since 1.1 was released this method became obsolete, however, probably there are people still creating for 1.0 or lower. There was a tutorial by ExShadow iirc, but can't seem to find it, so I made one myself.

There are a couple of layering "tricks" that make easier coding hi-res stuff while using indexed images.

Let's start with this.



As you can see, the edges of this image are antialiased (they're smoothed with transparent pixels to help them blend with whatever you put behind it), this is usual in hi-res stuff, normally to code this in mugen (indexed), one would have to remove the alpha pixels leaving sharp edges & reducing the quality, but using an image with brightness at max + substractive transparency can help to reduce the time spent cleaning the alpha pixels (that's if you don't know how to create a script to do it) and improves the overall look.



So your layers should look like this:

This is the alpha that uses substractive transparency, it goes behind your sprite.


This is your normal sprite that uses additive transparency.


And in your def file lines should be like this:

[BG 0];-----------------------alpha with substractive trans.
type  = normal
spriteno = 60, 1
layerno = 1             
start = -800, 289
delta = 2, 2
trans = sub

[BG 0];----------------------your normal sprite with additive trans.
type  = normal
spriteno = 60, 0
layerno = 1               
start = -800, 289
delta = 2, 2
trans = add

This is the result:



Since it's a foreground object let's say I want to add some defocus:







Now you can notice a black edge around the barrel, this can be fixed by decreasing the brightness of the alpha OR adding another additive layer BEHIND the substractive one, like this:

[BG 0];-----------------------alpha with addalpha trans, 180,256 works fine most of the time.
type  = normal
spriteno = 60, 1
layerno = 1               
start = -800, 289
delta = 2, 2
trans = addalpha
alpha = 180,256

[BG 0];-----------------------alpha with substractive trans.
type  = normal
spriteno = 60, 1
layerno = 1             
start = -800, 289
delta = 2, 2
trans = sub

[BG 0];----------------------your normal sprite with additive trans.
type  = normal
spriteno = 60, 0
layerno = 1               
start = -800, 289
delta = 2, 2
trans = add

The result:



The downside to this method is that if your stage has too many big layers you shouldn't abuse it too much, otherwise you can cause slow down on lower-end computers, with opengl is not a problem though.

This can be used to give more opacity to hi-res effects in characters as well, ever noticed how non-bright colors become way too transparent with add-transparency?






There are a couple more things, but will post it later.
« Last Edit: January 17, 2019, 01:15:06 PM by 𝓐𝓵𝓲𝓬𝓮 »



Offline O Ilusionista

  • Since 1999 and kicking :)
  • IMT Content Architect
  • *
  • Posts: 12476
  • Country: Brazil br
  • Last Login:November 11, 2024, 12:35:15 PM
  • OpenBOR & Mugen addicted
    • BMT - Brazil Mugen Team
    • Email
Re: Antialias (for indexed sprites)
« Reply #1 on: January 12, 2019, 09:16:52 PM »
Oh, this is really awesome.

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

D2TD VS Showcase Thread by D2TD
[November 24, 2024, 09:12:03 AM]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by LightFlare
[November 21, 2024, 09:44:09 PM]


Terrordrome: Rise of the Boogeymen Extended Version ( jeepers creepers) version by leonardo
[November 19, 2024, 10:22:47 PM]


Hill of the Nameless(1.1 Only) by Vegaz by LightFlare
[November 19, 2024, 10:50:39 AM]


Golden Axe Returns by gokudo99
[November 19, 2024, 03:59:31 AM]


Barkley Shut Up and Jam! Stages by Vegaz by LightFlare
[November 12, 2024, 11:26:21 AM]


[BOR] _Avengers United Battle Force_ by O Ilusionista
[November 11, 2024, 12:35:24 PM]


Eternal Lament Stage 1.1 & 1.0 by O Ilusionista
[November 11, 2024, 12:34:54 PM]


MatreroG's Stages W.I.P. Concepts by MatreroG
[November 11, 2024, 07:00:56 AM]


Spooky House(1.1 Only/AIGS) by Vegaz by LightFlare
[October 31, 2024, 11:31:36 AM]

* IMT Calendar

November 2024
Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 [25] 26 27 28 29 30

SimplePortal 2.3.5 © 2008-2012, SimplePortal