diff --git a/qglview/glwidget.cpp b/qglview/glwidget.cpp index 785a25d..f8f3c2e 100644 --- a/qglview/glwidget.cpp +++ b/qglview/glwidget.cpp @@ -3,8 +3,7 @@ #include -GLWidget::GLWidget(QWidget *parent) : QWidget(parent) -{ +GLWidget::GLWidget(QWidget *parent) : QWidget(parent) { view_ = new QGLView(); view_->setFlag(Qt::FramelessWindowHint); container = QWidget::createWindowContainer(view_, this); @@ -18,6 +17,187 @@ GLWidget::GLWidget(QWidget *parent) : QWidget(parent) } +QColor GLWidget::backColor() const { + return view_->backColor(); +} + + +float GLWidget::lineWidth() const { + return view_->lineWidth(); +} + + +float GLWidget::FOV() const { + return view_->FOV(); +} + + +float GLWidget::depthStart() const { + return view_->depthStart(); +} + + +float GLWidget::depthEnd() const { + return view_->depthEnd(); +} + + +QColor GLWidget::ambientColor() const { + return view_->ambientColor(); +} + + +bool GLWidget::isLightEnabled() const { + return view_->isLightEnabled(); +} + + +bool GLWidget::isGrabMouseEnabled() const { + return view_->isGrabMouseEnabled(); +} + + +bool GLWidget::isMouseRotateEnabled() const { + return view_->isMouseRotateEnabled(); +} + + +bool GLWidget::isMouseSelectionEnabled() const { + return view_->isMouseSelectionEnabled(); +} + + +bool GLWidget::isCameraOrbit() const +{ + return view_->isCameraOrbit(); +} + + +bool GLWidget::isHoverHaloEnabled() const { + return view_->isHoverHaloEnabled(); +} + + +QColor GLWidget::hoverHaloColor() const { + return view_->hoverHaloColor(); +} + + +float GLWidget::hoverHaloFillAlpha() const { + return view_->hoverHaloFillAlpha(); +} + + +bool GLWidget::isSelectionHaloEnabled() const { + return view_->isSelectionHaloEnabled(); +} + + +QColor GLWidget::selectionHaloColor() const { + return view_->selectionHaloColor(); +} + + +float GLWidget::selectionHaloFillAlpha() const { + return view_->selectionHaloFillAlpha(); +} + + +void GLWidget::stop() { + return view_->stop(); +} + + +void GLWidget::start(float freq) { + return view_->start(freq); +} + + +void GLWidget::setBackColor(const QColor & c) { + view_->setBackColor(c); +} + + +void GLWidget::setLineWidth(const float & arg) { + view_->setLineWidth(arg); +} + + +void GLWidget::setFOV(const float & arg) { + view_->setFOV(arg); +} + + +void GLWidget::setDepthStart(const float & arg) { + view_->setDepthStart(arg); +} + + +void GLWidget::setDepthEnd(const float & arg) { + view_->setDepthEnd(arg); +} + + +void GLWidget::setAmbientColor(const QColor & arg) { + view_->setAmbientColor(arg); +} + + +void GLWidget::setLightEnabled(const bool & arg) { + view_->setLightEnabled(arg); +} + + +void GLWidget::setGrabMouseEnabled(const bool & arg) { + view_->setGrabMouseEnabled(arg); +} + + +void GLWidget::setMouseRotateEnabled(const bool & arg) { + view_->setMouseRotateEnabled(arg); +} + + +void GLWidget::setMouseSelectionEnabled(const bool & arg) { + view_->setMouseSelectionEnabled(arg); +} + + +void GLWidget::setCameraOrbit(const bool & arg) { + view_->setCameraOrbit(arg); +} + + +void GLWidget::setHoverHaloEnabled(const bool & arg) { + view_->setHoverHaloEnabled(arg); +} + + +void GLWidget::setHoverHaloColor(const QColor & arg) { + view_->setHoverHaloColor(arg); +} + + +void GLWidget::setHoverHaloFillAlpha(const float & arg) { + view_->setHoverHaloFillAlpha(arg); +} + + +void GLWidget::setSelectionHaloEnabled(const bool & arg) { + view_->setSelectionHaloEnabled(arg); +} + + +void GLWidget::setSelectionHaloColor(const QColor & arg) { + view_->setSelectionHaloColor(arg); +} + + +void GLWidget::setSelectionHaloFillAlpha(const float & arg) { + view_->setSelectionHaloFillAlpha(arg); +} + + void GLWidget::viewDoubleClicked() { // qDebug() << "click widget!!"; if (view_->windowState() == Qt::WindowFullScreen) { diff --git a/qglview/glwidget.h b/qglview/glwidget.h index 6a118e3..e256e47 100644 --- a/qglview/glwidget.h +++ b/qglview/glwidget.h @@ -9,11 +9,64 @@ class QGLView; class GLWidget : public QWidget { Q_OBJECT + Q_PROPERTY (QColor backColor READ backColor WRITE setBackColor) + Q_PROPERTY (float lineWidth READ lineWidth WRITE setLineWidth) + Q_PROPERTY (float FOV READ FOV WRITE setFOV) + Q_PROPERTY (float depthStart READ depthStart WRITE setDepthStart) + Q_PROPERTY (float depthEnd READ depthEnd WRITE setDepthEnd) + Q_PROPERTY (QColor ambientColor READ ambientColor WRITE setAmbientColor) + Q_PROPERTY (bool grabMouse READ isGrabMouseEnabled WRITE setGrabMouseEnabled) + Q_PROPERTY (bool mouseRotate READ isMouseRotateEnabled WRITE setMouseRotateEnabled) + Q_PROPERTY (bool mouseSelection READ isMouseSelectionEnabled WRITE setMouseSelectionEnabled) + Q_PROPERTY (bool cameraOrbit READ isCameraOrbit WRITE setCameraOrbit) + Q_PROPERTY (bool hoverHalo READ isHoverHaloEnabled WRITE setHoverHaloEnabled) + Q_PROPERTY (QColor hoverHaloColor READ hoverHaloColor WRITE setHoverHaloColor) + Q_PROPERTY (float hoverHaloFillAlpha READ hoverHaloFillAlpha WRITE setHoverHaloFillAlpha) + Q_PROPERTY (bool selectionHalo READ isSelectionHaloEnabled WRITE setSelectionHaloEnabled) + Q_PROPERTY (QColor selectionHaloColor READ selectionHaloColor WRITE setSelectionHaloColor) + Q_PROPERTY (float selectionHaloFillAlpha READ selectionHaloFillAlpha WRITE setSelectionHaloFillAlpha) public: explicit GLWidget(QWidget *parent = nullptr); QGLView * view() {return view_;} + QColor backColor() const; + float lineWidth() const; + float FOV() const; + float depthStart() const; + float depthEnd() const; + QColor ambientColor() const; + bool isLightEnabled() const; + bool isGrabMouseEnabled() const; + bool isMouseRotateEnabled() const; + bool isMouseSelectionEnabled() const; + bool isCameraOrbit() const; + bool isHoverHaloEnabled() const; + QColor hoverHaloColor() const; + float hoverHaloFillAlpha() const; + bool isSelectionHaloEnabled() const; + QColor selectionHaloColor() const; + float selectionHaloFillAlpha() const; + public slots: + void stop(); + void start(float freq = 60.); + void setBackColor(const QColor & c); + void setLineWidth(const float & arg); + void setFOV(const float & arg); + void setDepthStart(const float & arg); + void setDepthEnd(const float & arg); + void setAmbientColor(const QColor & arg); + void setLightEnabled(const bool & arg); + void setGrabMouseEnabled(const bool & arg); + void setMouseRotateEnabled(const bool & arg); + void setMouseSelectionEnabled(const bool & arg); + void setCameraOrbit(const bool & arg); + void setHoverHaloEnabled(const bool & arg); + void setHoverHaloColor(const QColor & arg); + void setHoverHaloFillAlpha(const float & arg); + void setSelectionHaloEnabled(const bool & arg); + void setSelectionHaloColor(const QColor & arg); + void setSelectionHaloFillAlpha(const float & arg); private slots: void viewDoubleClicked(); diff --git a/qglview/plugin/qglviewplugin.cpp b/qglview/plugin/qglviewplugin.cpp index 25d2ff7..ef529c7 100644 --- a/qglview/plugin/qglviewplugin.cpp +++ b/qglview/plugin/qglviewplugin.cpp @@ -24,12 +24,14 @@ bool QGLViewPlugin::isInitialized() const { QWidget * QGLViewPlugin::createWidget(QWidget * parent) { - return new GLWidget(parent); + GLWidget * w = new GLWidget(parent); + //if (m_initialized) w->start(); + return w; } QString QGLViewPlugin::name() const { - return QLatin1String("QGLView"); + return QLatin1String("GLWidget"); } diff --git a/qglview/qglview.cpp b/qglview/qglview.cpp index 3fee974..ca09604 100644 --- a/qglview/qglview.cpp +++ b/qglview/qglview.cpp @@ -589,9 +589,9 @@ void QGLView::checkCaps() { void QGLView::reloadThisShaders() { if (!shaders_supported) return; - loadShaders(shader_select, "selection", "shaders"); - loadShaders(shader_halo, "selection_halo", "shaders"); - //loadShaders(shader_rope, "rope", "shaders"); + loadShaders(shader_select, "selection", "://shaders"); + loadShaders(shader_halo, "selection_halo", "://shaders"); + //loadShaders(shader_rope, "rope", "://shaders"); } void QGLView::glReleaseTextures(int channels) { diff --git a/qglview/qglview.qrc b/qglview/qglview.qrc index 0998b12..c50a430 100644 --- a/qglview/qglview.qrc +++ b/qglview/qglview.qrc @@ -26,5 +26,51 @@ icons/edit-copy.png icons/edit-paste.png icons/qglview.png + shaders/bloom_0.frag + shaders/bloom_1.frag + shaders/bloom_pass_0.frag + shaders/bloom_pass_0.vert + shaders/bloom_pass_1.frag + shaders/bloom_pass_1.vert + shaders/downscale.frag + shaders/downscale.vert + shaders/dsl_pass_0.frag + shaders/dsl_pass_0.vert + shaders/dsl_pass_1.frag + shaders/dsl_pass_1.vert + shaders/dsl_pass_2.frag + shaders/dsl_pass_2.vert + shaders/fbo_add.frag + shaders/fbo_add.vert + shaders/FXAA.frag + shaders/FXAA.vert + shaders/hdr.frag + shaders/hdr.vert + shaders/hdr_scale_0.frag + shaders/hdr_scale_1.frag + shaders/light_models.frag + shaders/motion_blur.frag + shaders/motion_blur.vert + shaders/post.frag + shaders/ppl.frag + shaders/ppl.vert + shaders/selection.frag + shaders/selection.vert + shaders/selection_halo.frag + shaders/selection_halo.vert + shaders/shadow.frag + shaders/shadow.vert + shaders/ssao_blur.frag + shaders/ssao_blur.vert + shaders/ssao_merge.frag + shaders/ssao_merge.vert + shaders/ssr.frag + shaders/ssr.vert + shaders/ssr_blur.frag + shaders/ssr_blur.vert + shaders/ssr_merge.frag + shaders/ssr_merge.vert + shaders/dof.frag + shaders/dof.vert diff --git a/qglview/renderer_deferred_shading.cpp b/qglview/renderer_deferred_shading.cpp index 02d7fb5..9d6d2bd 100644 --- a/qglview/renderer_deferred_shading.cpp +++ b/qglview/renderer_deferred_shading.cpp @@ -539,7 +539,7 @@ void RendererDeferredShading::reloadShaders() { for (int i = 0; i < shaders.size(); ++i) { QOpenGLShaderProgram * p(*(shaders[i].second)); if (!p) p = new QOpenGLShaderProgram(view.context()); - loadShaders(p, shaders[i].first, "shaders"); + loadShaders(p, shaders[i].first, "://shaders"); *(shaders[i].second) = p; } } diff --git a/qglview/renderer_simple.cpp b/qglview/renderer_simple.cpp index 7c77248..164af78 100644 --- a/qglview/renderer_simple.cpp +++ b/qglview/renderer_simple.cpp @@ -30,7 +30,7 @@ RendererSimple::RendererSimple(QGLView * view_): GLRendererBase(view_), fbo(2) void RendererSimple::reloadShaders() { if (shader_fxaa == 0) { shader_fxaa = new QOpenGLShaderProgram(view.context()); - loadShaders(shader_fxaa, "FXAA", "shaders"); + loadShaders(shader_fxaa, "FXAA", "://shaders"); } /*if (shader == 0) { shader = new QOpenGLShaderProgram(view.context()); /// WARNING diff --git a/qglview/shaders/dof.frag b/qglview/shaders/dof.frag new file mode 100644 index 0000000..4d1d81e --- /dev/null +++ b/qglview/shaders/dof.frag @@ -0,0 +1,47 @@ +#version 150 + +uniform float z_near, z_far; +uniform sampler2D t0, td; +uniform vec2 dt; +uniform float radius, focus, diaphragm; + +float w, sum; +const float _pe = 2.4e-7; + +vec4 getTexel(vec2 c, float coeff) { + vec4 ret = texture(t0, c); + float cw = texture(td, c).r; + cw = clamp(1. - abs(cw - w) * 1000, 0., 1.) * coeff; + sum += cw; + return ret * cw; +} + +void main(void) { + vec2 tc = qgl_FragTexture.xy; + vec4 scol = texture(t0, tc); + w = texture(td, tc).r; + float z = w + w - 1; + z = ((_pe - 2.) * z_near) / (z + _pe - 1.); // infinite depth + z = 1./(z + 1); + float cf = 1./(focus + 1); + float factor = clamp(abs(z - cf) * diaphragm, 0, 100); + factor = 1. - 1. / (factor + 1.); + factor *= factor; + factor *= factor; + //factor *= factor; + factor *= radius; + vec2 cdt = factor * dt; + sum = 1.; + scol += getTexel(tc + (cdt * 1), 2.5); + scol += getTexel(tc + (cdt * 2), 2.0); + scol += getTexel(tc + (cdt * 3), 1.5); + scol += getTexel(tc + (cdt * 4), 1.0); + scol += getTexel(tc + (cdt * 5), 0.5); + scol += getTexel(tc + (cdt * -1), 2.5); + scol += getTexel(tc + (cdt * -2), 2.0); + scol += getTexel(tc + (cdt * -3), 1.5); + scol += getTexel(tc + (cdt * -4), 1.0); + scol += getTexel(tc + (cdt * -5), 0.5); + scol /= sum; + qgl_FragData[0].rgba = scol; +} diff --git a/qglview/shaders/dof.vert b/qglview/shaders/dof.vert new file mode 100644 index 0000000..6bc001e --- /dev/null +++ b/qglview/shaders/dof.vert @@ -0,0 +1,6 @@ +#version 150 + +void main(void) { + qgl_FragTexture = qgl_Texture; + gl_Position = qgl_ftransform(); +} diff --git a/qglview/shaders/dsl_pass_0.frag b/qglview/shaders/dsl_pass_0.frag index db7264b..e1e6782 100644 --- a/qglview/shaders/dsl_pass_0.frag +++ b/qglview/shaders/dsl_pass_0.frag @@ -22,9 +22,11 @@ void main(void) { float hei = dot(texture(qgl_Material.map_relief.map, tc).rgb, luma) * qgl_Material.map_relief.amount + qgl_Material.map_relief.offset; vec3 n, dn, bn; - dn = (texture(qgl_Material.map_normal.map, tc).rgb - vec3(0.5, 0.5, 1.)) * qgl_Material.map_normal.amount + qgl_Material.map_normal.offset; + dn = texture(qgl_Material.map_normal.map, tc).rgb - vec3(0.5, 0.5, 1.); + dn = dn * qgl_Material.map_normal.amount + qgl_Material.map_normal.offset; dn.y = -dn.y; dn = TBN * dn; + //dn.z = 0; n = normalize(qgl_NormalMatrix * (normal + dn)); bn = normalize(qgl_NormalMatrix * binormal); //n = dn; diff --git a/qglview/shaders/dsl_pass_1.frag b/qglview/shaders/dsl_pass_1.frag index 7f50860..e2aaf74 100644 --- a/qglview/shaders/dsl_pass_1.frag +++ b/qglview/shaders/dsl_pass_1.frag @@ -34,57 +34,55 @@ void calcLight(in int index, in vec3 n, in vec3 v, in vec4 v2) { ldist = length(ldir); ldir = normalize(ldir); halfV = normalize(ldir + v); - NdotL = max(dot(n, ldir), 0.); - NdotH = max(dot(n, halfV), 0.); + NdotL = max(dot(n, ldir), 0.0001); + NdotH = max(dot(n, halfV), 0.0001); spot = step(0., NdotL) * qgl_Light[index].intensity; - if (NdotL > 0.) { - if (qgl_Light[index].endAngle <= 90.) { - float scos = max(dot(-ldir, qgl_Light[index].direction.xyz), 0.); - spot *= scos * step(qgl_Light[index].endAngleCos, scos); - spot *= smoothstep(qgl_Light[index].endAngleCos, qgl_Light[index].startAngleCos, scos); - lwdir = mat3(mat_viewi) * qgl_Light[index].direction.xyz; - //bn = normalize(cross(lwdir, vec3(1, 0, 0))); - //bn2 = normalize(cross(lwdir, bn)); - float ds = ldist/200.;//max(abs(sdist) / 5000, 0.02); - //spot *= clamp(1. - sdist, 0, 1); - vds = ds * bn.xyz; - vds2 = ds * bn2.xyz; - float shadow = getShadow(index, pos.xyz, vec3(0)) * 3. + - getShadow(index, pos.xyz, vds ) * 2. + - getShadow(index, pos.xyz, - vds ) * 2. + - getShadow(index, pos.xyz, - vds2 ) * 2. + - getShadow(index, pos.xyz, + vds2 ) * 2. + - getShadow(index, pos.xyz, vds - vds2 ) * 1.5 + - getShadow(index, pos.xyz, vds + vds2 ) * 1.5 + - getShadow(index, pos.xyz, - vds - vds2 ) * 1.5 + - getShadow(index, pos.xyz, - vds + vds2 ) * 1.5 + - getShadow(index, pos.xyz, vds + vds ) + - getShadow(index, pos.xyz, - vds - vds ) + - getShadow(index, pos.xyz, - vds2 - vds2) + - getShadow(index, pos.xyz, + vds2 + vds2) + - getShadow(index, pos.xyz, vds + vds - vds2 ) + - getShadow(index, pos.xyz, - vds - vds - vds2 ) + - getShadow(index, pos.xyz, vds + vds + vds2 ) + - getShadow(index, pos.xyz, - vds - vds + vds2 ) + - getShadow(index, pos.xyz, vds - vds2 - vds2) + - getShadow(index, pos.xyz, vds + vds2 + vds2) + - getShadow(index, pos.xyz, - vds - vds2 - vds2) + - getShadow(index, pos.xyz, - vds + vds2 + vds2); - spot *= mix(1., shadow / 29., shadow_on); - } - spot /= (qgl_Light[index].constantAttenuation + ldist * (qgl_Light[index].linearAttenuation + ldist * qgl_Light[index].quadraticAttenuation)); - ///li += spot * gl_LightSource[index].diffuse.rgb * light_diffuse(0, ldir, n); - //si += spot * qgl_Light[index].color.rgb * sh_mul * light_specular(0, ldir, n, halfV, v, sh_pow); - float NdotLs = NdotL*NdotL; - float NdotHs = NdotH*NdotH; - float ndlc = (1. - NdotLs) / NdotLs; - float der = NdotLs * (sh_mul + ndlc); - diff = 2. / (1. + sqrt(1. + (1. - sh_mul) * ndlc)); - li += spot * qgl_Light[index].color.rgb * diff;// * light_diffuse(0, ldir, n); - ndlc = (1. - NdotHs) / NdotHs; - der = NdotHs * (sh_mul + ndlc); - si += spot * qgl_Light[index].color.rgb * (sh_mul / (der*der) / 3.1416); + if (qgl_Light[index].endAngle <= 90.) { + float scos = max(dot(-ldir, qgl_Light[index].direction.xyz), 0.); + spot *= scos * step(qgl_Light[index].endAngleCos, scos); + spot *= smoothstep(qgl_Light[index].endAngleCos, qgl_Light[index].startAngleCos, scos); + lwdir = mat3(mat_viewi) * qgl_Light[index].direction.xyz; + //bn = normalize(cross(lwdir, vec3(1, 0, 0))); + //bn2 = normalize(cross(lwdir, bn)); + float ds = ldist/200.;//max(abs(sdist) / 5000, 0.02); + //spot *= clamp(1. - sdist, 0, 1); + vds = ds * bn.xyz; + vds2 = ds * bn2.xyz; + float shadow = getShadow(index, pos.xyz, vec3(0)) * 3. + + getShadow(index, pos.xyz, vds ) * 2. + + getShadow(index, pos.xyz, - vds ) * 2. + + getShadow(index, pos.xyz, - vds2 ) * 2. + + getShadow(index, pos.xyz, + vds2 ) * 2. + + getShadow(index, pos.xyz, vds - vds2 ) * 1.5 + + getShadow(index, pos.xyz, vds + vds2 ) * 1.5 + + getShadow(index, pos.xyz, - vds - vds2 ) * 1.5 + + getShadow(index, pos.xyz, - vds + vds2 ) * 1.5 + + getShadow(index, pos.xyz, vds + vds ) + + getShadow(index, pos.xyz, - vds - vds ) + + getShadow(index, pos.xyz, - vds2 - vds2) + + getShadow(index, pos.xyz, + vds2 + vds2) + + getShadow(index, pos.xyz, vds + vds - vds2 ) + + getShadow(index, pos.xyz, - vds - vds - vds2 ) + + getShadow(index, pos.xyz, vds + vds + vds2 ) + + getShadow(index, pos.xyz, - vds - vds + vds2 ) + + getShadow(index, pos.xyz, vds - vds2 - vds2) + + getShadow(index, pos.xyz, vds + vds2 + vds2) + + getShadow(index, pos.xyz, - vds - vds2 - vds2) + + getShadow(index, pos.xyz, - vds + vds2 + vds2); + spot *= mix(1., shadow / 29., shadow_on); } + spot /= (qgl_Light[index].constantAttenuation + ldist * (qgl_Light[index].linearAttenuation + ldist * qgl_Light[index].quadraticAttenuation)); + ///li += spot * gl_LightSource[index].diffuse.rgb * light_diffuse(0, ldir, n); + //si += spot * qgl_Light[index].color.rgb * sh_mul * light_specular(0, ldir, n, halfV, v, sh_pow); + float NdotLs = NdotL*NdotL; + float NdotHs = NdotH*NdotH; + float ndlc = (1. - NdotLs) / NdotLs; + float der = NdotLs * (sh_mul + ndlc); + diff = 2. / (1. + sqrt(1. + (1. - sh_mul) * ndlc)); + li += spot * qgl_Light[index].color.rgb * diff;// * light_diffuse(0, ldir, n); + ndlc = (1. - NdotHs) / NdotHs; + der = NdotHs * (sh_mul + ndlc); + si += spot * qgl_Light[index].color.rgb * (sh_mul / (der*der) / 3.1416); } diff --git a/qglview/shaders/ppl.frag b/qglview/shaders/ppl.frag index 518a231..c5aee6c 100644 --- a/qglview/shaders/ppl.frag +++ b/qglview/shaders/ppl.frag @@ -173,6 +173,7 @@ void main(void) { } if (acc_fog) color.rgb = mix(color.rgb, gl_Fog.color.rgb, fogCoord); + color.r = 250; gl_FragColor = color; //gl_FragColor.rgb = mix(ldir, texture2D(t2, sp).rgb, 1. - alpha); } diff --git a/qglview/shaders/selection_halo.frag b/qglview/shaders/selection_halo.frag index fde3b0c..d95f2e3 100644 --- a/qglview/shaders/selection_halo.frag +++ b/qglview/shaders/selection_halo.frag @@ -13,8 +13,8 @@ void main(void) { vec4 ds3 = abs(texelFetchOffset(t0, tc, 0, ivec2(0, 1)) - selected); float d0 = dot(ds0, vec4(1., 1., 1., 1.)), d1 = dot(ds1, vec4(1., 1., 1., 1.)), d2 = dot(ds2, vec4(1., 1., 1., 1.)), d3 = dot(ds3, vec4(1., 1., 1., 1.)); float vs = step(1e-6, d0 + d1 + d2 + d3); - float vm = step(1e-3, (d0 * 255.) * (d1 * 255.) * (d2 * 255.) * (d3 * 255.)); + float vm = step(1e-3, (d0 * 25.) * (d1 * 25.) * (d2 * 255.) * (d3 * 255.)); float v = mix(vs - vm, vs - vm - vm + 1, fill); //qgl_FragData[0] = vec4(1,0,0,0.5);//vec4(color.rgb, v * color.a); - qgl_FragData[0] = vec4(color.rgb, v * color.a); + qgl_FragData[0] = vec4(color.bgr, v * color.a); } diff --git a/qglview/shaders/test.frag b/qglview/shaders/test.frag deleted file mode 100644 index b90c5b0..0000000 --- a/qglview/shaders/test.frag +++ /dev/null @@ -1,9 +0,0 @@ -#version 200 - -//in vec3 src_normal, normal, et; -in vec3 wpos; - -void main(void) { - //vec2 tc = gl_TexCoord[0].xy; - gl_FragColor.xyz = wpos * 1E+6; -} diff --git a/qglview/shaders/test.geom b/qglview/shaders/test.geom deleted file mode 100644 index cdf3600..0000000 --- a/qglview/shaders/test.geom +++ /dev/null @@ -1,13 +0,0 @@ -#version 300 core - -layout(triangles, invocations = 1) in; - -//in vec3 normal[]; - -void main() { - for (int i = 0; i < gl_in.length(); i++ ) { - gl_Position = gl_in[i].gl_Position; - EmitVertex(); - } - EndPrimitive(); -} diff --git a/qglview/shaders/test.vert b/qglview/shaders/test.vert deleted file mode 100644 index 6b646d4..0000000 --- a/qglview/shaders/test.vert +++ /dev/null @@ -1,11 +0,0 @@ -#version 300 core - -//in vec3 src_normal, normal, et; -out vec3 wpos; - -void main(void) { - //vec2 tc = gl_TexCoord[0].xy; - wpos = gl_Vertex.xyz; - //gl_TexCoord[0] = gl_MultiTexCoord0; - gl_Position = ftransform(); -}