rez Sam Hocevar <sam@hocevar.net> 12 лет назад
Родитель
Сommit
12883054aa
3 измененных файлов: 44 добавлений и 5 удалений
  1. +5
    -4
      neercs/neercs.cpp
  2. +38
    -0
      neercs/video/copper.lolfx
  3. +1
    -1
      neercs/video/render.cpp

+ 5
- 4
neercs/neercs.cpp Просмотреть файл

@@ -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, 0x8ac, 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");


+ 38
- 0
neercs/video/copper.lolfx Просмотреть файл

@@ -0,0 +1,38 @@
-- GLSL.Vert --

#version 120

void main()
{
gl_Position=gl_Vertex;
gl_TexCoord[0]=gl_MultiTexCoord0;
}

-- GLSL.Frag --

#version 120

uniform sampler2D texture;
uniform vec2 screen_size;
uniform float time;
uniform vec4 copper;

void main(void)
{
vec2 p=gl_TexCoord[0].xy;
vec3 color=texture2D(texture,p).xyz;

vec3 copper=vec3(0.5);
copper.x+=0.5*cos(p.y*float(screen_size.y/64)+time*2.0);
copper.z+=0.5*sin(p.y*float(screen_size.y/64)+time*2.0);

copper*=0.75+0.375*cos(p.y*float(screen_size.y/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;
*/

gl_FragColor=vec4((color==1.0)?copper:color,1.0);
}

+ 1
- 1
neercs/video/render.cpp Просмотреть файл

@@ -101,7 +101,7 @@ 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
float postfx_aberration = 3.0f; // chromatic aberration
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]


Загрузка…
Отмена
Сохранить