OGL32CTX: Add vertex shader where default one was assumed.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14973 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
vincentlj 2014-01-08 23:11:10 +00:00
parent 632f75c130
commit 2ba340b6cb
10 changed files with 38 additions and 24 deletions

View File

@ -10,9 +10,11 @@ uniform vec3 col;
uniform vec3 campos;
uniform mat4 ipvmat;
in vec2 uv;
void main()
{
float z = texture2D(tex, gl_TexCoord[0].xy).a;
float z = texture2D(tex, uv).a;
vec3 tmp = vec3(gl_TexCoord[0].xy, z);
tmp = tmp * 2.0 - 1.0;

View File

@ -4,11 +4,13 @@ uniform vec2 pixel;
// Gaussian separated blur with radius 3.
in vec2 uv;
void main()
{
vec4 sum = vec4(0.0);
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
float X = uv.x;
float Y = uv.y;
sum += texture2D(tex, vec2(X - 3.0 * pixel.x, Y)) * 0.03125;
sum += texture2D(tex, vec2(X - 1.3333 * pixel.x, Y)) * 0.328125;

View File

@ -4,11 +4,13 @@ uniform vec2 pixel;
// Gaussian separated blur with radius 3.
in vec2 uv;
void main()
{
vec4 sum = vec4(0.0);
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
float X = uv.x;
float Y = uv.y;
sum += texture2D(tex, vec2(X, Y - 3.0 * pixel.y)) * 0.03125;
sum += texture2D(tex, vec2(X, Y - 1.3333 * pixel.y)) * 0.328125;

View File

@ -4,11 +4,13 @@ uniform vec2 pixel;
// Gaussian separated blur with radius 6.
in vec2 uv;
void main()
{
vec4 sum = vec4(0.0);
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
float X = uv.x;
float Y = uv.y;
sum += texture2D(tex, vec2(X - 5.13333 * pixel.x, Y)) * 0.00640869;
sum += texture2D(tex, vec2(X - 3.26667 * pixel.x, Y)) * 0.083313;

View File

@ -4,11 +4,13 @@ uniform vec2 pixel;
// Gaussian separated blur with radius 6.
in vec2 uv;
void main()
{
vec4 sum = vec4(0.0);
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
float X = uv.x;
float Y = uv.y;
sum += texture2D(tex, vec2(X, Y - 5.13333 * pixel.y)) * 0.00640869;
sum += texture2D(tex, vec2(X, Y - 3.26667 * pixel.y)) * 0.083313;

View File

@ -5,9 +5,11 @@ uniform sampler2D ambient_occlusion;
uniform sampler2D specular_map;
uniform vec3 ambient;
in vec2 uv;
void main()
{
vec2 texc = gl_TexCoord[0].xy;
vec2 texc = uv;
vec3 diffuse = texture2D(diffuse, texc).xyz;
vec3 spec = texture2D(specular, texc).xyz;

View File

@ -1,8 +1,9 @@
// Passthrough shader for drawQuad()
#version 130
out vec2 uv;
void main() {
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
gl_Position = ftransform();
gl_FrontColor = gl_Color;
uv = gl_MultiTexCoord0.xy;
gl_Position = gl_Vertex;
}

View File

@ -4,6 +4,8 @@ uniform mat4 invprojm;
uniform mat4 projm;
uniform vec4 samplePoints[16];
in vec2 uv;
const float strengh = 4.;
const float radius = .4f;
@ -17,8 +19,6 @@ void main(void)
// Again not using const because of broken Intel Windows drivers
vec2 uv = gl_TexCoord[0].xy;
vec4 cur = texture2D(normals_and_depth, uv);
float curdepth = texture2D(normals_and_depth, uv).a;
vec4 FragPos = invprojm * (2.0f * vec4(uv, curdepth, 1.0f) - 1.0f);

View File

@ -413,6 +413,7 @@ bool COpenGLDriver::initDriver(CIrrDeviceWin32* device)
{
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
// WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
0
};
hrc=wglCreateContextAttribs_ARB(HDc, 0, iAttribs);

View File

@ -126,14 +126,14 @@ void Shaders::loadShaders()
m_shaders[ES_MOTIONBLUR] = glsl(std::string(""), dir + "motion_blur.frag",
m_callbacks[ES_MOTIONBLUR]);
m_shaders[ES_GAUSSIAN3H] = glslmat(std::string(""), dir + "gaussian3h.frag",
m_shaders[ES_GAUSSIAN3H] = glslmat(dir + "pass.vert", dir + "gaussian3h.frag",
m_callbacks[ES_GAUSSIAN3H], EMT_SOLID);
m_shaders[ES_GAUSSIAN3V] = glslmat(std::string(""), dir + "gaussian3v.frag",
m_shaders[ES_GAUSSIAN3V] = glslmat(dir + "pass.vert", dir + "gaussian3v.frag",
m_callbacks[ES_GAUSSIAN3V], EMT_SOLID);
m_shaders[ES_GAUSSIAN6H] = glslmat(std::string(""), dir + "gaussian6h.frag",
m_shaders[ES_GAUSSIAN6H] = glslmat(dir + "pass.vert", dir + "gaussian6h.frag",
m_callbacks[ES_GAUSSIAN3H], EMT_SOLID);
m_shaders[ES_GAUSSIAN6V] = glslmat(std::string(""), dir + "gaussian6v.frag",
m_shaders[ES_GAUSSIAN6V] = glslmat(dir + "pass.vert", dir + "gaussian6v.frag",
m_callbacks[ES_GAUSSIAN3V], EMT_SOLID);
m_shaders[ES_MIPVIZ] = glslmat(std::string(""), dir + "mipviz.frag",
@ -170,10 +170,10 @@ void Shaders::loadShaders()
m_shaders[ES_OBJECTPASS_RIMLIT] = glslmat(dir + "objectpass_rimlit.vert", dir + "objectpass_rimlit.frag",
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
m_shaders[ES_LIGHTBLEND] = glslmat(std::string(""), dir + "lightblend.frag",
m_shaders[ES_LIGHTBLEND] = glslmat(dir + "pass.vert", dir + "lightblend.frag",
m_callbacks[ES_LIGHTBLEND], EMT_ONETEXTURE_BLEND);
m_shaders[ES_POINTLIGHT] = glslmat(std::string(""), dir + "pointlight.frag",
m_shaders[ES_POINTLIGHT] = glslmat(dir + "pass.vert", dir + "pointlight.frag",
m_callbacks[ES_POINTLIGHT], EMT_ONETEXTURE_BLEND);
m_shaders[ES_SUNLIGHT] = glslmat(std::string(""), dir + "sunlight.frag",
@ -188,7 +188,7 @@ void Shaders::loadShaders()
m_shaders[ES_MLAA_NEIGH3] = glsl(dir + "mlaa_offset.vert", dir + "mlaa_neigh3.frag",
m_callbacks[ES_MLAA_NEIGH3]);
m_shaders[ES_SSAO] = glsl(std::string(""), dir + "ssao.frag", m_callbacks[ES_SSAO]);
m_shaders[ES_SSAO] = glsl(dir + "pass.vert", dir + "ssao.frag", m_callbacks[ES_SSAO]);
m_shaders[ES_GODFADE] = glsl(std::string(""), dir + "godfade.frag", m_callbacks[ES_COLORIZE]);
m_shaders[ES_GODRAY] = glsl(std::string(""), dir + "godray.frag", m_callbacks[ES_GODRAY]);
@ -233,7 +233,7 @@ void Shaders::loadShaders()
m_shaders[ES_PASSFAR] = glsl(dir + "farplane.vert", dir + "colorize.frag",
m_callbacks[ES_COLORIZE]);
m_shaders[ES_FOG] = glslmat(std::string(""), dir + "fog.frag",
m_shaders[ES_FOG] = glslmat(dir + "pass.vert", dir + "fog.frag",
m_callbacks[ES_FOG], EMT_ONETEXTURE_BLEND);
// Check that all successfully loaded