Merge remote-tracking branch 'upstream/master'

This commit is contained in:
KroArtem 2014-02-21 20:59:41 +04:00
commit 08fcb42e7b
211 changed files with 2608 additions and 1963 deletions

3
.gitignore vendored
View File

@ -1,4 +1,4 @@
bld/
bld*/
build/
build-32/
build-64/
@ -35,6 +35,7 @@ data/.svn
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
*~
packets_log.txt
history.dat

View File

@ -26,13 +26,16 @@ Hope you enjoy the game.
##Compiling SuperTuxKart
###Windows
A project file for Visual Studio 9 (e.g. the free 2008 express
edition) is included in the sources in `src/ide/vc9`. A separate
dependency package is available on SuperTuxKart's sourceforge
page, which includes all necessary libraries, header files,
and dlls to compile and run the source code.
1. Install VS 2012 or later. The free express versions work fine.
2. Download and install a source package - either a released package or from our [git/svn repositories](http://supertuxkart.sourceforge.net/Source_control)
3. Download the latest dependency package depdendencies_for_0.8.2.zip from [here](https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart%20Dependencies/Windows/). Unzip it in the root directory, so that the dependencies directory is next to the src and data directory (if you are updating from a previous dependency package, you can delete the .dll files in the root directory, they are not needed anymore).
4. Download cmake and install it. Then start cmake-gui and select the STK root directory as 'Where is the source code', and a new directory in the root directory (next to src, data etc) as build directory (for now I assume that this directory is called bld).
5. Click on configure. You will be asked to create the directory (yes), then for your VS version. Make sure to select the right version (be aware of the easy to confuse version numbers: VS 2012 = version 11; VS 2013 = version 12). Click on configure, then generate. This will create the directory 'bld', and a VS solution in that directory.
6. In Visual Studio open the project file generated in the 'bld' folder
7. Right click on the supertuxkart project in the solution explorer, and select "Set as StartUp Project".
8. Select Build->Build Solution (or press F7) to compile.
While compilation with cygwin is not officially supported,
Compilation with cygwin is not officially supported, but
this has been done (check with the forum for details).
###Mac OS X

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
in vec2 uv;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ModelViewMatrix;
uniform mat4 ProjectionMatrix;
uniform vec3 Position;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform float low;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
in vec2 uv;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform float power;
uniform sampler2D tex;

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#version 130
#version 330
uniform sampler2D tex;
uniform float transparency;
in vec2 uv;

View File

@ -17,7 +17,7 @@
// Creates a bubble (wave) effect by distorting the texture depending on time
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform float time;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform sampler2D caustictex;
uniform vec2 dir;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform sampler2D oldtex;
uniform vec2 pixel;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform vec3 inlevel;
uniform vec2 outlevel;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform ivec4 color;
out vec4 FragColor;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform vec2 center;
uniform vec2 size;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform vec3 col;
out vec4 FragColor;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
in vec2 uv;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform vec2 center;
uniform vec2 size;
uniform vec2 texcenter;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D Albedo;
uniform sampler2D Detail;
uniform sampler2D DiffuseMap;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform vec2 dir;
uniform vec2 dir2;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelViewMatrix;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform mat4 ModelViewProjectionMatrix;
void main() {

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ProjectionMatrix;
uniform mat4 ViewMatrix;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform float fogmax;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform vec2 pixel;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform vec2 pixel;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform vec2 pixel;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform vec2 pixel;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
in vec2 uv;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform vec3 col;
out vec4 FragColor;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform vec2 sunpos;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform vec3 windDir;
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TransposeInverseModelView;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform vec3 windDir;
uniform mat4 ModelViewProjectionMatrix;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform vec2 texsize;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
#define MAX_SEARCH_STEPS 8.0
#define MAX_DISTANCE 33.0

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
in vec4 offset[2];
in vec2 uv;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
in vec4 offset[2];
in vec2 uv;
out vec4 FragColor;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform vec2 PIXEL_SIZE;
uniform mat4 ModelViewProjectionMatrix;

View File

@ -21,7 +21,7 @@
// The actual boost amount (which linearly scales the blur to be shown).
// should be in the range [0.0, 1.0], though a larger value might make
// the blurring too string. Atm we are using [0, 0.5].
#version 130
#version 330 compatibility
uniform float boost_amount;
// The color buffer to use.

View File

@ -17,7 +17,7 @@
// motion_blur.vert
#version 130
#version 330 compatibility
void main()
{

View File

@ -0,0 +1,22 @@
#version 330
uniform sampler2D Albedo;
uniform sampler2D DiffuseMap;
uniform sampler2D SpecularMap;
uniform sampler2D SSAO;
uniform vec2 screen;
uniform vec3 ambient;
in vec2 uv;
out vec4 FragColor;
void main(void)
{
vec2 tc = gl_FragCoord.xy / screen;
vec4 color = texture(Albedo, uv);
vec3 DiffuseComponent = texture(DiffuseMap, tc).xyz;
vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
float ao = texture(SSAO, tc).x;
vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent * (1. - color.a);
FragColor = vec4(color.xyz * LightFactor * (0.4 + ao*0.6), 1.);
//FragColor = vec4(color.xyz * LightFactor, 1.);
}

View File

@ -0,0 +1,16 @@
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TextureMatrix;
in vec3 Position;
in vec2 Texcoord;
in vec2 SecondTexcoord;
out vec2 uv;
out vec2 uv_bis;
void main(void)
{
uv = (TextureMatrix * vec4(Texcoord, 1., 1.)).xy;
uv_bis = SecondTexcoord;
gl_Position = ModelViewProjectionMatrix * vec4(Position, 1.);
}

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex1;
uniform sampler2D tex2;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D normalMap;
noperspective in vec3 tangent;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TransposeInverseModelView;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
noperspective in vec3 nor;
out vec2 EncodedNormal;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TransposeInverseModelView;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D Albedo;
uniform sampler2D DiffuseMap;
uniform sampler2D SpecularMap;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
in vec3 Position;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
in vec2 uv;
out vec4 FragColor;

View File

@ -1,32 +0,0 @@
#version 130
uniform sampler2D tex;
uniform sampler2D lighttex;
uniform int hastex;
uniform int haslightmap;
noperspective in vec3 nor;
in vec4 color;
in vec2 uv0;
in vec2 uv1;
out vec4 Albedo;
out vec4 NormalDepth;
out vec4 Specular;
void main() {
vec4 light = vec4(1.0);
vec4 col;
if (haslightmap != 0) {
light = texture(lighttex, uv1);
}
if (hastex != 0)
col = texture(tex, uv0) * light;
else
col = color;
Albedo = vec4(col.xyz, 1.);
NormalDepth = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
Specular = vec4(1. - col.a);
}

View File

@ -1,19 +0,0 @@
#version 130
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TransposeInverseModelView;
uniform mat4 TextureMatrix0;
uniform mat4 TextureMatrix1;
noperspective out vec3 nor;
out vec4 color;
out vec2 uv0;
out vec2 uv1;
void main() {
nor = (TransposeInverseModelView * vec4(gl_Normal, 1.)).xyz;
uv0 = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st;
uv1 = (gl_TextureMatrix[1] * gl_MultiTexCoord1).st;
gl_Position = ModelViewProjectionMatrix * gl_Vertex;
color = gl_Color;
}

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform int hastex;
uniform float objectid;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D Albedo;
uniform sampler2D DiffuseMap;
uniform sampler2D SpecularMap;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TransposeInverseModelView;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
noperspective in vec3 nor;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
noperspective in vec3 nor;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TransposeInverseModelView;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D Albedo;
uniform sampler2D DiffuseMap;
uniform sampler2D SpecularMap;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform sampler2D dtex;
uniform mat4 invproj;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ProjectionMatrix;
uniform mat4 ViewMatrix;

View File

@ -1,4 +1,4 @@
#version 140
#version 330
uniform int dt;
uniform mat4 sourcematrix;
uniform int level;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
out vec4 FragColor;

View File

@ -1,5 +1,5 @@
// Passthrough shader for drawQuad()
#version 130
#version 330 compatibility
out vec2 uv;

View File

@ -1,7 +1,8 @@
#version 130
#version 330
uniform sampler2D tex;
uniform vec2 pixel;
in vec2 uv;
out vec4 FragColor;
// Separated penumbra, horizontal
@ -9,8 +10,8 @@ void main()
{
float sum = 0.0;
vec4 tmp;
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
float X = uv.x;
float Y = uv.y;
float width = 0.0;
float zsum = 0.00001;

View File

@ -1,7 +1,8 @@
#version 130
#version 330
uniform sampler2D tex;
uniform vec2 pixel;
in vec2 uv;
out vec4 FragColor;
// Separated penumbra, vertical
@ -10,8 +11,8 @@ void main()
{
float sum = 0.0;
vec4 tmp;
float X = gl_TexCoord[0].x;
float Y = gl_TexCoord[0].y;
float X = uv.x;
float Y = uv.y;
float width = 0.0;
float zsum = 0.00001;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform int dt;
uniform mat4 sourcematrix;
uniform int level;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D ntex;
uniform sampler2D dtex;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform sampler2D dtex;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform sampler2D normals_and_depth;
uniform mat4 invproj;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform float screenw;
void main()

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform float time;
uniform vec3 campos;
uniform mat4 viewm;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
in vec2 Position;
in vec2 Texcoord;

24
data/shaders/shadow.geom Normal file
View File

@ -0,0 +1,24 @@
#version 330
uniform mat4 ModelViewProjectionMatrix[4];
layout(triangles) in;
layout(triangle_strip, max_vertices=12) out;
in vec2 tc[3];
out vec2 uv;
void main(void)
{
for (int j = 0; j<4; j++)
{
gl_Layer = j;
for(int i=0; i<3; i++)
{
uv = tc[i];
gl_Position = ModelViewProjectionMatrix[j] * gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}
}

14
data/shaders/shadow.vert Normal file
View File

@ -0,0 +1,14 @@
#version 330
in vec3 Position;
in vec2 Texcoord;
out vec2 tc;
void main(void)
{
tc = Texcoord;
gl_Position = vec4(Position, 1.);
}

View File

@ -1,15 +1,17 @@
#version 130
#version 330
uniform sampler2D halft; // half is a reserved word
uniform sampler2D quarter;
uniform sampler2D eighth;
in vec2 uv;
out vec4 FragColor;
void main()
{
vec3 val[3];
val[0] = texture(halft, gl_TexCoord[0].xy).xyz;
val[1] = texture(quarter, gl_TexCoord[0].xy).xyz;
val[2] = texture(eighth, gl_TexCoord[0].xy).xyz;
val[0] = texture(halft, uv).xyz;
val[1] = texture(quarter, uv).xyz;
val[2] = texture(eighth, uv).xyz;
// Find the first level with a penumbra value
int i;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D ntex;
uniform sampler2D ctex;
uniform vec3 campos;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D dtex;
uniform mat4 ipvmat;
uniform mat4 shadowmat;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform int hastex;
uniform int viz;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D warpx;
uniform sampler2D warpy;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform int size;
uniform vec2 pixel;

View File

@ -1,4 +1,4 @@
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform int size;
uniform vec2 pixel;

View File

@ -16,7 +16,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// skinning.vert
#version 130
#version 330 compatibility
#define MAX_JOINT_NUM 36
#define MAX_LIGHT_NUM 8

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#version 130
#version 330 compatibility
uniform sampler2D tex;
uniform sampler2D glow_tex;
uniform float transparency;

View File

@ -17,7 +17,7 @@
// Creates a bubble (wave) effect by distorting the texture depending on time
#version 130
#version 330 compatibility
uniform mat4 ModelViewProjectionMatrix;
uniform float time;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex_layout;
uniform sampler2D tex_detail0;
uniform sampler2D tex_detail1;

View File

@ -15,7 +15,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TransposeInverseModelView;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D ntex;
uniform sampler2D dtex;
uniform sampler2D noise_texture;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D ntex;
uniform sampler2D dtex;
//uniform sampler2D cloudtex;
@ -12,7 +12,6 @@ uniform mat4 invproj;
in vec2 uv;
out vec4 Diff;
out vec4 Spec;
out vec4 SpecularMap;
vec3 DecodeNormal(vec2 n)
{
@ -58,5 +57,4 @@ void main() {
Diff = vec4(NdotL * col, 1.);
Spec = vec4(Specular * col, 1.);
SpecularMap = vec4(1.0);
}

View File

@ -1,95 +1,125 @@
#version 130
#version 330
uniform sampler2D ntex;
uniform sampler2D dtex;
uniform sampler2D cloudtex;
uniform sampler2D shadowtex;
uniform sampler2D warpx;
uniform sampler2D warpy;
uniform sampler2DArrayShadow shadowtex;
//uniform sampler2D warpx;
///uniform sampler2D warpy;
uniform vec3 center;
uniform vec3 direction;
uniform vec3 col;
uniform vec2 screen;
uniform mat4 invprojview;
uniform mat4 shadowmat;
uniform int hasclouds;
uniform vec2 wind;
uniform float shadowoffset;
uniform mat4 invproj;
uniform mat4 shadowmat[4];
//uniform int hasclouds;
//uniform vec2 wind;
//uniform float shadowoffset;
out vec4 FragColor;
out vec4 OtherOutput;
in vec2 uv;
out vec4 Diff;
out vec4 Spec;
float decdepth(vec4 rgba) {
return dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0));
vec3 DecodeNormal(vec2 n)
{
float z = dot(n, n) * 2. - 1.;
vec2 xy = normalize(n) * sqrt(1. - z * z);
return vec3(xy,z);
}
float getShadowFactor(vec3 pos, float bias, int index)
{
//float a[5] = float[](3.4, 4.2, 5.0, 5.2, 1.1);
const vec2 shadowoffset[4] = vec2[](
vec2(-1., -1.),
vec2(-1., 1.),
vec2(1., -1.),
vec2(1., 1.)
);
vec4 shadowcoord = (shadowmat[index] * vec4(pos, 1.0));
shadowcoord /= shadowcoord.w;
vec2 shadowtexcoord = shadowcoord.xy * 0.5 + 0.5;
// shadowcoord = (shadowcoord * 0.5) + vec3(0.5);
// float movex = decdepth(texture(warpx, shadowcoord.xy));
// float movey = decdepth(texture(warpy, shadowcoord.xy));
// float dx = movex * 2.0 - 1.0;
// float dy = movey * 2.0 - 1.0;
// shadowcoord.xy += vec2(dx, dy);*/
//float shadowmapz = 2. * texture(shadowtex, vec3(shadowtexcoord, shadowcoord.z).x - 1.;
// bias += smoothstep(0.001, 0.1, moved) * 0.014; // According to the warping
float sum = 0.;
for (int i = 0; i < 4; i++)
{
sum += texture(shadowtex, vec4(shadowtexcoord + 0.0005 * shadowoffset[i], float(index), 0.5 * (shadowcoord.z + bias * 0.001) + 0.5));
}
return sum / 4.;
}
void main() {
float z = texture(dtex, uv).x;
vec4 xpos = 2.0 * vec4(uv, z, 1.0) - 1.0;
xpos = invproj * xpos;
xpos.xyz /= xpos.w;
vec2 texc = gl_FragCoord.xy / screen;
vec4 depthread = texture(dtex, texc);
float z = decdepth(vec4(depthread.xyz, 0.0));
if (z < 0.03)
{
// Skyboxes are fully lit
FragColor = vec4(1.0);
OtherOutput = vec4(0.0);
return;
}
vec3 norm = texture(ntex, texc).xyz;
norm = (norm - 0.5) * 2.0;
vec3 norm = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.));
// Normalized on the cpu
vec3 L = center;
vec3 L = direction;
float NdotL = max(0.0, dot(norm, L));
if (NdotL < 0.01) discard;
vec3 R = reflect(L, norm);
float RdotE = max(0.0, dot(R, normalize(xpos.xyz)));
float Specular = pow(RdotE, 200);
vec3 outcol = NdotL * col;
// World-space position
vec3 tmp = vec3(texc, z);
tmp = tmp * 2.0 - 1.0;
// if (hasclouds == 1)
// {
// vec2 cloudcoord = (xpos.xz * 0.00833333) + wind;
// float cloud = texture(cloudtex, cloudcoord).x;
// //float cloud = step(0.5, cloudcoord.x) * step(0.5, cloudcoord.y);
vec4 xpos = vec4(tmp, 1.0);
xpos = invprojview * xpos;
xpos.xyz /= xpos.w;
if (hasclouds == 1)
{
vec2 cloudcoord = (xpos.xz * 0.00833333) + wind;
float cloud = texture(cloudtex, cloudcoord).x;
//float cloud = step(0.5, cloudcoord.x) * step(0.5, cloudcoord.y);
outcol *= cloud;
}
// outcol *= cloud;
// }
// Shadows
vec3 shadowcoord = (shadowmat * vec4(xpos.xyz, 1.0)).xyz;
shadowcoord = (shadowcoord * 0.5) + vec3(0.5);
float movex = decdepth(texture(warpx, shadowcoord.xy));
float movey = decdepth(texture(warpy, shadowcoord.xy));
float dx = movex * 2.0 - 1.0;
float dy = movey * 2.0 - 1.0;
shadowcoord.xy += vec2(dx, dy);
vec4 shadowread = texture(shadowtex, shadowcoord.xy);
float shadowmapz = decdepth(vec4(shadowread.xyz, 0.0));
float moved = (abs(dx) + abs(dy)) * 0.5;
/*
float bias = 0.002 * tan(acos(NdotL)); // According to the slope
bias += smoothstep(0.001, 0.1, moved) * 0.014; // According to the warping
bias = clamp(bias, 0.001, 0.014);
*/
/*
float avi = 0.002;
float abi = 0.0025; */
float factor;
if (xpos.z < 20.)
factor = getShadowFactor(xpos.xyz, bias, 0);
else if (xpos.z < 25.)
{
float a = getShadowFactor(xpos.xyz, bias, 0), b = getShadowFactor(xpos.xyz, bias, 1);
factor = mix(a, b, (xpos.z - 20.) / 5.);
}
else if (xpos.z < 50.)
factor = getShadowFactor(xpos.xyz, bias, 1);
else if (xpos.z < 60.)
{
float a = getShadowFactor(xpos.xyz, bias, 1), b = getShadowFactor(xpos.xyz, bias, 2);
factor = mix(a, b, (xpos.z - 50.) / 10.);
}
else if (xpos.z < 100.)
factor = getShadowFactor(xpos.xyz, bias, 2);
else if (xpos.z < 120.)
{
float a = getShadowFactor(xpos.xyz, bias, 2), b = getShadowFactor(xpos.xyz, bias, 3);
factor = mix(a, b, (xpos.z - 100.) / 20.);
}
else
factor = getShadowFactor(xpos.xyz, bias, 3);
Diff = vec4(factor * NdotL * col, 1.);
Spec = vec4(factor * Specular * col, 1.);
return;
float avi = 0.0018;
// float moved = (abs(dx) + abs(dy)) * 0.5;
// float avi = 0.002;
// float abi = 0.0025;
/* float avi = 0.0018;
float abi = 0.002;
float bias = avi * tan(acos(NdotL)); // According to the slope
@ -113,11 +143,11 @@ void main() {
float shadowed = step(shadowmapz + bias, shadowcoord.z);
float dist = (shadowcoord.z / shadowmapz) - 1.0;
float penumbra = dist * softness / gl_FragCoord.z;
penumbra *= shadowed;
penumbra *= shadowed;*/
/* outcol.r = (shadowcoord.z - shadowmapz) * 50.0;
outcol.g = moved;*/
FragColor = vec4(outcol, 0.05);
OtherOutput = vec4(shadowed, penumbra, shadowed, shadowed);
// FragColor = vec4(outcol, 0.05);
// OtherOutput = vec4(shadowed, penumbra, shadowed, shadowed);
}

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
in vec2 uv;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform vec2 center;
uniform vec2 size;
uniform vec2 texcenter;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
in vec2 uv;

View File

@ -1,5 +1,6 @@
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TextureMatrix;
in vec3 Position;
in vec2 Texcoord;
@ -7,6 +8,6 @@ out vec2 uv;
void main()
{
uv = Texcoord;
uv = (TextureMatrix * vec4(Texcoord, 1., 1.)).xy;
gl_Position = ModelViewProjectionMatrix * vec4(Position, 1.);
}

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D tex;
uniform float fogmax;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform sampler2D DiffuseMap;
uniform sampler2D SpecularMap;
uniform sampler2D SSAO;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
uniform mat4 ModelViewProjectionMatrix;
in vec3 Position;

View File

@ -1,6 +1,6 @@
// Shader based on work by Fabien Sanglard
// Released under the terms of CC-BY 3.0
#version 130
#version 330 compatibility
uniform sampler2D BumpTex1; // Normal map 1
uniform sampler2D BumpTex2; // Normal map 2
uniform sampler2D DecalTex; //The texture

View File

@ -1,6 +1,6 @@
// Shader based on work by Fabien Sanglard
// Released under the terms of CC-BY 3.0
#version 130
#version 330 compatibility
uniform float speed;
uniform float height;
uniform float waveLength;

View File

@ -1,4 +1,4 @@
#version 130
#version 330
out vec4 FragColor;
void main()
{

View File

@ -744,9 +744,8 @@ bool CIrrDeviceLinux::createWindow()
int context_attribs[] =
{
GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
GLX_CONTEXT_MINOR_VERSION_ARB, 0,
// Uncomment to discard deprecated features
//GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
GLX_CONTEXT_MINOR_VERSION_ARB, 3,
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, //GLX_CONTEXT_CORE_PROFILE_BIT_ARB
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
None
};

Some files were not shown because too many files have changed in this diff Show More