Use an header included in every shaders.
This commit is contained in:
parent
67948dfe28
commit
58c094917e
@ -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;
|
||||
|
16
data/shaders/header.txt
Normal file
16
data/shaders/header.txt
Normal file
@ -0,0 +1,16 @@
|
||||
#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
|
@ -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;
|
||||
|
@ -245,6 +245,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 +274,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 = "";
|
||||
@ -284,6 +301,7 @@ GLuint LoadShader(const char * file, unsigned type)
|
||||
ErrorMessage[0]=0;
|
||||
glGetShaderInfoLog(Id, InfoLogLength, NULL, ErrorMessage);
|
||||
Log::error("GLWrap", ErrorMessage);
|
||||
Log::error("GLWrap", Code.c_str());
|
||||
delete[] ErrorMessage;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user