Skip to content

Commit

Permalink
use vec4 for color (and use alpha component instead of hardcoded valu…
Browse files Browse the repository at this point in the history
…e), added missing precision
  • Loading branch information
m0dB committed Oct 20, 2023
1 parent 599c8cc commit 9664d41
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/shaders/rgbashader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using namespace mixxx;

void RGBAShader::init() {
QString vertexShaderCode = QStringLiteral(R"--(
uniform mat4 matrix;
uniform highp mat4 matrix;
attribute highp vec4 position; // use vec4 here (will be padded) for matrix multiplication
attribute highp vec4 color;
varying highp vec4 vColor;
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/rgbshader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using namespace mixxx;

void RGBShader::init() {
QString vertexShaderCode = QStringLiteral(R"--(
uniform mat4 matrix;
uniform highp mat4 matrix;
attribute highp vec4 position; // use vec4 here (will be padded) for matrix multiplication
attribute highp vec3 color;
varying highp vec3 vColor;
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/unicolorshader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using namespace mixxx;

void UnicolorShader::init() {
QString vertexShaderCode = QStringLiteral(R"--(
uniform mat4 matrix;
uniform highp mat4 matrix;
attribute highp vec4 position; // use vec4 here (will be padded) for matrix multiplication
void main()
{
Expand Down
6 changes: 3 additions & 3 deletions src/shaders/vinylqualityshader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using namespace mixxx;

void VinylQualityShader::init() {
QString vertexShaderCode = QStringLiteral(R"--(
uniform mat4 matrix;
uniform highp mat4 matrix;
attribute highp vec4 position; // use vec4 here (will be padded) for matrix multiplication
attribute highp vec2 texcoord;
varying highp vec2 vTexcoord;
Expand All @@ -17,11 +17,11 @@ void main()

QString fragmentShaderCode = QStringLiteral(R"--(
uniform sampler2D texture;
uniform highp vec3 color;
uniform highp vec4 color;
varying highp vec2 vTexcoord;
void main()
{
gl_FragColor = vec4(color, texture2D(texture, vTexcoord) * 0.75);
gl_FragColor = vec4(color.xyz, texture2D(texture, vTexcoord) * color.w);
}
)--");

Expand Down
1 change: 1 addition & 0 deletions src/widget/wspinnyglsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void WSpinnyGLSL::setupVinylSignalQuality() {
void WSpinnyGLSL::updateVinylSignalQualityImage(
const QColor& qual_color, const unsigned char* data) {
m_vinylQualityColor = qual_color;
m_vinylQualityColor.setAlphaF(0.75f);
if (m_pQTexture) {
makeCurrentIfNeeded();
m_pQTexture->bind();
Expand Down

0 comments on commit 9664d41

Please sign in to comment.