Merge branch 'master' of https://github.com/supertuxkart/stk-code into ScriptEngine
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
uniform mat4 ModelViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform vec3 Position;
|
||||
uniform vec2 Size;
|
||||
|
||||
|
||||
@@ -2,16 +2,6 @@ uniform sampler2D tex_128;
|
||||
uniform sampler2D tex_256;
|
||||
uniform sampler2D tex_512;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
|
||||
@@ -3,15 +3,6 @@ uniform float greenLmn[9];
|
||||
uniform float redLmn[9];
|
||||
uniform sampler2D ntex;
|
||||
uniform mat4 TransposeViewMatrix;
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
out vec4 Diff;
|
||||
|
||||
|
||||
@@ -5,16 +5,6 @@ uniform sampler2D tex;
|
||||
uniform vec2 dir;
|
||||
uniform vec2 dir2;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
in vec2 uv;
|
||||
in vec2 uv_bis;
|
||||
|
||||
@@ -1,20 +1,3 @@
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
uniform mat4 ModelMatrix;
|
||||
|
||||
#if __VERSION__ >= 330
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D dtex;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
float focalDepth = 10.;
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
in vec2 quadcorner;
|
||||
in vec2 texcoord;
|
||||
in vec3 position;
|
||||
|
||||
@@ -7,24 +7,6 @@ uniform float start;
|
||||
uniform float end;
|
||||
uniform vec3 col;
|
||||
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
uniform int idx;
|
||||
|
||||
in vec3 Position;
|
||||
|
||||
@@ -14,16 +14,6 @@ uniform vec3 extents;
|
||||
uniform mat4 RHMatrix;
|
||||
uniform mat4 InvRHMatrix;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
vec4 SHBasis (const in vec3 dir)
|
||||
{
|
||||
float L00 = 0.282095;
|
||||
|
||||
@@ -1,20 +1,3 @@
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
uniform vec3 windDir;
|
||||
uniform mat4 ModelMatrix;
|
||||
uniform mat4 InverseModelMatrix;
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
uniform sampler2D Albedo;
|
||||
uniform vec3 SunDir;
|
||||
uniform sampler2D dtex;
|
||||
|
||||
17
data/shaders/header.txt
Normal file
17
data/shaders/header.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
@@ -1,13 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
uniform vec3 windDir;
|
||||
|
||||
#if __VERSION__ >= 330
|
||||
|
||||
@@ -1,20 +1,3 @@
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if __VERSION__ >= 330
|
||||
layout(location = 0) in vec3 Position;
|
||||
layout(location = 1) in vec3 Normal;
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
};
|
||||
uniform vec3 windDir;
|
||||
#if __VERSION__ >= 330
|
||||
layout(location = 0) in vec3 Position;
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
};
|
||||
|
||||
#if __VERSION__ >= 330
|
||||
layout(location = 0) in vec3 Position;
|
||||
layout(location = 3) in vec2 Texcoord;
|
||||
|
||||
@@ -2,16 +2,6 @@ uniform sampler2D tex;
|
||||
uniform float zn;
|
||||
uniform float zf;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
out float Depth;
|
||||
|
||||
void main()
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
uniform sampler2D edgesMap;
|
||||
uniform sampler2D areaMap;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
#define MAX_SEARCH_STEPS 8.0
|
||||
#define MAX_DISTANCE 33.0
|
||||
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
in vec2 Position;
|
||||
in vec2 Texcoord;
|
||||
|
||||
|
||||
@@ -37,16 +37,6 @@ uniform float mask_radius;
|
||||
|
||||
uniform mat4 previous_viewproj;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
// Number of samples used for blurring
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
};
|
||||
|
||||
uniform mat4 ModelMatrix;
|
||||
uniform mat4 InverseModelMatrix;
|
||||
|
||||
|
||||
@@ -1,20 +1,3 @@
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
uniform mat4 ModelMatrix;
|
||||
uniform mat4 InverseModelMatrix;
|
||||
|
||||
|
||||
@@ -1,23 +1,5 @@
|
||||
// See http://www.ozone3d.net/tutorials/glsl_texturing_p04.php for ref
|
||||
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
|
||||
@@ -2,16 +2,6 @@ uniform sampler2D tex;
|
||||
uniform sampler2D dtex;
|
||||
uniform mat4 invproj;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
in float lf;
|
||||
in vec2 tc;
|
||||
in vec3 pc;
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
uniform vec3 color_from;
|
||||
uniform vec3 color_to;
|
||||
|
||||
|
||||
@@ -2,24 +2,6 @@ uniform sampler2D ntex;
|
||||
uniform sampler2D dtex;
|
||||
uniform float spec;
|
||||
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
flat in vec3 center;
|
||||
flat in float energy;
|
||||
flat in vec3 col;
|
||||
|
||||
@@ -1,20 +1,3 @@
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
in vec3 Position;
|
||||
in float Energy;
|
||||
in vec3 Color;
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
uniform vec3 extents;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
uniform mat4 RHMatrix;
|
||||
|
||||
ivec3 resolution = ivec3(32, 16, 32);
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
};
|
||||
|
||||
uniform mat4 ModelMatrix;
|
||||
|
||||
#if __VERSION__ >= 330
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
};
|
||||
|
||||
uniform mat4 ModelMatrix;
|
||||
uniform vec3 windDir;
|
||||
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
uniform samplerCube tex;
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
|
||||
@@ -8,16 +8,6 @@ uniform sampler2D SpecularMap;
|
||||
uniform sampler2D SSAO;
|
||||
uniform vec3 ambient;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
in vec2 uv;
|
||||
in vec2 uv_bis;
|
||||
|
||||
@@ -3,25 +3,6 @@
|
||||
|
||||
uniform sampler2D dtex;
|
||||
uniform vec4 samplePoints[16];
|
||||
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
out float AO;
|
||||
|
||||
const float sigma = 1.;
|
||||
|
||||
@@ -8,24 +8,6 @@ uniform mat4 invproj;
|
||||
//uniform int hasclouds;
|
||||
//uniform vec2 wind;
|
||||
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
out vec4 Diff;
|
||||
out vec4 Spec;
|
||||
|
||||
|
||||
@@ -10,25 +10,6 @@ uniform vec3 col;
|
||||
//uniform vec2 wind;
|
||||
//uniform float shadowoffset;
|
||||
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform mat4 ShadowViewProjMatrixes[4];
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
in vec2 uv;
|
||||
out vec4 Diff;
|
||||
out vec4 Spec;
|
||||
|
||||
@@ -5,24 +5,6 @@ uniform sampler2DArrayShadow shadowtex;
|
||||
uniform vec3 direction;
|
||||
uniform vec3 col;
|
||||
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform mat4 ShadowViewProjMatrixes[4];
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
in vec2 uv;
|
||||
out vec4 Diff;
|
||||
out vec4 Spec;
|
||||
|
||||
@@ -6,16 +6,6 @@ uniform float exposure = .09;
|
||||
uniform float Lwhite = 1.;
|
||||
uniform float vignette_weight = 0.;
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
vec3 getCIEYxy(vec3 rgbColor);
|
||||
|
||||
@@ -7,17 +7,6 @@ uniform float start;
|
||||
uniform float end;
|
||||
uniform vec3 col;
|
||||
|
||||
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
|
||||
in vec2 uv;
|
||||
in vec4 color;
|
||||
out vec4 FragColor;
|
||||
|
||||
@@ -2,24 +2,6 @@ uniform sampler2D DiffuseMap;
|
||||
uniform sampler2D SpecularMap;
|
||||
uniform sampler2D SSAO;
|
||||
|
||||
#ifdef UBO_DISABLED
|
||||
uniform mat4 ViewMatrix;
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat4 InverseViewMatrix;
|
||||
uniform mat4 InverseProjectionMatrix;
|
||||
uniform vec2 screen;
|
||||
#else
|
||||
layout (std140) uniform MatrixesData
|
||||
{
|
||||
mat4 ViewMatrix;
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 InverseViewMatrix;
|
||||
mat4 InverseProjectionMatrix;
|
||||
mat4 ShadowViewProjMatrixes[4];
|
||||
vec2 screen;
|
||||
};
|
||||
#endif
|
||||
|
||||
vec3 getLightFactor(float specMapValue)
|
||||
{
|
||||
vec2 tc = gl_FragCoord.xy / screen;
|
||||
|
||||
@@ -220,7 +220,7 @@ void SunLightProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
m_wind[1] += winddir.Z;
|
||||
srv->setVertexShaderConstant("wind", m_wind, 2);
|
||||
|
||||
if (UserConfigParams::m_shadows)
|
||||
if (UserConfigParams::m_shadows && !UserConfigParams::m_ubo_disabled)
|
||||
{
|
||||
srv->setVertexShaderConstant("shadowmat", m_shadowmat.pointer(), 16);
|
||||
}
|
||||
|
||||
@@ -96,6 +96,10 @@ CALLBACK
|
||||
debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length,
|
||||
const GLchar* msg, const void *userparam)
|
||||
{
|
||||
// ignore minor notifications sent by some drivers (notably the nvidia one)
|
||||
if (severity == GL_DEBUG_SEVERITY_NOTIFICATION)
|
||||
return;
|
||||
|
||||
switch(source)
|
||||
{
|
||||
case GL_DEBUG_SOURCE_API_ARB:
|
||||
@@ -245,6 +249,22 @@ void initGL()
|
||||
#endif
|
||||
}
|
||||
|
||||
static std::string LoadHeader()
|
||||
{
|
||||
std::string result;
|
||||
std::ifstream Stream(file_manager->getAsset("shaders/header.txt").c_str(), std::ios::in);
|
||||
|
||||
if (Stream.is_open())
|
||||
{
|
||||
std::string Line = "";
|
||||
while (getline(Stream, Line))
|
||||
result += "\n" + Line;
|
||||
Stream.close();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Mostly from shader tutorial
|
||||
GLuint LoadShader(const char * file, unsigned type)
|
||||
{
|
||||
@@ -258,6 +278,7 @@ GLuint LoadShader(const char * file, unsigned type)
|
||||
Code += "#define UBO_DISABLED\n";
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
Code += "#define VSLayer\n";
|
||||
Code += LoadHeader();
|
||||
if (Stream.is_open())
|
||||
{
|
||||
std::string Line = "";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <ICameraSceneNode.h>
|
||||
#include <IParticleSystemSceneNode.h>
|
||||
#include "guiengine/engine.hpp"
|
||||
|
||||
#include "graphics/particle_emitter.hpp"
|
||||
#define COMPONENTCOUNT 8
|
||||
|
||||
scene::IParticleSystemSceneNode *ParticleSystemProxy::addParticleNode(
|
||||
@@ -185,7 +185,10 @@ void ParticleSystemProxy::generateParticlesFromBoxEmitter(scene::IParticleBoxEmi
|
||||
|
||||
const core::vector3df& extent = emitter->getBox().getExtent();
|
||||
|
||||
for (unsigned i = 0; i < count; i++) {
|
||||
bool randomize_initial_y = ((ParticleEmitter*)emitter)->randomizeInitialY();
|
||||
|
||||
for (unsigned i = 0; i < count; i++)
|
||||
{
|
||||
particles[i].PositionX = emitter->getBox().MinEdge.X + os::Randomizer::frand() * extent.X;
|
||||
particles[i].PositionY = emitter->getBox().MinEdge.Y + os::Randomizer::frand() * extent.Y;
|
||||
particles[i].PositionZ = emitter->getBox().MinEdge.Z + os::Randomizer::frand() * extent.Z;
|
||||
@@ -196,6 +199,9 @@ void ParticleSystemProxy::generateParticlesFromBoxEmitter(scene::IParticleBoxEmi
|
||||
generateLifetimeSizeDirection(emitter, initialvalue[i].Lifetime, initialvalue[i].Size,
|
||||
initialvalue[i].DirectionX, initialvalue[i].DirectionY, initialvalue[i].DirectionZ);
|
||||
memcpy(&(particles[i].DirectionX), &(initialvalue[i].DirectionX), 4 * sizeof(float));
|
||||
|
||||
if (randomize_initial_y)
|
||||
particles[i].PositionY = os::Randomizer::frand()*50.0f; // -100.0f;
|
||||
}
|
||||
glBindBuffer(GL_ARRAY_BUFFER, initial_values_buffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, count * sizeof(ParticleData), initialvalue, GL_STREAM_DRAW);
|
||||
|
||||
@@ -287,7 +287,8 @@ public:
|
||||
|
||||
ParticleEmitter::ParticleEmitter(const ParticleKind* type,
|
||||
const Vec3 &position,
|
||||
scene::ISceneNode* parent)
|
||||
scene::ISceneNode* parent,
|
||||
bool randomize_initial_y)
|
||||
: m_position(position)
|
||||
{
|
||||
assert(type != NULL);
|
||||
@@ -298,6 +299,7 @@ ParticleEmitter::ParticleEmitter(const ParticleKind* type,
|
||||
m_parent = parent;
|
||||
m_emission_decay_rate = 0;
|
||||
m_is_glsl = irr_driver->isGLSL();
|
||||
m_randomize_initial_y = randomize_initial_y;
|
||||
|
||||
|
||||
setParticleType(type);
|
||||
|
||||
@@ -74,6 +74,7 @@ private:
|
||||
/** The irrlicht emitter contains this info, but as an int. We want it as a float */
|
||||
float m_min_rate, m_max_rate;
|
||||
|
||||
bool m_randomize_initial_y;
|
||||
|
||||
public:
|
||||
|
||||
@@ -81,7 +82,8 @@ public:
|
||||
|
||||
ParticleEmitter (const ParticleKind* type,
|
||||
const Vec3 &position,
|
||||
scene::ISceneNode* parent = NULL);
|
||||
scene::ISceneNode* parent = NULL,
|
||||
bool randomize_initial_y = false);
|
||||
virtual ~ParticleEmitter();
|
||||
virtual void update (float dt);
|
||||
void setCreationRateAbsolute(float fraction);
|
||||
@@ -104,6 +106,8 @@ public:
|
||||
void unsetNode() { m_node = NULL; }
|
||||
|
||||
void addHeightMapAffector(Track* t);
|
||||
|
||||
bool randomizeInitialY() const { return m_randomize_initial_y; }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, unsigned po
|
||||
// To avoid wrong culling, use the largest view possible
|
||||
m_scene_manager->setActiveCamera(m_suncam);
|
||||
if (!m_mipviz && !m_wireframe && UserConfigParams::m_dynamic_lights &&
|
||||
UserConfigParams::m_shadows && hasShadow)
|
||||
UserConfigParams::m_shadows && !UserConfigParams::m_ubo_disabled && hasShadow)
|
||||
renderShadows();
|
||||
m_scene_manager->setActiveCamera(camnode);
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
|
||||
@@ -172,7 +172,7 @@ void IrrDriver::renderLights(unsigned pointlightcount)
|
||||
if (!World::getWorld() || World::getWorld()->getTrack()->hasShadows())
|
||||
{
|
||||
ScopedGPUTimer timer(irr_driver->getGPUTimer(Q_SUN));
|
||||
if (World::getWorld() && UserConfigParams::m_shadows)
|
||||
if (World::getWorld() && UserConfigParams::m_shadows && !UserConfigParams::m_ubo_disabled)
|
||||
m_post_processing->renderShadowedSunlight(sun_ortho_matrix, m_rtts->getShadowDepthTex());
|
||||
else
|
||||
m_post_processing->renderSunlight();
|
||||
|
||||
@@ -226,7 +226,7 @@ RTT::RTT(size_t width, size_t height)
|
||||
somevector.push_back(RenderTargetTextures[RTT_TMP_128]);
|
||||
FrameBuffers.push_back(new FrameBuffer(somevector, 128, 128));
|
||||
|
||||
if (UserConfigParams::m_shadows)
|
||||
if (UserConfigParams::m_shadows && !UserConfigParams::m_ubo_disabled)
|
||||
{
|
||||
shadowColorTex = generateRTT3D(GL_TEXTURE_2D_ARRAY, 1024, 1024, 4, GL_R8, GL_RED, GL_UNSIGNED_BYTE);
|
||||
shadowDepthTex = generateRTT3D(GL_TEXTURE_2D_ARRAY, 1024, 1024, 4, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8);
|
||||
@@ -265,7 +265,7 @@ RTT::~RTT()
|
||||
{
|
||||
glDeleteTextures(RTT_COUNT, RenderTargetTextures);
|
||||
glDeleteTextures(1, &DepthStencilTexture);
|
||||
if (UserConfigParams::m_shadows)
|
||||
if (UserConfigParams::m_shadows && !UserConfigParams::m_ubo_disabled)
|
||||
{
|
||||
delete m_shadow_FBO;
|
||||
glDeleteTextures(1, &shadowColorTex);
|
||||
|
||||
@@ -466,6 +466,8 @@ void bypassUBO(GLuint Program)
|
||||
glUniformMatrix4fv(IVM, 1, GL_FALSE, irr_driver->getInvViewMatrix().pointer());
|
||||
GLint IPM = glGetUniformLocation(Program, "InverseProjectionMatrix");
|
||||
glUniformMatrix4fv(IPM, 1, GL_FALSE, irr_driver->getInvProjMatrix().pointer());
|
||||
GLint Screen = glGetUniformLocation(Program, "screen");
|
||||
glUniform2f(Screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
}
|
||||
|
||||
namespace UtilShader
|
||||
|
||||
@@ -2348,7 +2348,8 @@ void Kart::loadData(RaceManager::KartType type, bool is_animated_model)
|
||||
m_sky_particles_emitter =
|
||||
new ParticleEmitter(track->getSkyParticles(),
|
||||
core::vector3df(0.0f, 30.0f, 100.0f),
|
||||
getNode());
|
||||
getNode(),
|
||||
true);
|
||||
|
||||
// FIXME: in multiplayer mode, this will result in several instances
|
||||
// of the heightmap being calculated and kept in memory
|
||||
|
||||
@@ -83,8 +83,10 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
|
||||
shadows->addLabel( _("Disabled") ); // 0
|
||||
shadows->addLabel( _("low") ); // 1
|
||||
shadows->addLabel( _("high") ); // 2
|
||||
shadows->setValue( UserConfigParams::m_shadows );
|
||||
|
||||
if (!UserConfigParams::m_ubo_disabled)
|
||||
shadows->setValue(UserConfigParams::m_shadows);
|
||||
else
|
||||
shadows->setValue(0);
|
||||
getWidget<CheckBoxWidget>("dynamiclight")->setState(UserConfigParams::m_dynamic_lights);
|
||||
getWidget<CheckBoxWidget>("lightshaft")->setState(UserConfigParams::m_light_shaft);
|
||||
getWidget<CheckBoxWidget>("global_illumination")->setState(UserConfigParams::m_gi);
|
||||
@@ -111,10 +113,10 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
|
||||
UserConfigParams::m_motionblur =
|
||||
advanced_pipeline && getWidget<CheckBoxWidget>("motionblur")->getState();
|
||||
|
||||
if (advanced_pipeline)
|
||||
if (advanced_pipeline && getWidget<CheckBoxWidget>("ubo")->getState())
|
||||
{
|
||||
UserConfigParams::m_shadows =
|
||||
advanced_pipeline && getWidget<SpinnerWidget>("shadows")->getValue();
|
||||
getWidget<SpinnerWidget>("shadows")->getValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user