Kaynağa Gözat

neercs: added all mirror side & finetuned default theme

master
rez Sam Hocevar <sam@hocevar.net> 12 yıl önce
ebeveyn
işleme
6dbdf91b5e
2 değiştirilmiş dosya ile 12 ekleme ve 10 silme
  1. +5
    -3
      neercs/video/mirror.lolfx
  2. +7
    -7
      neercs/video/render.cpp

+ 5
- 3
neercs/video/mirror.lolfx Dosyayı Görüntüle

@@ -22,8 +22,10 @@ void main(void)
vec3 source = texture2D(texture, p).xyz;

vec3 color = vec3(0.0);
if(p.x < mirror.x) color = (texture2D(texture, vec2(mirror.x - (1.0 - mirror.x * mirror.w + p.x * mirror.w), p.y)).xyz) * (mirror.z / mirror.x * p.x);
if(p.x > 1.0 - mirror.x) color = (texture2D(texture, vec2(mirror.x - (1.0 - mirror.x * mirror.w + p.x * mirror.w), p.y)).xyz) * (mirror.z / mirror.x * (1.0 - p.x));
if(p.x < mirror.x) color = (texture2D(texture, vec2(mirror.x + (mirror.x - p.x) * mirror.w, p.y)).xyz) * (mirror.z / mirror.x * p.x);
if(p.x > 1.0 - mirror.x) color = (texture2D(texture, vec2(- mirror.x - (mirror.x + p.x) * mirror.w, p.y)).xyz) * (mirror.z / mirror.x * (1.0 - p.x));
if(p.y < mirror.y) color = (texture2D(texture, vec2(p.x, mirror.y + (mirror.y - p.y) * mirror.w)).xyz) * (mirror.z / mirror.y * p.y);
if(p.y > 1.0 - mirror.y) color = (texture2D(texture, vec2(p.x, - mirror.y - (mirror.y + p.y) * mirror.w)).xyz) * (mirror.z / mirror.y * (1.0 - p.y));

gl_FragColor = vec4(source + color, 1.0);
gl_FragColor = vec4(source + color + color * color, 1.0);
}

+ 7
- 7
neercs/video/render.cpp Dosyayı Görüntüle

@@ -47,7 +47,7 @@ extern char const *lolfx_mirror;
/*
* Global variable -- ugly
*/
bool g_setup = true;
bool g_setup = false;

/*
* Various variables
@@ -114,16 +114,16 @@ vec4 postfx_moire_h(0.75f,-0.25f,0.0f,1.0f); // vertical moire [base,variable
vec4 postfx_moire_v(0.75f,-0.25f,1.0f,1.5f); // horizontal moire [base,variable,repeat,shift]
vec4 postfx_scanline_h(0.75f,0.0f,0.0f,0.0f); // vertical scanline [base,variable,repeat,shift]
vec4 postfx_scanline_v(0.75f,-0.25f,2.0f,0.0f); // horizontal scanline [base,variable,repeat,shift]
vec3 postfx_corner(0.0f,0.75f,0.95f); // corner [width,radius,blur]
vec4 mirror(0.7f,0.7f,0.5f,4.0f); // mirror [width,height,strength,ratio]
vec3 postfx_corner(0.0f,0.8f,0.96f); // corner [width,radius,blur]
vec4 mirror(0.6f,0.6f,0.25f,3.0f); // mirror [width,height,strength,ratio]
/* text variable */
ivec2 ratio_2d(2,3); // 2d ratio
ivec2 ratio_2d(3,3); // 2d ratio
ivec2 map_size(256,256); // texture map size
ivec2 font_size(8,8); // font size
ivec2 canvas_char(0,0); // canvas char number
ivec2 canvas_size(0,0); // caca size
/* window variable */
ivec2 border = vec2(2,1) * ratio_2d * font_size; // border width
ivec2 border = vec2(1,1) * ratio_2d * font_size; // border width
/* setup variable */
bool setup_switch = false; // switch [option/item]
int setup_n = 0; // item/option number
@@ -290,10 +290,10 @@ vec4 setup_var[]={ // setup variable [start,end,step,value]
vec4(0), /* screen */
vec4(0, 1, 1, 1),
vec4(0.0f, 1.0f, 0.05f, postfx_deform.x),
vec4(0.5f, 0.7f, 0.01f, postfx_deform.y),
vec4(0.2f, 0.7f, 0.01f, postfx_deform.y),
vec4(0.0f, 4.0f, 0.10f, postfx_corner.x),
vec4(0.0f, 1.0f, 0.05f, postfx_corner.y),
vec4(0.0f, 1.0f, 0.05f, postfx_corner.z),
vec4(0.8f, 1.0f, 0.01f, postfx_corner.z),
vec4(0.0f, 1.0f, 0.10f, postfx_vignetting),
vec4(0),
vec4(0), /* copper */


Yükleniyor…
İptal
Kaydet