1
0
Fork 0

Add missing shader version tags for the other shaders too

This commit is contained in:
Erik Hofman 2016-08-03 09:59:29 +02:00
parent 727c3feb11
commit 3fa2ade35f
55 changed files with 172 additions and 93 deletions

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;
varying vec4 cloudColor; varying vec4 cloudColor;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, May 2014 // written by Thorsten Renk, May 2014
// based on ALS terrain shader // based on ALS terrain shader

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D color_tex; uniform sampler2D color_tex;
uniform sampler2D ao_tex; uniform sampler2D ao_tex;
uniform sampler2D normal_tex; uniform sampler2D normal_tex;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
uniform sampler2D texture; uniform sampler2D texture;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D color_tex; uniform sampler2D color_tex;
uniform sampler2D spec_emis_tex; uniform sampler2D spec_emis_tex;
void main() { void main() {

View file

@ -1,4 +1,5 @@
#version 120 #version 120
uniform sampler2D input_tex; uniform sampler2D input_tex;
uniform vec2 fg_BufferSize; uniform vec2 fg_BufferSize;
uniform float blurOffset_x; uniform float blurOffset_x;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D lighting_tex; uniform sampler2D lighting_tex;
uniform sampler2D bloom_tex; uniform sampler2D bloom_tex;
uniform sampler2D film_tex; uniform sampler2D film_tex;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,3 +1,4 @@
#version 120
#extension GL_EXT_gpu_shader4 : enable #extension GL_EXT_gpu_shader4 : enable
// -*- mode: C; -*- // -*- mode: C; -*-
// Licence: GPL v2 // Licence: GPL v2

View file

@ -1,3 +1,4 @@
#version 120
#extension GL_EXT_gpu_shader4 : enable #extension GL_EXT_gpu_shader4 : enable
// //
// attachment 0: normal.x | normal.x | normal.y | normal.y // attachment 0: normal.x | normal.x | normal.y | normal.y

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D lighting_tex; uniform sampler2D lighting_tex;
uniform sampler2D bloom_tex; uniform sampler2D bloom_tex;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D depth_tex; uniform sampler2D depth_tex;
uniform sampler2D normal_tex; uniform sampler2D normal_tex;
uniform sampler2D color_tex; uniform sampler2D color_tex;

View file

@ -1,4 +1,5 @@
// -*- mode: C; -*- // -*- mode: C; -*-
#version 120
// Licence: GPL v2 // Licence: GPL v2
// Author: Frederic Bouvier. // Author: Frederic Bouvier.

View file

@ -1,4 +1,5 @@
// -*- mode: C; -*- // -*- mode: C; -*-
#version 120
// Licence: GPL v2 // Licence: GPL v2
// Author: Frederic Bouvier. // Author: Frederic Bouvier.

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
varying vec2 rawPos; varying vec2 rawPos;
varying vec2 nPos; varying vec2 nPos;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
uniform float air_pollution; uniform float air_pollution;

View file

@ -1,3 +1,5 @@
#version 120
//#define fog_FuncTION //#define fog_FuncTION
//varying vec3 PointPos; //varying vec3 PointPos;
@ -13,4 +15,4 @@ vec3 fog_Func(vec3 color, int type)
fogFactor=1.0; fogFactor=1.0;
return mix(gl_Fog.color.rgb, color, fogFactor); return mix(gl_Fog.color.rgb, color, fogFactor);
} }

View file

@ -1,3 +1,5 @@
#version 120
uniform vec2 fg_BufferSize; uniform vec2 fg_BufferSize;
uniform vec3 fg_Planes; uniform vec3 fg_Planes;

View file

@ -1,3 +1,5 @@
#version 120
uniform vec2 fg_BufferSize; uniform vec2 fg_BufferSize;
uniform vec3 fg_Planes; uniform vec3 fg_Planes;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.
// //
@ -71,4 +72,4 @@ void main()
// gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor); // gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
fragColor.rgb = fog_Func(fragColor.rgb, fogType); fragColor.rgb = fog_Func(fragColor.rgb, fogType);
gl_FragColor = fragColor; gl_FragColor = fragColor;
} }

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
uniform float eyerel_x1; uniform float eyerel_x1;
uniform float eyerel_y1; uniform float eyerel_y1;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// Shader for use with material animations // Shader for use with material animations
varying vec4 diffuse, constantColor, matSpecular; varying vec4 diffuse, constantColor, matSpecular;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.
varying vec4 diffuse_term; varying vec4 diffuse_term;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2015 // written by Thorsten Renk, Oct 2015

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2015 // written by Thorsten Renk, Oct 2015

View file

@ -1,3 +1,5 @@
#version 120
// Night vision effect inspired by http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/ // Night vision effect inspired by http://www.geeks3d.com/20091009/shader-library-night-vision-post-processing-filter-glsl/
uniform sampler2D color_tex; uniform sampler2D color_tex;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;
varying vec3 hazeColor; varying vec3 hazeColor;

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,89 +1,90 @@
// -*-C++-*- // -*-C++-*-
#version 120
uniform int display_xsize;
uniform int display_ysize; uniform int display_xsize;
uniform float field_of_view; uniform int display_ysize;
uniform float view_pitch_offset; uniform float field_of_view;
uniform float view_heading_offset; uniform float view_pitch_offset;
uniform float view_heading_offset;
float light_distance_fading(in float dist)
{ float light_distance_fading(in float dist)
return min(1.0, 10000.0/(dist*dist)); {
} return min(1.0, 10000.0/(dist*dist));
}
float fog_backscatter(in float avisibility)
{ float fog_backscatter(in float avisibility)
return 0.5* min(1.0,10000.0/(avisibility*avisibility)); {
} return 0.5* min(1.0,10000.0/(avisibility*avisibility));
}
vec3 searchlight()
{ vec3 searchlight()
{
vec2 center = vec2 (float(display_xsize) * 0.5, float(display_ysize) * 0.4);
vec2 center = vec2 (float(display_xsize) * 0.5, float(display_ysize) * 0.4);
float headlightIntensity;
float lightRadius = (float(display_xsize) *9.16 /field_of_view); float headlightIntensity;
float angularDist = length(gl_FragCoord.xy -center); float lightRadius = (float(display_xsize) *9.16 /field_of_view);
float angularDist = length(gl_FragCoord.xy -center);
if (angularDist < lightRadius)
{ if (angularDist < lightRadius)
headlightIntensity = pow(cos(angularDist/lightRadius * 1.57075),2.0); {
//headlightIntensity = headlightIntensity * headlightIntensity = pow(cos(angularDist/lightRadius * 1.57075),2.0);
//headlightIntensity*= clamp(1.0 + 0.15 * log(1000.0/(dist*dist)),0.0,1.0); //headlightIntensity = headlightIntensity *
return headlightIntensity * vec3 (0.5,0.5, 0.5); //headlightIntensity*= clamp(1.0 + 0.15 * log(1000.0/(dist*dist)),0.0,1.0);
} return headlightIntensity * vec3 (0.5,0.5, 0.5);
else return vec3 (0.0,0.0,0.0); }
} else return vec3 (0.0,0.0,0.0);
}
vec3 flashlight(in vec3 color, in float radius)
{ vec3 flashlight(in vec3 color, in float radius)
{
vec2 center = vec2 (float(display_xsize) * 0.5, float(display_ysize) * 0.4);
vec2 center = vec2 (float(display_xsize) * 0.5, float(display_ysize) * 0.4);
float headlightIntensity;
float lightRadius = (float(display_xsize) *radius /field_of_view); float headlightIntensity;
float angularDist = length(gl_FragCoord.xy -center); float lightRadius = (float(display_xsize) *radius /field_of_view);
float angularDist = length(gl_FragCoord.xy -center);
if (angularDist < lightRadius)
{ if (angularDist < lightRadius)
headlightIntensity = pow(cos(angularDist/lightRadius * 1.57075),2.0); {
return headlightIntensity * color; headlightIntensity = pow(cos(angularDist/lightRadius * 1.57075),2.0);
} return headlightIntensity * color;
else return vec3 (0.0,0.0,0.0); }
} else return vec3 (0.0,0.0,0.0);
}
vec3 landing_light(in float offset, in float offsetv)
{ vec3 landing_light(in float offset, in float offsetv)
{
float fov_h = field_of_view;
float fov_v = float(display_ysize)/float(display_xsize) * field_of_view; float fov_h = field_of_view;
float fov_v = float(display_ysize)/float(display_xsize) * field_of_view;
float yaw_offset;
float yaw_offset;
if (view_heading_offset > 180.0)
{yaw_offset = -360.0+view_heading_offset;} if (view_heading_offset > 180.0)
else {yaw_offset = -360.0+view_heading_offset;}
{yaw_offset = view_heading_offset;} else
{yaw_offset = view_heading_offset;}
float x_offset = (float(display_xsize) / fov_h * (yaw_offset + offset));
float y_offset = -(float(display_ysize) / fov_v * (view_pitch_offset + offsetv)); float x_offset = (float(display_xsize) / fov_h * (yaw_offset + offset));
float y_offset = -(float(display_ysize) / fov_v * (view_pitch_offset + offsetv));
vec2 center = vec2 (float(display_xsize) * 0.5 + x_offset, float(display_ysize) * 0.4 + y_offset);
vec2 center = vec2 (float(display_xsize) * 0.5 + x_offset, float(display_ysize) * 0.4 + y_offset);
float landingLightIntensity;
float lightRadius = (float(display_xsize) *9.16 /field_of_view); float landingLightIntensity;
float angularDist = length(gl_FragCoord.xy -center); float lightRadius = (float(display_xsize) *9.16 /field_of_view);
float angularDist = length(gl_FragCoord.xy -center);
if (angularDist < lightRadius)
{ if (angularDist < lightRadius)
landingLightIntensity = pow(cos(angularDist/lightRadius * 1.57075),2.0); {
//landingLightIntensity *= min(1.0, 10000.0/(dist*dist)); landingLightIntensity = pow(cos(angularDist/lightRadius * 1.57075),2.0);
return landingLightIntensity * vec3 (0.5,0.5, 0.5); //landingLightIntensity *= min(1.0, 10000.0/(dist*dist));
} return landingLightIntensity * vec3 (0.5,0.5, 0.5);
else return vec3 (0.0,0.0,0.0); }
else return vec3 (0.0,0.0,0.0);
}
}

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,3 +1,5 @@
#version 120
uniform mat4 fg_ViewMatrix; uniform mat4 fg_ViewMatrix;
uniform sampler2D depth_tex; uniform sampler2D depth_tex;
uniform sampler2D normal_tex; uniform sampler2D normal_tex;

View file

@ -1,3 +1,5 @@
#version 120
uniform mat4 fg_ViewMatrix; uniform mat4 fg_ViewMatrix;
uniform sampler2D depth_tex; uniform sampler2D depth_tex;
uniform sampler2D normal_tex; uniform sampler2D normal_tex;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag
// Ambient term comes in gl_Color.rgb. // Ambient term comes in gl_Color.rgb.

View file

@ -1,4 +1,6 @@
// -*-C++-*- // -*-C++-*-
#version 120
uniform sampler2D texture; uniform sampler2D texture;
////fog "include" ///// ////fog "include" /////

View file

@ -1,3 +1,5 @@
#version 120
uniform sampler2D baseTexture; uniform sampler2D baseTexture;
varying float fogFactor; varying float fogFactor;

View file

@ -2,7 +2,7 @@
// Texture switching based on face slope and snow level // Texture switching based on face slope and snow level
// based on earlier work by Frederic Bouvier, Tim Moore, and Yves Sablonier. // based on earlier work by Frederic Bouvier, Tim Moore, and Yves Sablonier.
// <20> Emilian Huminiuc 2011 // <20> Emilian Huminiuc 2011
#version 120
varying float RawPosZ; varying float RawPosZ;
varying vec3 WorldPos; varying vec3 WorldPos;

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag

View file

@ -1,4 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120
// written by Thorsten Renk, Oct 2011, based on default.frag // written by Thorsten Renk, Oct 2011, based on default.frag

View file

@ -1,5 +1,5 @@
// -*-C++-*- // -*-C++-*-
#version 120