Attempt to fix skidding mark's color
This commit is contained in:
parent
d9c5d415cd
commit
9a6d15a865
@ -2,6 +2,7 @@ uniform sampler2D tex;
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
in vec2 uv;
|
||||
in vec4 color;
|
||||
out vec4 FragColor;
|
||||
#else
|
||||
varying vec2 uv;
|
||||
@ -11,5 +12,5 @@ varying vec2 uv;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = texture(tex, uv);
|
||||
FragColor = texture(tex, uv) * color;
|
||||
}
|
||||
|
@ -4,7 +4,9 @@ uniform mat4 TextureMatrix;
|
||||
#if __VERSION__ >= 130
|
||||
in vec3 Position;
|
||||
in vec2 Texcoord;
|
||||
in vec4 Color;
|
||||
out vec2 uv;
|
||||
out vec4 color;
|
||||
#else
|
||||
attribute vec3 Position;
|
||||
attribute vec2 Texcoord;
|
||||
@ -16,4 +18,5 @@ void main()
|
||||
{
|
||||
uv = (TextureMatrix * vec4(Texcoord, 1., 1.)).xy;
|
||||
gl_Position = ModelViewProjectionMatrix * vec4(Position, 1.);
|
||||
color = Color;
|
||||
}
|
||||
|
@ -873,6 +873,7 @@ namespace MeshShader
|
||||
GLuint TransparentShader::Program;
|
||||
GLuint TransparentShader::attrib_position;
|
||||
GLuint TransparentShader::attrib_texcoord;
|
||||
GLuint TransparentShader::attrib_color;
|
||||
GLuint TransparentShader::uniform_MVP;
|
||||
GLuint TransparentShader::uniform_TM;
|
||||
GLuint TransparentShader::uniform_tex;
|
||||
@ -882,6 +883,7 @@ namespace MeshShader
|
||||
Program = LoadProgram(file_manager->getAsset("shaders/transparent.vert").c_str(), file_manager->getAsset("shaders/transparent.frag").c_str());
|
||||
attrib_position = glGetAttribLocation(Program, "Position");
|
||||
attrib_texcoord = glGetAttribLocation(Program, "Texcoord");
|
||||
attrib_color = glGetAttribLocation(Program, "Color");
|
||||
uniform_MVP = glGetUniformLocation(Program, "ModelViewProjectionMatrix");
|
||||
uniform_TM = glGetUniformLocation(Program, "TextureMatrix");
|
||||
uniform_tex = glGetUniformLocation(Program, "tex");
|
||||
|
@ -210,7 +210,7 @@ class TransparentShader
|
||||
{
|
||||
public:
|
||||
static GLuint Program;
|
||||
static GLuint attrib_position, attrib_texcoord;
|
||||
static GLuint attrib_position, attrib_texcoord, attrib_color;
|
||||
static GLuint uniform_MVP, uniform_TM, uniform_tex;
|
||||
|
||||
static void init();
|
||||
|
@ -815,7 +815,7 @@ void initvaostate(GLMesh &mesh, TransparentMaterial TranspMat)
|
||||
break;
|
||||
case TM_DEFAULT:
|
||||
mesh.vao_first_pass = createVAO(mesh.vertex_buffer, mesh.index_buffer,
|
||||
MeshShader::TransparentShader::attrib_position, MeshShader::TransparentShader::attrib_texcoord, -1, -1, -1, -1, -1, mesh.Stride);
|
||||
MeshShader::TransparentShader::attrib_position, MeshShader::TransparentShader::attrib_texcoord, -1, -1, -1, -1, MeshShader::TransparentShader::attrib_color, mesh.Stride);
|
||||
break;
|
||||
}
|
||||
mesh.vao_glow_pass = createVAO(mesh.vertex_buffer, mesh.index_buffer, MeshShader::ColorizeShader::attrib_position, -1, -1, -1, -1, -1, -1, mesh.Stride);
|
||||
|
Loading…
Reference in New Issue
Block a user