Replaced some opengl fixed functions with shaders. Temporary ShyotlUseLegacyRenderPath setting to debug if this change actually improves framerate at all (setting not tied to callbacks. Have to toggle shaders to have stuff pick up the setting change)

This commit is contained in:
Shyotl
2011-08-10 03:53:49 -05:00
parent 896b7146e7
commit ca328aec72
41 changed files with 1037 additions and 273 deletions

View File

@@ -0,0 +1,17 @@
/**
* @file customalphaF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
uniform sampler2D diffuseMap;
uniform float custom_alpha;
void main()
{
vec4 color = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
color.a *= custom_alpha;
gl_FragColor = color;
}

View File

@@ -0,0 +1,16 @@
/**
* @file customalphaV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_FrontColor = gl_Color;
}

View File

@@ -0,0 +1,17 @@
/**
* @file glowcombineF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
#extension GL_ARB_texture_rectangle : enable
uniform sampler2D glowMap;
uniform sampler2DRect screenMap;
void main()
{
gl_FragColor = texture2D(glowMap, gl_TexCoord[0].xy) +
texture2DRect(screenMap, gl_TexCoord[1].xy);
}

View File

@@ -0,0 +1,15 @@
/**
* @file glowcombineV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord1;
}

View File

@@ -0,0 +1,11 @@
/**
* @file occlusionF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
void main()
{
gl_FragColor = vec4(1,1,1,1);
}

View File

@@ -0,0 +1,12 @@
/**
* @file uiV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

View File

@@ -0,0 +1,15 @@
/**
* @file twotextureaddF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
uniform sampler2D tex0;
void main()
{
float alpha = texture2D(tex0, gl_TexCoord[0].xy).a * gl_Color.a;
gl_FragColor = vec4(gl_Color.rgb, alpha);
}

View File

@@ -0,0 +1,16 @@
/**
* @file solidcolorV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
}

View File

@@ -0,0 +1,14 @@
/**
* @file twotextureaddF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
uniform sampler2D tex0;
uniform sampler2D tex1;
void main()
{
gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy)+texture2D(tex1, gl_TexCoord[1].xy);
}

View File

@@ -0,0 +1,16 @@
/**
* @file twotextureaddV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[1] = gl_MultiTexCoord1;
}

View File

@@ -0,0 +1,13 @@
/**
* @file uiF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
uniform sampler2D diffuseMap;
void main()
{
gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
}

View File

@@ -0,0 +1,16 @@
/**
* @file uiV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_FrontColor = gl_Color;
}

View File

@@ -0,0 +1,17 @@
/**
* @file bumpF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
uniform sampler2D texture0;
uniform sampler2D texture1;
void main()
{
float tex0 = texture2D(texture0, gl_TexCoord[0].xy).a;
float tex1 = texture2D(texture1, gl_TexCoord[1].xy).a;
gl_FragColor = vec4(tex0+(1.0-tex1)-0.5);
}

View File

@@ -0,0 +1,16 @@
/**
* @file bumpV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* $/LicenseInfo$
*/
void main()
{
//transform vertex
gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex;
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
gl_FrontColor = gl_Color;
}