unroll glsl for loop for compatibility on mac
This commit is contained in:
@@ -372,9 +372,9 @@ void App::init()
|
||||
initLayout();
|
||||
title_update();
|
||||
|
||||
GLfloat width_range[2];
|
||||
glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, width_range);
|
||||
LOG("GL line range: %f - %f", width_range[0], width_range[1]);
|
||||
//GLfloat width_range[2];
|
||||
//glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE, width_range);
|
||||
//LOG("GL line range: %f - %f", width_range[0], width_range[1]);
|
||||
LOG("Screen Size: %f %f", width, height);
|
||||
|
||||
GLint fb0;
|
||||
|
||||
@@ -161,12 +161,15 @@ void App::initShaders()
|
||||
"void main() {\n"
|
||||
" mediump float stroke = 1.0 - texture(tex, uv).r;\n"
|
||||
" int zero_count = 0;\n"
|
||||
" for (int x = -1; x <= 1; x++){\n"
|
||||
" for (int y = -1; y <= 1; y++){\n"
|
||||
" if (textureOffset(tex, uv, ivec2(x, y)).r == 1.0) \n"
|
||||
" zero_count++;\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" if (textureOffset(tex, uv, ivec2(-1, -1)).r == 1.0) zero_count++;\n"
|
||||
" if (textureOffset(tex, uv, ivec2(-1, 0)).r == 1.0) zero_count++;\n"
|
||||
" if (textureOffset(tex, uv, ivec2(-1, +1)).r == 1.0) zero_count++;\n"
|
||||
" if (textureOffset(tex, uv, ivec2( 0, -1)).r == 1.0) zero_count++;\n"
|
||||
" if (textureOffset(tex, uv, ivec2( 0, 0)).r == 1.0) zero_count++;\n"
|
||||
" if (textureOffset(tex, uv, ivec2( 0, +1)).r == 1.0) zero_count++;\n"
|
||||
" if (textureOffset(tex, uv, ivec2(+1, -1)).r == 1.0) zero_count++;\n"
|
||||
" if (textureOffset(tex, uv, ivec2(+1, 0)).r == 1.0) zero_count++;\n"
|
||||
" if (textureOffset(tex, uv, ivec2(+1, +1)).r == 1.0) zero_count++;\n"
|
||||
" float edge = (zero_count > 1 && zero_count < 9) ? 0.75 : 0.0;\n"
|
||||
" frag = vec4(col.rgb, edge * (1.0 - zero_count / 9.f));\n"
|
||||
"}\n";
|
||||
|
||||
Reference in New Issue
Block a user