Bladeren bron

added COPPER \:D/ (still buggy btw)

master
rez Sam Hocevar <sam@hocevar.net> 12 jaren geleden
bovenliggende
commit
fe73529397
4 gewijzigde bestanden met toevoegingen van 27 en 10 verwijderingen
  1. +5
    -4
      neercs/neercs.cpp
  2. +14
    -1
      neercs/video/color.lolfx
  3. +1
    -1
      neercs/video/postfx.lolfx
  4. +7
    -4
      neercs/video/render.cpp

+ 5
- 4
neercs/neercs.cpp Bestand weergeven

@@ -113,13 +113,14 @@ void Neercs::TickGame(float seconds)
int logo_x = (w - 46) / 2;
int logo_y = h / 2 - 2;

caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 ), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 )), bg_color);
caca_set_color_argb(m_caca, 0xfff, bg_color);
//caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 ), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 )), bg_color);
caca_put_str(m_caca, logo_x + 3, logo_y ,"__ _________ ______ ______ ______ ______");
caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 1), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 1)), bg_color);
//caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 1), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 1)), bg_color);
caca_put_str(m_caca, logo_x + 2, logo_y + 1, "/ \\/ / __ > __ > __ > ___// ___/ \x0a9");
caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 2), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 2)), bg_color);
//caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 2), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 2)), bg_color);
caca_put_str(m_caca, logo_x + 1, logo_y + 2, "/ / ____/ ____/ __ < <____\\___ \\");
caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 3), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 3)), bg_color);
//caca_set_color_argb(m_caca, hex_color(0.5f + 0.5f * lol::cos(m_time * 3 + M_PI / 4 * 3), 0.5f, 0.5f + 0.25f * lol::sin(m_time * 3 + M_PI / 4 * 3)), bg_color);
caca_put_str(m_caca, logo_x , logo_y + 3, "/__/\\__/\\_______________/ \\________________\\");
caca_set_color_argb(m_caca, 0xdef, bg_color);
caca_put_str(m_caca, logo_x + 5, logo_y + 5, "ALL YOUR TERMINALS ARE BELONG TO US");


+ 14
- 1
neercs/video/color.lolfx Bestand weergeven

@@ -14,6 +14,7 @@ void main()

uniform sampler2D texture;
uniform vec2 screen_size;
uniform float time;
uniform vec3 filter;
uniform vec3 color;
uniform float flash;
@@ -22,6 +23,17 @@ void main(void)
{
vec2 p=gl_FragCoord.xy/screen_size.xy;
vec3 c=texture2D(texture,p).xyz;
vec3 o=c;

float sinus=0.125+0.125*sin(p.x*float(screen_size.x/32)+time)+0.125*cos(p.y*float(screen_size.x/32)+time);
vec3 copper=vec3(0.5+sinus);
copper.x+=0.5*cos(p.y*float(screen_size.y/64)+time);
copper.z+=0.5*sin(p.y*float(screen_size.y/64)+time);
copper*=0.5+0.25*cos(p.y*float(screen_size.x/6)-time*2.0);

copper.x=float(int(copper.x*8.0)*32)/256.0;
copper.y=float(int(copper.y*8.0)*32)/256.0;
copper.z=float(int(copper.z*8.0)*32)/256.0;

float a=(c.x+c.y+c.z)/3.0;
c=mix(c,vec3(a),color.z); // grayscale
@@ -30,5 +42,6 @@ void main(void)
c=0.5+(c-0.5)*color.y; // contrast
c+=flash; // flash

gl_FragColor=vec4(c,1.0);
//gl_FragColor=vec4(c,1.0);
gl_FragColor=vec4((o.x>0.5&&o.y>0.5&&o.z>0.5)?copper:c,1.0);
}

+ 1
- 1
neercs/video/postfx.lolfx Bestand weergeven

@@ -57,7 +57,7 @@ void main(void)
vec3 g1=get_color(texture,z1-ghost1.xy);
vec3 g2=get_color(texture,z2-ghost2.xy);

vec3 c=source+g1*g1*ghost1.w+g2*g2*ghost2.w; // mix
vec3 c=source+g1*ghost1.w+g2*ghost2.w; // mix

float v=aberration/float(screen_size.x)+aberration/float(screen_size.x)*(2.0-mask);
vec3 ca1=get_color(texture,vec2(z.x-v,z.y));


+ 7
- 4
neercs/video/render.cpp Bestand weergeven

@@ -92,16 +92,16 @@ vec2 glow_mix(0.6f,0.4f); // glow mix [source mix,glow mix]
vec2 glow_large(2.0f,2.0f); // large glow radius [center,corner]
vec2 glow_small(1.0f,1.0f); // small glow radius [center,corner]
vec2 blur(0.5f,0.5f); // blur radius [center,corner]
vec3 color_filter(0.9f,1.0f,0.7f); // color filter [red,green,blue]
vec3 color_color(1.1f,1.1f,0.25f); // color modifier [brightness,contrast,grayscale]
vec3 color_filter(0.9f,0.9f,1.0f); // color filter [red,green,blue]
vec3 color_color(1.2f,1.1f,0.25f); // color modifier [brightness,contrast,grayscale]
vec2 noise_offset(2.0f,2.0f); // random line [horizontal,vertical]
float noise_noise = 0.25f; // noise
vec3 noise_retrace(1.0f,1.0f,0.5f); // retrace [strength,length,speed]
vec2 postfx_deform(0.7f,0.54f); // deformation [ratio,zoom]
float postfx_vignetting = -0.5f; // vignetting strength
float postfx_aberration = 4.0f; // chromatic aberration
vec4 postfx_ghost1(0.01f,0.0f,0.1f,-0.4f); // ghost picture 1 [position x,position y,position z,strength]
vec4 postfx_ghost2(0.02f,0.0f,0.1f,0.4f); // ghost picture 2 [position x,position y,position z,strength]
vec4 postfx_ghost1(0.01f,0.0f,0.1f,-0.25f); // ghost picture 1 [position x,position y,position z,strength]
vec4 postfx_ghost2(0.02f,0.0f,0.1f,0.25f); // ghost picture 2 [position x,position y,position z,strength]
vec4 postfx_moire_h(0.75f,-0.25f,0.0f,1.0f); // vertical moire [base,variable,repeat x,repeat y]
vec4 postfx_moire_v(0.75f,-0.25f,1.0f,1.5f); // horizontal moire [base,variable,repeat x,repeat y]
vec4 postfx_scanline_h(0.75f, 0.25f,0.0f,2.0f); // vertical scanline [base,variable,repeat x,repeat y]
@@ -381,6 +381,7 @@ ShaderUniform shader_glow_glow,
shader_glow_mix;
ShaderUniform shader_color_texture,
shader_color_screen_size,
shader_color_time,
shader_color_filter,
shader_color_color,
shader_color_flash;
@@ -475,6 +476,7 @@ int Render::InitDraw(void)
shader_color = Shader::Create(lolfx_color);
shader_color_texture = shader_color->GetUniformLocation("texture");
shader_color_screen_size = shader_color->GetUniformLocation("screen_size");
shader_color_time = shader_color->GetUniformLocation("time");
shader_color_filter = shader_color->GetUniformLocation("filter");
shader_color_color = shader_color->GetUniformLocation("color");
shader_color_flash = shader_color->GetUniformLocation("flash");
@@ -950,6 +952,7 @@ void Render::Draw3D()
shader_color->Bind();
shader_color->SetUniform(shader_color_texture, fbo_front->GetTexture(), 0);
shader_color->SetUniform(shader_color_screen_size, (vec2)screen_size);
shader_color->SetUniform(shader_color_time, fx_angle);
shader_color->SetUniform(shader_color_filter, color_filter);
shader_color->SetUniform(shader_color_color, color_color);
shader_color->SetUniform(shader_color_flash, flash_value);


Laden…
Annuleren
Opslaan