#version 130
C++ (Qt)void compileShader(){ _shader = new QGLShaderProgram(); _shader->addShaderFromSourceCode(QGLShader::Vertex, "//#version 120\n" "varying highp vec4 _color;\n" "void main(void)\n" "{\n" " _color = (length(gl_Position) < 90 && length(gl_Position)>80) ? vec4(1,0,0,1) : gl_Color;\n" "}"); _shader->addShaderFromSourceCode(QGLShader::Fragment, "//#version 120\n" "varying highp vec4 _color;\n" "void main(void)\n" "{\n" " gl_FragColor = _color;\n" "}"); _shader->link();}