From fbf5b9d866db8d0433b703b672ccd29c94790ea7 Mon Sep 17 00:00:00 2001 From: rez Date: Thu, 27 Dec 2012 01:54:20 +0000 Subject: [PATCH] NEERCS: fixed color matching for copper --- neercs/video/copper.lolfx | 2 +- neercs/video/render.cpp | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/neercs/video/copper.lolfx b/neercs/video/copper.lolfx index 4dc7e17..9f6e2cf 100644 --- a/neercs/video/copper.lolfx +++ b/neercs/video/copper.lolfx @@ -38,5 +38,5 @@ void main(void) color.y = float(int(color.y * 8.0) * 32) / 256.0; color.z = float(int(color.z * 8.0) * 32) / 256.0; - gl_FragColor = vec4((source == mask_color) ? color : source, 1.0); +gl_FragColor = vec4((abs(source.x - mask_color.x) < 0.025 && abs(source.y - mask_color.y) < 0.025 && abs(source.z - mask_color.z) < 0.025) ? color : source, 1.0); } diff --git a/neercs/video/render.cpp b/neercs/video/render.cpp index f347b4f..3ae8442 100644 --- a/neercs/video/render.cpp +++ b/neercs/video/render.cpp @@ -341,9 +341,9 @@ vec4(0), /* copper */ vec4(0.0f, 1.0f, 0.05f, 0), // copper_copper.y vec4(0.0f, 1.0f, 0.02f, 0), // copper_copper.z vec4(1.0f, 8.0f, 0.25f, 0), // copper_copper.w - vec4(0.0f, 4.0f, 0.25f, 0), // copper_mask_color.x - vec4(0.0f, 4.0f, 0.25f, 0), // copper_mask_color.y - vec4(0.0f, 4.0f, 0.25f, 0), // copper_mask_color.z + vec4(0.0f, 1.0f, 0.05f, 0), // copper_mask_color.x + vec4(0.0f, 1.0f, 0.05f, 0), // copper_mask_color.y + vec4(0.0f, 1.0f, 0.05f, 0), // copper_mask_color.z vec4(0), vec4(0), /* color */ vec4( 0.0f, 1.0f, 0.05f, 0), // color_filter.x @@ -454,7 +454,7 @@ float theme_var[]={ 0,0, 0, 0.75f,0.25f,0.42f,4.0f, // copper_copper - 0.0f,4.0f,0.0f, // copper_mask_color + 0.05f,1.0f,0.0f, // copper_mask_color 0, 0, 1.0f,1.0f,1.0f, // color_filter @@ -511,7 +511,7 @@ float theme_var[]={ 0,0, 0, 0.75f,0.25f,0.42f,4.0f, // copper_copper - 0.0f,4.0f,0.0f, // copper_mask_color + 0.05f,1.0f,0.0f, // copper_mask_color 0, 0, 0.9f,0.95f,0.85f, // color_filter @@ -568,7 +568,7 @@ float theme_var[]={ 0,0, 0, 0.75f,0.25f,0.42f,4.0f, // copper_copper - 0.0f,4.0f,0.0f, // copper_mask_color + 0.05f,1.0f,0.0f, // copper_mask_color 0, 0, 1.0f,0.7f,0.0f, // color_filter @@ -625,7 +625,7 @@ float theme_var[]={ 0,0, 0, 0.75f,0.25f,0.42f,4.0f, // copper_copper - 0.0f,4.0f,0.0f, // copper_mask_color + 0.05f,1.0f,0.0f, // copper_mask_color 0, 0, 1.0f,1.0f,0.9f, // color_filter @@ -682,7 +682,7 @@ float theme_var[]={ 0,0, 0, 0.75f,0.25f,0.42f,4.0f, // copper_copper - 0.0f,4.0f,0.0f, // copper_mask_color + 0.05f,1.0f,0.0f, // copper_mask_color 0, 0, 0.7f,0.8f,1.0f, // color_filter @@ -1023,7 +1023,7 @@ void Render::TickGame(float seconds) } else { - caca_set_color_argb(m_cv_setup, setup_color.y, 0xfff);//setup_color.x); + caca_set_color_argb(m_cv_setup, setup_color.y, 0x0f0);//setup_color.x); caca_draw_line(m_cv_setup, 0, y, setup_size.z - 2, y,' '); caca_put_str(m_cv_setup, 1, y, setup_text[k]); } @@ -1040,7 +1040,7 @@ void Render::TickGame(float seconds) } else { - caca_set_color_argb(m_cv_setup, setup_color.y, 0xfff);//setup_color.x); + caca_set_color_argb(m_cv_setup, setup_color.y, 0x0f0);//setup_color.x); caca_draw_line(m_cv_setup, setup_size.z, y, setup_size.x, y,' '); caca_put_str(m_cv_setup, setup_size.z + 1, y, setup_text[k]); } @@ -1499,7 +1499,7 @@ void Render::Draw3D() shader_copper->SetUniform(shader_copper_screen_size, (vec2)screen_size); shader_copper->SetUniform(shader_copper_time, fx_angle); shader_copper->SetUniform(shader_copper_copper, vec4(copper_copper.x, copper_copper.y, copper_copper.z * 16.0f, copper_copper.w * 16.0f)); - shader_copper->SetUniform(shader_copper_mask_color, copper_mask_color / 4.0f); + shader_copper->SetUniform(shader_copper_mask_color, copper_mask_color); TraceQuad(); shader_color->Unbind(); fbo_tmp->Unbind();