Catching up with Lindies part 2

This commit is contained in:
Siana Gearz
2012-03-25 09:38:36 +02:00
parent 196e9d6c78
commit 3f0f955a76
113 changed files with 801 additions and 516 deletions

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -34,5 +36,5 @@ uniform sampler2D diffuseMap;
void main()
{
gl_FragColor = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a);
frag_color = vec4(vertex_color.rgb, texture2D(diffuseMap, vary_texcoord0.xy).a);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@@ -69,6 +71,6 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
frag_color = color;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@@ -81,9 +83,9 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
//gl_FragColor = vec4(1,0,1,1);
//gl_FragColor = vec4(1,0,1,1)*shadow;
frag_color = color;
//frag_color = vec4(1,0,1,1);
//frag_color = vec4(1,0,1,1)*shadow;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@@ -79,6 +81,6 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
frag_color = color;
}

View File

@@ -23,7 +23,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@@ -33,7 +35,7 @@ VARYING vec2 vary_texcoord0;
void main()
{
//gl_FragColor = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
gl_FragColor = vec4(1,1,1,1);
//frag_color = vec4(1,1,1,vertex_color.a * texture2D(diffuseMap, vary_texcoord0.xy).a);
frag_color = vec4(1,1,1,1);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D diffuseMap;
@@ -41,9 +43,9 @@ void main()
discard;
}
gl_FragData[0] = vec4(diff.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
frag_data[0] = vec4(diff.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@@ -33,7 +35,7 @@ VARYING vec4 post_pos;
void main()
{
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@@ -111,6 +113,6 @@ void main()
col /= defined_weight.xyxx;
col.y *= col.y;
gl_FragColor = col;
frag_color = col;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D diffuseMap;
@@ -46,9 +48,9 @@ void main()
dot(norm,vary_mat1),
dot(norm,vary_mat2));
gl_FragData[0] = vec4(col, 0.0);
gl_FragData[1] = vertex_color.aaaa; // spec
//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
frag_data[0] = vec4(col, 0.0);
frag_data[1] = vertex_color.aaaa; // spec
//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
vec3 nvn = normalize(tnorm);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -30,7 +30,7 @@ ATTRIBUTE vec3 position;
ATTRIBUTE vec4 diffuse_color;
ATTRIBUTE vec3 normal;
ATTRIBUTE vec2 texcoord0;
ATTRIBUTE vec2 texcoord2;
ATTRIBUTE vec3 binormal;
VARYING vec3 vary_mat0;
VARYING vec3 vary_mat1;
@@ -52,7 +52,7 @@ void main()
vec3 n = normalize((mat * vec4(normal.xyz+position.xyz, 1.0)).xyz-pos.xyz);
vec3 b = normalize((mat * vec4(vec4(texcoord2,0,1).xyz+position.xyz, 1.0)).xyz-pos.xyz);
vec3 b = normalize((mat * vec4(binormal.xyz+position.xyz, 1.0)).xyz-pos.xyz);
vec3 t = cross(b, n);
vary_mat0 = vec3(t.x, b.x, n.x);

View File

@@ -25,7 +25,9 @@
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
/////////////////////////////////////////////////////////////////////////
@@ -98,8 +100,8 @@ void main()
color *= 2.;
/// Gamma correct for WL (soft clip effect).
gl_FragData[0] = vec4(scaleSoftClip(color.rgb), alpha1);
gl_FragData[1] = vec4(0.0,0.0,0.0,0.0);
gl_FragData[2] = vec4(0,0,1,0);
frag_data[0] = vec4(scaleSoftClip(color.rgb), alpha1);
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
frag_data[2] = vec4(0,0,1,0);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -83,6 +85,6 @@ void main()
sc = max(sc, -max_cof);
vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
gl_FragColor.rgb = diff.rgb + bloom.rgb;
gl_FragColor.a = sc/max_cof*0.5+0.5;
frag_color.rgb = diff.rgb + bloom.rgb;
frag_color.a = sc/max_cof*0.5+0.5;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform float minimum_alpha;
@@ -44,9 +46,9 @@ void main()
discard;
}
gl_FragData[0] = vec4(col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0); // spec
frag_data[0] = vec4(col.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0); // spec
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
VARYING vec3 vary_normal;
@@ -43,8 +45,8 @@ void main()
discard;
}
gl_FragData[0] = vec4(col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
frag_data[0] = vec4(col.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -25,7 +25,9 @@
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform float minimum_alpha;
@@ -44,9 +46,9 @@ void main()
discard;
}
gl_FragData[0] = vec4(col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0); // spec
frag_data[0] = vec4(col.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0); // spec
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D diffuseMap;
@@ -36,10 +38,10 @@ VARYING vec2 vary_texcoord0;
void main()
{
vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
gl_FragData[0] = vec4(col, 0.0);
gl_FragData[1] = vertex_color.aaaa; // spec
//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
frag_data[0] = vec4(col, 0.0);
frag_data[1] = vertex_color.aaaa; // spec
//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
VARYING vec3 vary_normal;
@@ -35,9 +37,9 @@ void main()
{
vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb;
gl_FragData[0] = vec4(col, 0.0);
gl_FragData[1] = vertex_color.aaaa; // spec
//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
frag_data[0] = vec4(col, 0.0);
frag_data[1] = vertex_color.aaaa; // spec
//frag_data[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -73,5 +75,5 @@ void main()
diff = mix(diff, col*0.25, a);
}
gl_FragColor = mix(diff, dof, a);
frag_color = mix(diff, dof, a);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
vec3 fullbrightAtmosTransport(vec3 light);
@@ -45,6 +47,6 @@ void main()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -46,6 +48,6 @@ void main()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
#define FXAA_PC 1
@@ -341,18 +343,23 @@ A. Or use FXAA_GREEN_AS_LUMA.
// 1 = API supports gather4 on alpha channel.
// 0 = API does not support gather4 on alpha channel.
//
#if (FXAA_GLSL_130 == 0)
#define FXAA_GATHER4_ALPHA 0
#endif
#if (FXAA_HLSL_5 == 1)
#define FXAA_GATHER4_ALPHA 1
#endif
#ifdef GL_ARB_gpu_shader5
#define FXAA_GATHER4_ALPHA 1
#endif
#ifdef GL_NV_gpu_shader5
#define FXAA_GATHER4_ALPHA 1
#endif
#ifndef FXAA_GATHER4_ALPHA
#define FXAA_GATHER4_ALPHA 0
#endif
#ifdef GL_ARB_gpu_shader5
#define FXAA_GATHER4_ALPHA 1
#endif
#ifdef GL_NV_gpu_shader5
#define FXAA_GATHER4_ALPHA 1
#endif
#ifndef FXAA_GATHER4_ALPHA
#define FXAA_GATHER4_ALPHA 0
#endif
#endif
#endif
/*============================================================================
@@ -2113,6 +2120,6 @@ void main()
//diff = texture2D(diffuseMap, vary_tc);
gl_FragColor = diff;
frag_color = diff;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@@ -184,5 +186,5 @@ void main()
vec3 norm = texture2DRect(normalMap, pos_screen).xyz;
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
gl_FragColor.xyz = giAmbient(pos, norm);
frag_color.xyz = giAmbient(pos, norm);
}

View File

@@ -1,48 +0,0 @@
/**
* @file giV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
uniform mat4 modelview_projection_matrix;
ATTRIBUTE vec3 position;
ATTRIBUTE vec4 diffuse_color;
ATTRIBUTE vec2 texcoord0;
VARYING vec4 vertex_color;
VARYING vec2 vary_fragcoord;
uniform vec2 screen_res;
void main()
{
//transform vertex
vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
vec4 tex = vec4(texcoord0,0,1);
tex.w = 1.0;
vertex_color = diffuse_color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform float minimum_alpha;
@@ -45,7 +47,7 @@ void main()
discard;
}
gl_FragData[0] = vec4(col.rgb, col.a * 0.005);
gl_FragData[1] = texture2D(specularMap, vary_texcoord0.xy);
gl_FragData[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0);
frag_data[0] = vec4(col.rgb, col.a * 0.005);
frag_data[1] = texture2D(specularMap, vary_texcoord0.xy);
frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xyz, 0.0);
}

View File

@@ -26,12 +26,14 @@
uniform sampler2DRect diffuseMap;
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec2 vary_fragcoord;
void main()
{
gl_FragColor = texture2DRect(diffuseMap, vary_fragcoord.xy);
frag_color = texture2DRect(diffuseMap, vary_fragcoord.xy);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
@@ -141,6 +143,6 @@ void main()
discard;
}
gl_FragColor.rgb = out_col;
gl_FragColor.a = 0.0;
frag_color.rgb = out_col;
frag_color.a = 0.0;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
//class 1 -- no shadows
@@ -242,6 +244,6 @@ void main()
}
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
frag_color.rgb = col;
frag_color.a = 0.0;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D alphaMap;
@@ -52,5 +54,5 @@ void main()
norm *= 0.5;
norm += 0.5;
gl_FragColor = vec4(norm, alpha);
frag_color = vec4(norm, alpha);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -118,6 +120,6 @@ void main()
discard;
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
frag_color.rgb = col;
frag_color.a = 0.0;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -122,5 +124,5 @@ void main()
diff /= w;
}
gl_FragColor = diff;
frag_color = diff;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -40,6 +42,6 @@ void main()
vec4 diff = texture2DRect(diffuseRect, vary_fragcoord.xy);
vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy/screen_res);
gl_FragColor = diff + bloom;
frag_color = diff + bloom;
}

View File

@@ -24,8 +24,10 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
#endif
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect depthMap;
uniform sampler2DRect normalMap;
@@ -96,5 +98,5 @@ void main()
col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z;
gl_FragColor.rgb = col;
frag_color.rgb = col;
}

View File

@@ -1,40 +0,0 @@
/**
* @file postgiV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2007, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
uniform mat4 modelview_projection_matrix;
ATTRIBUTE vec3 position;
VARYING vec2 vary_fragcoord;
uniform vec2 screen_res;
void main()
{
//transform vertex
vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -44,7 +46,7 @@ void main()
discard;
}
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
}

View File

@@ -24,14 +24,16 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 post_pos;
void main()
{
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
/////////////////////////////////////////////////////////////////////////
@@ -57,8 +59,8 @@ void main()
color *= 2.;
/// Gamma correct for WL (soft clip effect).
gl_FragData[0] = vec4(scaleSoftClip(color.rgb), 1.0);
gl_FragData[1] = vec4(0.0,0.0,0.0,0.0);
gl_FragData[2] = vec4(0,0,1,0);
frag_data[0] = vec4(scaleSoftClip(color.rgb), 1.0);
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
frag_data[2] = vec4(0,0,1,0);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -324,7 +326,7 @@ void main()
col = diffuse.rgb;
}
gl_FragColor.rgb = col;
frag_color.rgb = col;
gl_FragColor.a = bloom;
frag_color.a = bloom;
}

View File

@@ -27,7 +27,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -184,6 +186,6 @@ void main()
}
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
frag_color.rgb = col;
frag_color.a = 0.0;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
VARYING vec4 vertex_color;
@@ -36,7 +38,7 @@ void main()
{
vec4 col = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy);
gl_FragData[0] = col;
gl_FragData[1] = vec4(0,0,0,0);
gl_FragData[2] = vec4(0,0,1,0);
frag_data[0] = col;
frag_data[1] = vec4(0,0,0,0);
frag_data[2] = vec4(0,0,1,0);
}

View File

@@ -28,10 +28,12 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
void main()
{
gl_FragColor = vec4(0,0,0,0);
frag_color = vec4(0,0,0,0);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
//class 1 -- no shadow, SSAO only
@@ -128,8 +130,8 @@ void main()
vec3 norm = texture2DRect(normalMap, pos_screen).xyz;
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
gl_FragColor[0] = 1.0;
gl_FragColor[1] = calcAmbientOcclusion(pos, norm);
gl_FragColor[2] = 1.0;
gl_FragColor[3] = 1.0;
frag_color[0] = 1.0;
frag_color[1] = calcAmbientOcclusion(pos, norm);
frag_color[2] = 1.0;
frag_color[3] = 1.0;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D detail_0;
@@ -51,9 +53,9 @@ void main()
float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a;
vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal );
gl_FragData[0] = vec4(outColor.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
frag_data[0] = vec4(outColor.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
uniform sampler2D diffuseMap;
@@ -43,8 +45,8 @@ void main()
discard;
}
gl_FragData[0] = vec4(vertex_color.rgb*col.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
frag_data[0] = vec4(vertex_color.rgb*col.rgb, 0.0);
frag_data[1] = vec4(0,0,0,0);
vec3 nvn = normalize(vary_normal);
gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
frag_data[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -43,7 +45,7 @@ void main()
discard;
}
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragData[3];
out vec4 frag_data[3];
#else
#define frag_data gl_FragData
#endif
vec3 scaleSoftClip(vec3 inColor);
@@ -157,7 +159,7 @@ void main()
//wavef = normalize(wavef);
vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz;
gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse
gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
gl_FragData[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace
frag_data[0] = vec4(color.rgb, 0.5); // diffuse
frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
frag_data[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseMap;
@@ -46,7 +48,7 @@ void main()
float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) );
gl_FragColor.rgb = col.rgb;
gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
frag_color.rgb = col.rgb;
frag_color.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@@ -51,5 +53,5 @@ void main()
col += kern.y * texture2D(diffuseMap, vary_texcoord2.zw);
col += kern.x * texture2D(diffuseMap, vary_texcoord3.zw);
gl_FragColor = vec4(col.rgb * glowStrength, col.a);
frag_color = vec4(col.rgb * glowStrength, col.a);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -59,6 +61,6 @@ void main()
/// Add WL Components
outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0);
frag_color = vec4(scaleSoftClip(outColor.rgb), 1.0);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -60,6 +62,6 @@ void main()
outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb);
outColor = applyWaterFog(outColor);
gl_FragColor = outColor;
frag_color = outColor;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@@ -106,5 +108,5 @@ void main()
vec4 fb = texture2D(screenTex, distort);
gl_FragColor = applyWaterFog(fb,view.xyz);
frag_color = applyWaterFog(fb,view.xyz);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
vec3 scaleSoftClip(vec3 inColor);
@@ -135,5 +137,5 @@ void main()
color.rgb = scaleSoftClip(color.rgb);
color.a = spec * sunAngle2;
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@@ -42,5 +44,5 @@ void main()
discard;
}
gl_FragColor = col;
frag_color = col;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@@ -38,5 +40,5 @@ void main()
{
vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
color.a *= custom_alpha;
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,12 +24,14 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform vec4 color;
void main()
{
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
#extension GL_ARB_texture_rectangle : enable
@@ -37,6 +39,6 @@ VARYING vec2 vary_texcoord1;
void main()
{
gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) +
frag_color = texture2D(glowMap, vary_texcoord0.xy) +
texture2DRect(screenMap, vary_texcoord1.xy);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -38,5 +40,5 @@ void main()
{
vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb;
gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
frag_color = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144)));
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform vec4 color;
@@ -34,5 +36,5 @@ VARYING vec2 vary_texcoord0;
void main()
{
gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy);
frag_color = color*texture2D(diffuseMap, vary_texcoord0.xy);
}

View File

@@ -24,10 +24,12 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
void main()
{
gl_FragColor = vec4(1,1,1,1);
frag_color = vec4(1,1,1,1);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D tex0;
@@ -33,5 +35,5 @@ VARYING vec2 vary_texcoord0;
void main()
{
gl_FragColor = texture2D(tex0, vary_texcoord0.xy);
frag_color = texture2D(tex0, vary_texcoord0.xy);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D tex0;
@@ -36,5 +38,5 @@ void main()
{
float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a;
gl_FragColor = vec4(vertex_color.rgb, alpha);
frag_color = vec4(vertex_color.rgb, alpha);
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect screenMap;
@@ -36,5 +38,5 @@ VARYING vec2 vary_texcoord0;
void main()
{
gl_FragColor = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
frag_color = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D tex0;
@@ -35,5 +37,5 @@ VARYING vec2 vary_texcoord1;
void main()
{
gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
frag_color = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D diffuseMap;
@@ -34,5 +36,5 @@ VARYING vec4 vertex_color;
void main()
{
gl_FragColor = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
frag_color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -48,6 +50,6 @@ void default_lighting()
color.rgb = scaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -50,6 +52,6 @@ void default_lighting()
color.rgb = scaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void default_lighting()
color.rgb = scaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -48,6 +50,6 @@ void fullbright_lighting()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void fullbright_lighting()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -50,6 +52,6 @@ void fullbright_lighting()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -43,6 +45,6 @@ void fullbright_lighting()
color.rgb = fullbrightScaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -50,6 +52,6 @@ void fullbright_shiny_lighting()
color.a = max(color.a, vertex_color.a);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -51,6 +53,6 @@ void fullbright_shiny_lighting()
color.a = max(color.a, vertex_color.a);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -23,7 +23,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -48,6 +50,6 @@ void fullbright_shiny_lighting_water()
color.rgb = fullbrightScaleSoftClip(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -23,7 +23,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -49,6 +51,6 @@ void fullbright_shiny_lighting_water()
color.rgb = fullbrightScaleSoftClip(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -48,6 +50,6 @@ void fullbright_lighting_water()
color.rgb = fullbrightAtmosTransport(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void fullbright_lighting_water()
color.rgb = fullbrightAtmosTransport(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -48,6 +50,6 @@ void fullbright_lighting_water()
color.rgb = fullbrightAtmosTransport(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void fullbright_lighting_water()
color.rgb = fullbrightAtmosTransport(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -43,6 +45,6 @@ void default_lighting()
color.rgb = scaleSoftClip(color.rgb);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -49,6 +51,6 @@ void shiny_lighting()
color.rgb = scaleSoftClip(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -50,6 +52,6 @@ void shiny_lighting()
color.rgb = scaleSoftClip(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -46,6 +48,6 @@ void shiny_lighting_water()
color.rgb = atmosLighting(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -47,6 +49,6 @@ void shiny_lighting_water()
color.rgb = atmosLighting(color.rgb);
color.a = max(color.a, vertex_color.a);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -46,6 +48,6 @@ void default_lighting_water()
color.rgb = atmosLighting(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -50,6 +52,6 @@ void default_lighting_water()
color = applyWaterFog(color);
gl_FragColor = color;
frag_color = color;
}

View File

@@ -24,8 +24,10 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
#endif
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
@@ -39,6 +41,6 @@ void default_lighting_water()
color.rgb = atmosLighting(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -41,6 +43,6 @@ void default_lighting_water()
color.rgb = atmosLighting(color.rgb);
gl_FragColor = applyWaterFog(color);
frag_color = applyWaterFog(color);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2D texture0;
@@ -38,5 +40,5 @@ void main()
float tex0 = texture2D(texture0, vary_texcoord0.xy).a;
float tex1 = texture2D(texture1, vary_texcoord1.xy).a;
gl_FragColor = vec4(tex0+(1.0-tex1)-0.5);
frag_color = vec4(tex0+(1.0-tex1)-0.5);
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform float minimum_alpha;
@@ -42,5 +44,5 @@ void main()
discard;
}
gl_FragColor = color;
frag_color = color;
}

View File

@@ -23,9 +23,9 @@
* $/LicenseInfo$
*/
ATTRIBUTE float texture_index;
ATTRIBUTE ivec4 texture_index;
VARYING float vary_texture_index;
VARYING_FLAT ivec4 vary_texture_index;
void passTextureIndex()
{

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -125,6 +127,6 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
frag_color = color;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRectShadow shadowMap0;
@@ -138,6 +140,6 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
frag_color = color;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRectShadow shadowMap0;
@@ -137,6 +139,6 @@ void main()
color.rgb += diff.rgb * vary_pointlight_col.rgb;
gl_FragColor = color;
frag_color = color;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -253,6 +255,6 @@ void main()
}
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
frag_color.rgb = col;
frag_color.a = 0.0;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform sampler2DRect diffuseRect;
@@ -330,6 +332,6 @@ void main()
col = diffuse.rgb;
}
gl_FragColor.rgb = col;
gl_FragColor.a = bloom;
frag_color.rgb = col;
frag_color.a = bloom;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
VARYING vec4 vertex_color;
@@ -201,6 +203,6 @@ void main()
}
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;
frag_color.rgb = col;
frag_color.a = 0.0;
}

View File

@@ -26,7 +26,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
//class 2, shadows, no SSAO
@@ -129,7 +131,7 @@ void main()
/*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL
{
gl_FragColor = vec4(0.0); // doesn't matter
frag_color = vec4(0.0); // doesn't matter
return;
}*/
@@ -198,19 +200,19 @@ void main()
shadow = 1.0;
}
gl_FragColor[0] = shadow;
gl_FragColor[1] = 1.0;
frag_color[0] = shadow;
frag_color[1] = 1.0;
spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0);
//spotlight shadow 1
vec4 lpos = shadow_matrix[4]*spos;
gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8);
frag_color[2] = pcfShadow(shadowMap4, lpos, 0.8);
//spotlight shadow 2
lpos = shadow_matrix[5]*spos;
gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8);
frag_color[3] = pcfShadow(shadowMap5, lpos, 0.8);
//gl_FragColor.rgb = pos.xyz;
//gl_FragColor.b = shadow;
//frag_color.rgb = pos.xyz;
//frag_color.b = shadow;
}

View File

@@ -25,7 +25,9 @@
#extension GL_ARB_texture_rectangle : enable
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
//class 2 -- shadows and SSAO
@@ -190,7 +192,7 @@ void main()
/*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL
{
gl_FragColor = vec4(0.0); // doesn't matter
frag_color = vec4(0.0); // doesn't matter
return;
}*/
@@ -259,19 +261,19 @@ void main()
shadow = 1.0;
}
gl_FragColor[0] = shadow;
gl_FragColor[1] = calcAmbientOcclusion(pos, norm);
frag_color[0] = shadow;
frag_color[1] = calcAmbientOcclusion(pos, norm);
spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0);
//spotlight shadow 1
vec4 lpos = shadow_matrix[4]*spos;
gl_FragColor[2] = pcfShadow(shadowMap4, lpos, 0.8);
frag_color[2] = pcfShadow(shadowMap4, lpos, 0.8);
//spotlight shadow 2
lpos = shadow_matrix[5]*spos;
gl_FragColor[3] = pcfShadow(shadowMap5, lpos, 0.8);
frag_color[3] = pcfShadow(shadowMap5, lpos, 0.8);
//gl_FragColor.rgb = pos.xyz;
//gl_FragColor.b = shadow;
//frag_color.rgb = pos.xyz;
//frag_color.b = shadow;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
/////////////////////////////////////////////////////////////////////////
@@ -96,7 +98,7 @@ void main()
color *= 2.;
/// Gamma correct for WL (soft clip effect).
gl_FragColor.rgb = scaleSoftClip(color.rgb);
gl_FragColor.a = alpha1;
frag_color.rgb = scaleSoftClip(color.rgb);
frag_color.a = alpha1;
}

View File

@@ -24,7 +24,9 @@
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 gl_FragColor;
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
/////////////////////////////////////////////////////////////////////////
@@ -57,7 +59,7 @@ void main()
color *= 2.;
/// Gamma correct for WL (soft clip effect).
gl_FragColor.rgb = scaleSoftClip(color.rgb);
gl_FragColor.a = 1.0;
frag_color.rgb = scaleSoftClip(color.rgb);
frag_color.a = 1.0;
}