125
125
std::string vertexString =
126
126
NUX_VERTEX_SHADER_HEADER
127
"attribute vec4 vertex; \n\
128
attribute vec4 textureCoord0; \n\
129
uniform mat4 viewProjectionMatrix; \n\
130
varying vec4 varyTexCoord0; \n\
133
gl_Position = viewProjectionMatrix * vertex; \n\
134
varyTexCoord0 = textureCoord0; \n\
127
"attribute vec4 vertex; \n\
128
attribute vec4 textureCoord0; \n\
129
uniform mat4 viewProjectionMatrix; \n\
130
uniform float gamma; \n\
131
varying vec4 varyTexCoord0; \n\
134
gl_Position = viewProjectionMatrix * vertex; \n\
135
varyTexCoord0 = textureCoord0; \n\
137
138
std::string pixelString =
138
139
NUX_FRAGMENT_SHADER_HEADER
139
"uniform sampler2D textureObject; \n\
140
uniform float gamma; \n\
141
varying vec4 varyTexCoord0; \n\
144
vec2 uv = varyTexCoord0.xy; \n\
145
texture2D tempTex = texture2D(textureObject, uv); \n\
146
gl_FragColor.rgb = pow(tempTex.rgb, 1 / gamma); \n\
147
gl_FragColor.a = tempTex.a; \n\
140
"uniform sampler2D textureObject; \n\
141
uniform float gamma; \n\
142
varying vec4 varyTexCoord0; \n\
145
vec2 uv = varyTexCoord0.st; \n\
146
vec4 tempTex = texture2D(textureObject, uv); \n\
147
gl_FragColor.rgb = pow(tempTex.rgb, 1 / gamma); \n\
148
gl_FragColor.a = tempTex.a; \n\
150
151
m_sRGBTexture = _graphics_display.m_DeviceFactory->CreateShaderProgram();