YesNoOk
avatar

Someone Get Up There And Fix The Antenna! (Read 4862 times)

Started by Davod Sirloin, August 14, 2013, 09:45:48 pm
Share this topic:
Someone Get Up There And Fix The Antenna!
#1  August 14, 2013, 09:45:48 pm
  • ******
  • YOMI
    • www.justnopoint.com/lbends
Re: Someone Get Up There And Fix The Antenna!
#2  August 14, 2013, 09:50:29 pm
  • ****
  • play more SNK games
    • South Africa
    • www.trinitymugen.net/
Why would I want this? :stare:
Re: Someone Get Up There And Fix The Antenna!
#3  August 14, 2013, 09:58:17 pm
  • *****
    • Mexico

Bea

Re: Someone Get Up There And Fix The Antenna!
#4  August 14, 2013, 11:08:31 pm
  • *****
  • A paragon of purity, chastity and innocence
    • Brazil
    • www.smeenet.org

  • Online
Ohhh... pixel shaders.
Could be handy... if you could call them at specific moments.
To quote Lt. Frank Drebin: "Cheer up, Ed. This is not goodbye. It's just I won't ever see you again."

All your MFG bandwidth is belong to me.
Re: Someone Get Up There And Fix The Antenna!
#5  August 14, 2013, 11:11:33 pm
  • ****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • pv2matos@gmail.com
Re: Someone Get Up There And Fix The Antenna!
#6  August 15, 2013, 12:06:06 am
  • ******
  • YOMI
    • www.justnopoint.com/lbends
It's a fragment shader that modifies the colors of indexed sprites to greenscale.
Re: Someone Get Up There And Fix The Antenna!
#7  August 15, 2013, 12:22:37 am
  • ****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • pv2matos@gmail.com
Re: Someone Get Up There And Fix The Antenna!
#8  August 15, 2013, 12:28:55 am
  • ******
  • YOMI
    • www.justnopoint.com/lbends
The file is written in GLSL

Go down to the bottom and you'll see the main program and where I've made a modification

Code:
void main()
{
  vec4 color = nearest();

#if !defined(PALFX_DISABLE)
  palfx(color);
#endif

float grayval = 0.21*color.r + .71*color.g + .07*color.b;
 
  gl_FragColor = vec4(0,grayval,0,color.a);
}

nearest() is a function defined earlier in the file that determines which color of the palette (sampler1D texunit1) to use for the current pixel.
palfx() is the function defined that executes all of the palfx stuff you coded into your character.

gl_FragColor is the variable which the shader returns after the code has finished running.  Here I've calculated a weighted average based on the color I was going to use, and instead used that value as the green channel for the final result.  I've zeroed out red and blue, and copied the alpha value from the original result.

     Posted: August 15, 2013, 12:58:07 am
Unfortunately mugen currently does not employ the use of a full screen shader.  This means that messing with the vertex shader is pretty much off-limits.


File is embarassingly small so indexed.vert is in its entirety here
Code:
#version 120

void main()
{
vec4 foo = gl_Vertex;
foo.x *= .5;
foo.y *= .5;

  gl_TexCoord[0] = gl_MultiTexCoord0;
 
  gl_Position = gl_ModelViewProjectionMatrix * foo;
}
Cartoon Outlines
#9  August 15, 2013, 02:09:23 am
  • ******
  • YOMI
    • www.justnopoint.com/lbends
Re: Someone Get Up There And Fix The Antenna!
#10  August 15, 2013, 02:22:40 am
  • ******
  • Q.E.D.
    • USA
    • network.mugenguild.com/jmorphman

  • Online
Wow, this is pretty cool.
Re: Someone Get Up There And Fix The Antenna!
#11  August 15, 2013, 05:30:23 am
  • ******
  • YOMI
    • www.justnopoint.com/lbends
Re: Someone Get Up There And Fix The Antenna!
#12  August 15, 2013, 05:37:10 am
  • ******
  • Just... Ask the question
    • Panama

  • Online
So, this are image renderers for mugen?? or something coded into a character?? I´m pretty clueless with this but I gotta say it´s pretty interesting. The cartoon outline is pretty cool.
Re: Someone Get Up There And Fix The Antenna!
#13  August 15, 2013, 05:39:19 am
  • ******
  • Q.E.D.
    • USA
    • network.mugenguild.com/jmorphman

  • Online
Seems to be bugging out for afterimages:
Re: Someone Get Up There And Fix The Antenna!
#14  August 15, 2013, 05:40:45 am
  • ******
  • YOMI
    • www.justnopoint.com/lbends
I removed a line of code that elecbyte wrote to hackishly fix that.  I shouldn't have.

Edit: Fixed
Edit2: AAAAAAAAAAA fixed for real
Last Edit: August 15, 2013, 06:19:00 am by Smile Master
Re: Someone Get Up There And Fix The Antenna!
#15  August 15, 2013, 07:59:57 am
  • **
    • Russia
Is it possible to use Doubleres=2 like in winmugen but in mugen 1.0 and above using this tool?))
Re: Someone Get Up There And Fix The Antenna!
#16  August 15, 2013, 08:02:37 am
  • ******
  • YOMI
    • www.justnopoint.com/lbends
You can't do that already?
Also, no.  That requires using the vertex shader.
Re: Someone Get Up There And Fix The Antenna!
#17  August 15, 2013, 08:25:10 am
  • *****
    • Puerto Rico
    • www.youtube.com/user/Darkflares
Some of these effects woud be great in videos...

Send me a PM if you decide to add me on PSN, so I don't mistake you for a random Friend whore.
Re: Someone Get Up There And Fix The Antenna!
#18  August 15, 2013, 08:27:35 am
  • ****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • pv2matos@gmail.com
I love the cartoon shader its awesome! the only thing that bugs me is that it traces shadows and
some things that should be transparent like rays of light.
other than that i love it.  BTW is this only for 1.1? i was gonna use it in
Capcom vs the World but didnt see the frag files in the data folder.
some pics for the hell of it.

Re: Someone Get Up There And Fix The Antenna!
#19  August 15, 2013, 08:44:18 am
  • ******
  • YOMI
    • www.justnopoint.com/lbends
Re: Someone Get Up There And Fix The Antenna!
#20  August 15, 2013, 09:23:53 am
  • ****
  • Estoy siempre listo para un desafío.
    • Puerto Rico
    • pv2matos@gmail.com
how about a 3D glasses filter?