

Program->setUniformValue(samplerUniLoc, pattern) Program->setUniformValue(colorUniformLoc, color) Program->enableAttributeArray(texCoordAttribLoc) Program->setAttributeValue(texCoordAttribLoc, 3) Program->enableAttributeArray(vertexAttribLoc) Program->setAttributeArray(vertexAttribLoc, GL_FLOAT, vertices.data(), tupleSize)

GlClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) SamplerUniLoc = program->uniformLocation("u_sampler") MvpMatrixUniLoc = program->uniformLocation("u_mvpMatrix") ĬolorUniformLoc = program->uniformLocation("u_color") TexCoordAttribLoc = program->attributeLocation("a_texCoord") VertexAttribLoc = program->attributeLocation("a_vertex") Program = new QGLShaderProgram(context(), this) VShader->compileSourceFile(":/shaders/vertex.vsh") įShader = new QGLShader(QGLShader::Fragment, context(), this) įShader->compileSourceFile(":/shaders/fragment.fsh") VShader = new QGLShader(QGLShader::Vertex, context(), this) : QGLWidget(QGLFormat(QGL::DoubleBuffer | QGL::Rgba | QGL::DepthBuffer), parent) I am trying the following but I am struggling to understand how to get this working. Question is how do I accomplish that? I have tried without success :(. You can generate a 1D texture for your stipple texture, and map it onto your line geometry using the repeat factor as texture coordinates. If you want to emulate OpenGL’s glLineStipple for thick lines, then they use a 16-bit pattern. I found a description in another thread but I am not sure how to implement it, but this is exactly what I am looking to try and do.
