Kaydet (Commit) 0cb5939f authored tarafından weigao's avatar weigao Kaydeden (comit) Markus Mohrhard

modify screen text color to blue

Change-Id: I80435a980550a2b74657442ef1b44ca8e3825a97
üst b80cd0c5
......@@ -9,10 +9,11 @@
varying vec2 vTexCoord;
uniform sampler2D TextTex;
uniform vec4 textColor;
void main()
{
vec3 color = texture2D(TextTex, vTexCoord).rgb;
gl_FragColor = vec4(color, 1.0 - color.r);
gl_FragColor = vec4(textColor.rgb, 1.0 - color.r);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -323,6 +323,7 @@ private:
GLint m_ScreenTextVertexID;
GLint m_ScreenTextTexCoordID;
GLint m_ScreenTextTexID;
GLint m_ScreenTextColorID;
// CommonProID
GLint m_CommonProID;
......
......@@ -190,6 +190,7 @@ OpenGL3DRenderer::ShaderResources::ShaderResources()
, m_ScreenTextVertexID(0)
, m_ScreenTextTexCoordID(0)
, m_ScreenTextTexID(0)
, m_ScreenTextColorID(0)
, m_CommonProID(0)
, m_2DVertexID(0)
, m_2DColorID(0)
......@@ -305,6 +306,7 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders()
m_ScreenTextVertexID = glGetAttribLocation(m_ScreenTextProID, "vPosition");
m_ScreenTextTexCoordID = glGetAttribLocation(m_ScreenTextProID, "texCoord");
m_ScreenTextTexID = glGetUniformLocation(m_ScreenTextProID, "TextTex");
m_ScreenTextColorID = glGetUniformLocation(m_ScreenTextProID, "textColor");
m_CommonProID = OpenGLHelper::LoadShaders("commonVertexShader", "commonFragmentShader");
m_MatrixID = glGetUniformLocation(m_CommonProID, "MVP");
......@@ -1877,6 +1879,8 @@ void OpenGL3DRenderer::ReleaseScreenTextTexture()
void OpenGL3DRenderer::RenderScreenTextShape()
{
glUseProgram(maResources.m_ScreenTextProID);
glm::vec4 textColor = glm::vec4(0.0, 0.0, 1.0, 1.0);
glUniform4fv(maResources.m_ScreenTextColorID, 1, &textColor[0]);
CHECK_GL_ERROR();
for (size_t i = 0; i < m_ScreenTextInfoList.size(); i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment