diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
63 files changed, 248 insertions, 326 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 6a93bc2fd2..4c9d813c9c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -33,19 +33,19 @@ uniform mat4 projection_matrix; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; #ifdef USE_INDEXED_TEX void passTextureIndex(); #endif -ATTRIBUTE vec3 normal; +in vec3 normal; #ifdef USE_VERTEX_COLOR -ATTRIBUTE vec4 diffuse_color; +in vec4 diffuse_color; #endif -ATTRIBUTE vec2 texcoord0; +in vec2 texcoord0; #ifdef HAS_SKIN mat4 getObjectSkinnedTransform(); @@ -55,15 +55,15 @@ mat4 getSkinnedTransform(); #endif #endif -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; +out vec3 vary_fragcoord; +out vec3 vary_position; #ifdef USE_VERTEX_COLOR -VARYING vec4 vertex_color; +out vec4 vertex_color; #endif -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; +out vec2 vary_texcoord0; +out vec3 vary_norm; uniform float near_clip; diff --git a/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl index 37fe8287be..da467cd5da 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl @@ -43,7 +43,7 @@ vec2 getScreenCoordinateAo(vec2 screenpos) float getDepthAo(vec2 pos_screen) { - float depth = texture2D(depthMap, pos_screen).r; + float depth = texture(depthMap, pos_screen).r; return depth; } @@ -79,7 +79,7 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm, vec2 pos_screen) { float ret = 1.0; vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, pos_screen.xy * (screen_res / 128)).xy; + vec2 noise_reflect = texture(noiseMap, pos_screen.xy * (screen_res / 128)).xy; float angle_hidden = 0.0; float points = 0; diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl index 44f67899e4..f1dc1159d0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl @@ -23,22 +23,18 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform float minimum_alpha; uniform sampler2D diffuseMap; -VARYING float target_pos_x; -VARYING float pos_w; -VARYING vec2 vary_texcoord0; +in float target_pos_x; +in float pos_w; +in vec2 vary_texcoord0; void main() { - float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a; + float alpha = texture(diffuseMap, vary_texcoord0.xy).a; if (alpha < 0.05) // treat as totally transparent { diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl index 9a0024ede9..097e28aa0c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl @@ -23,24 +23,20 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform float minimum_alpha; uniform sampler2D diffuseMap; -VARYING float pos_w; -VARYING float target_pos_x; -VARYING vec2 vary_texcoord0; +in float pos_w; +in float target_pos_x; +in vec2 vary_texcoord0; uniform vec4 color; void main() { - float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * color.a; + float alpha = texture(diffuseMap, vary_texcoord0.xy).a * color.a; if (alpha < 0.05) // treat as totally transparent { diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl index dfe7077db5..57e0b2b59f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl @@ -30,13 +30,13 @@ uniform float shadow_target_width; mat4 getSkinnedTransform(); void passTextureIndex(); -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec2 texcoord0; -VARYING float pos_w; -VARYING float target_pos_x; -VARYING vec2 vary_texcoord0; +out float pos_w; +out float target_pos_x; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl index 01ffb862f7..83b0ba096c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl @@ -27,14 +27,14 @@ uniform mat3 normal_matrix; uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec4 diffuse_color; +in vec2 texcoord0; -VARYING vec3 vary_normal; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec3 vary_normal; +out vec4 vertex_color; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl index 22b3bd1463..6ebe4ce251 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl @@ -25,24 +25,20 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif uniform sampler2D diffuseMap; uniform float minimum_alpha; -VARYING vec3 vary_normal; -VARYING vec2 vary_texcoord0; +in vec3 vary_normal; +in vec2 vary_texcoord0; vec2 encode_normal(vec3 n); void main() { - vec4 diff = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 diff = texture(diffuseMap, vary_texcoord0.xy); if (diff.a < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl index ac8a483a6a..5c64d48399 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl @@ -27,9 +27,9 @@ uniform mat4 projection_matrix; mat4 getSkinnedTransform(); -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec2 texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl index 1bd8fee7c9..bc0c11ec46 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl @@ -25,16 +25,16 @@ uniform mat4 projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec2 texcoord0; mat4 getSkinnedTransform(); -ATTRIBUTE vec4 weight; +in vec4 weight; -VARYING vec3 vary_normal; -VARYING vec2 vary_texcoord0; +out vec3 vary_normal; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index cc79b450ac..08baf98686 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -23,15 +23,9 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D normalMap; uniform sampler2D lightMap; @@ -43,7 +37,7 @@ uniform vec2 screen_res; uniform vec3 kern[4]; uniform float kern_scale; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; vec4 getPosition(vec2 pos_screen); vec3 getNorm(vec2 pos_screen); diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl index 5e0f01981b..5abaa1f2a6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec2 vary_fragcoord; +out vec2 vary_fragcoord; uniform vec2 screen_res; void main() diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl index c18bca066d..35f483f633 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl @@ -31,18 +31,18 @@ uniform float minimum_alpha; uniform sampler2D diffuseMap; uniform sampler2D bumpMap; -VARYING vec3 vary_mat0; -VARYING vec3 vary_mat1; -VARYING vec3 vary_mat2; +in vec3 vary_mat0; +in vec3 vary_mat1; +in vec3 vary_mat2; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; vec2 encode_normal(vec3 n); void main() { - vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col = texture(diffuseMap, vary_texcoord0.xy); if(col.a < minimum_alpha) { @@ -50,7 +50,7 @@ void main() } col *= vertex_color; - vec3 norm = texture2D(bumpMap, vary_texcoord0.xy).rgb * 2.0 - 1.0; + vec3 norm = texture(bumpMap, vary_texcoord0.xy).rgb * 2.0 - 1.0; vec3 tnorm = vec3(dot(norm,vary_mat0), dot(norm,vary_mat1), diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl index d90891aa20..3af2eab1e4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl @@ -27,17 +27,17 @@ uniform mat3 normal_matrix; uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec4 tangent; +in vec3 position; +in vec4 diffuse_color; +in vec3 normal; +in vec2 texcoord0; +in vec4 tangent; -VARYING vec3 vary_mat0; -VARYING vec3 vary_mat1; -VARYING vec3 vary_mat2; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec3 vary_mat0; +out vec3 vary_mat1; +out vec3 vary_mat2; +out vec4 vertex_color; +out vec2 vary_texcoord0; #ifdef HAS_SKIN mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index 61eee69a16..98314d39d3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -25,23 +25,23 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec2 texcoord0; ////////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky /////////////////////////////////////////////////////////////////////////////// // Output parameters -VARYING vec3 vary_CloudColorSun; -VARYING vec3 vary_CloudColorAmbient; -VARYING float vary_CloudDensity; - -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; -VARYING vec2 vary_texcoord2; -VARYING vec2 vary_texcoord3; -VARYING float altitude_blend_factor; +out vec3 vary_CloudColorSun; +out vec3 vary_CloudColorAmbient; +out float vary_CloudDensity; + +out vec2 vary_texcoord0; +out vec2 vary_texcoord1; +out vec2 vary_texcoord2; +out vec2 vary_texcoord3; +out float altitude_blend_factor; // Inputs uniform vec3 camPosLocal; diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl index 929b4e17b1..d95a33a6be 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -23,15 +23,9 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; uniform sampler2D depthMap; @@ -47,7 +41,7 @@ uniform float max_cof; uniform mat4 inv_proj; uniform vec2 screen_res; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; float calc_cof(float depth) { @@ -68,13 +62,13 @@ void main() { vec2 tc = vary_fragcoord.xy; - float z = texture2D(depthMap, tc).r; + float z = texture(depthMap, tc).r; z = z*2.0-1.0; vec4 ndc = vec4(0.0, 0.0, z, 1.0); vec4 p = inv_proj*ndc; float depth = p.z/p.w; - vec4 diff = texture2D(diffuseRect, vary_fragcoord.xy); + vec4 diff = texture(diffuseRect, vary_fragcoord.xy); float sc = calc_cof(depth); sc = min(sc, max_cof); diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl index 8797f89e4c..55e45ce0af 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl @@ -144,7 +144,7 @@ vec2 getScreenCoordinate(vec2 screenpos) // Method #4: Spheremap Transform, Lambert Azimuthal Equal-Area projection vec3 getNorm(vec2 screenpos) { - vec2 enc = texture2D(normalMap, screenpos.xy).xy; + vec2 enc = texture(normalMap, screenpos.xy).xy; vec2 fenc = enc*4-2; float f = dot(fenc,fenc); float g = sqrt(1-f/4); @@ -170,7 +170,7 @@ vec3 getNormalFromPacked(vec4 packedNormalEnvIntensityFlags) // See: C++: addDeferredAttachments(), GLSL: softenLightF vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensity) { - vec4 packedNormalEnvIntensityFlags = texture2D(normalMap, screenpos.xy); + vec4 packedNormalEnvIntensityFlags = texture(normalMap, screenpos.xy); n = getNormalFromPacked( packedNormalEnvIntensityFlags ); envIntensity = packedNormalEnvIntensityFlags.z; return packedNormalEnvIntensityFlags; @@ -190,7 +190,7 @@ float linearDepth01(float d, float znear, float zfar) float getDepth(vec2 pos_screen) { - float depth = texture2D(depthMap, pos_screen).r; + float depth = texture(depthMap, pos_screen).r; return depth; } @@ -199,7 +199,7 @@ vec4 getTexture2DLodAmbient(vec2 tc, float lod) #ifndef FXAA_GLSL_120 vec4 ret = textureLod(projectionMap, tc, lod); #else - vec4 ret = texture2D(projectionMap, tc); + vec4 ret = texture(projectionMap, tc); #endif ret.rgb = srgb_to_linear(ret.rgb); @@ -215,7 +215,7 @@ vec4 getTexture2DLodDiffuse(vec2 tc, float lod) #ifndef FXAA_GLSL_120 vec4 ret = textureLod(projectionMap, tc, lod); #else - vec4 ret = texture2D(projectionMap, tc); + vec4 ret = texture(projectionMap, tc); #endif ret.rgb = srgb_to_linear(ret.rgb); @@ -262,7 +262,7 @@ vec4 texture2DLodSpecular(vec2 tc, float lod) #ifndef FXAA_GLSL_120 vec4 ret = textureLod(projectionMap, tc, lod); #else - vec4 ret = texture2D(projectionMap, tc); + vec4 ret = texture(projectionMap, tc); #endif ret.rgb = srgb_to_linear(ret.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl index afc05b8bb5..6f3b94f734 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl @@ -31,15 +31,15 @@ uniform float minimum_alpha; uniform sampler2D diffuseMap; -VARYING vec3 vary_normal; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec3 vary_normal; +in vec4 vertex_color; +in vec2 vary_texcoord0; vec2 encode_normal(vec3 n); void main() { - vec4 col = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; + vec4 col = texture(diffuseMap, vary_texcoord0.xy) * vertex_color; if (col.a < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl index 078197f9a8..e5f2af2c53 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl @@ -27,12 +27,12 @@ out vec4 frag_data[4]; -VARYING vec3 vary_normal; +in vec3 vary_normal; uniform float minimum_alpha; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; vec2 encode_normal(vec3 n); diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl index 307dda6b73..234f096ed5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl @@ -31,14 +31,14 @@ uniform float minimum_alpha; uniform sampler2D diffuseMap; -VARYING vec3 vary_normal; -VARYING vec2 vary_texcoord0; +in vec3 vary_normal; +in vec2 vary_texcoord0; vec2 encode_normal(vec3 n); void main() { - vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col = texture(diffuseMap, vary_texcoord0.xy); if (col.a < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index 24e290c614..68fb8bf499 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl @@ -29,15 +29,15 @@ out vec4 frag_data[4]; uniform sampler2D diffuseMap; -VARYING vec3 vary_normal; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec3 vary_normal; +in vec4 vertex_color; +in vec2 vary_texcoord0; vec2 encode_normal(vec3 n); void main() { - vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb; + vec3 col = vertex_color.rgb * texture(diffuseMap, vary_texcoord0.xy).rgb; 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 diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl index be870b2424..93d561504e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl @@ -27,9 +27,9 @@ out vec4 frag_data[4]; -VARYING vec3 vary_normal; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec3 vary_normal; +in vec4 vertex_color; +in vec2 vary_texcoord0; vec2 encode_normal(vec3 n); vec3 linear_to_srgb(vec3 c); diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl index 9461e3e32e..13cc612fab 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl @@ -27,13 +27,13 @@ uniform mat3 normal_matrix; uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec2 texcoord0; -VARYING vec3 vary_normal; +out vec3 vary_normal; -VARYING vec2 vary_texcoord0; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl index d64bcefade..2402cc3b70 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl @@ -27,15 +27,15 @@ uniform mat3 normal_matrix; uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec4 diffuse_color; +in vec3 normal; +in vec2 texcoord0; -VARYING vec3 vary_normal; +out vec3 vary_normal; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec4 vertex_color; +out vec2 vary_texcoord0; void passTextureIndex(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl index d9c0e590c8..3b9b8ae696 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl @@ -23,15 +23,9 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; uniform sampler2D lightMap; @@ -44,14 +38,14 @@ uniform float res_scale; uniform float dof_width; uniform float dof_height; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; vec4 dofSample(sampler2D tex, vec2 tc) { tc.x = min(tc.x, dof_width); tc.y = min(tc.y, dof_height); - return texture2D(tex, tc); + return texture(tex, tc); } void main() @@ -60,7 +54,7 @@ void main() vec4 dof = dofSample(diffuseRect, vary_fragcoord.xy*res_scale); - vec4 diff = texture2D(lightMap, vary_fragcoord.xy); + vec4 diff = texture(lightMap, vary_fragcoord.xy); float a = min(abs(diff.a*2.0-1.0) * max_cof*res_scale*res_scale, 1.0); @@ -69,10 +63,10 @@ void main() float sc = a/res_scale; vec4 col; - col = texture2D(lightMap, vary_fragcoord.xy+vec2(sc,sc)/screen_res); - col += texture2D(lightMap, vary_fragcoord.xy+vec2(-sc,sc)/screen_res); - col += texture2D(lightMap, vary_fragcoord.xy+vec2(sc,-sc)/screen_res); - col += texture2D(lightMap, vary_fragcoord.xy+vec2(-sc,-sc)/screen_res); + col = texture(lightMap, vary_fragcoord.xy+vec2(sc,sc)/screen_res); + col += texture(lightMap, vary_fragcoord.xy+vec2(-sc,sc)/screen_res); + col += texture(lightMap, vary_fragcoord.xy+vec2(sc,-sc)/screen_res); + col += texture(lightMap, vary_fragcoord.xy+vec2(-sc,-sc)/screen_res); diff = mix(diff, col*0.25, a); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl index c8d6e395a3..9e61b6b894 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveF.glsl @@ -23,14 +23,12 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ out vec4 frag_color; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl index 08b1147ab0..5a0913a970 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl @@ -27,18 +27,18 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; void passTextureIndex(); -ATTRIBUTE vec4 emissive; -ATTRIBUTE vec2 texcoord0; +in vec4 emissive; +in vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); vec3 atmosAmbient(); vec3 atmosAffectDirectionalLight(float lightIntensity); -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec4 vertex_color; +out vec2 vary_texcoord0; #ifdef HAS_SKIN mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl index 81f1e9aed0..9ac4ceb37e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index 631ffc9625..385cd51969 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ out vec4 frag_color; diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl index 0e461b4004..5795384b47 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyV.glsl @@ -36,16 +36,16 @@ uniform vec4 origin; -ATTRIBUTE vec3 position; +in vec3 position; void passTextureIndex(); -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; +in vec3 normal; +in vec4 diffuse_color; +in vec2 texcoord0; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; -VARYING vec3 vary_position; +out vec4 vertex_color; +out vec2 vary_texcoord0; +out vec3 vary_texcoord1; +out vec3 vary_position; #ifdef HAS_SKIN mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl index e565722164..77e63e6360 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl @@ -28,20 +28,20 @@ uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; void passTextureIndex(); -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; +in vec4 diffuse_color; +in vec2 texcoord0; void calcAtmospherics(vec3 inPositionEye); vec3 atmosAmbient(); vec3 atmosAffectDirectionalLight(float lightIntensity); -VARYING vec3 vary_position; +out vec3 vary_position; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec4 vertex_color; +out vec2 vary_texcoord0; #ifdef HAS_SKIN mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl index 50d697ae12..cd56ed0adf 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fxaaF.glsl @@ -2093,8 +2093,8 @@ uniform sampler2D depthMap; uniform vec2 rcp_screen_res; uniform vec4 rcp_frame_opt; uniform vec4 rcp_frame_opt2; -VARYING vec2 vary_fragcoord; -VARYING vec2 vary_tc; +in vec2 vary_fragcoord; +in vec2 vary_tc; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl b/indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl index 9e6c853015..e40d070268 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/genbrdflutF.glsl @@ -49,7 +49,7 @@ SOFTWARE. /*[EXTRA_CODE_HERE]*/ -VARYING vec2 vary_uv; +in vec2 vary_uv; out vec4 outColor; diff --git a/indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl b/indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl index 682244478b..3a1572996f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/genbrdflutV.glsl @@ -25,9 +25,9 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec2 vary_uv; +out vec2 vary_uv; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl index 74df43b7c3..748fcbed80 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl @@ -28,11 +28,11 @@ out vec4 frag_data[4]; uniform vec4 color; uniform sampler2D diffuseMap; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; void main() { - frag_data[0] = color*texture2D(diffuseMap, vary_texcoord0.xy); + frag_data[0] = color*texture(diffuseMap, vary_texcoord0.xy); frag_data[1] = vec4(0.0); frag_data[2] = vec4(0.0, 1.0, 0.0, GBUFFER_FLAG_SKIP_ATMOS); frag_data[3] = vec4(0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 5e67442b3a..aae595f619 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -34,22 +34,22 @@ uniform sampler2D diffuseMap; uniform sampler2D normalMap; uniform sampler2D specularMap; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; vec3 linear_to_srgb(vec3 c); vec2 encode_normal (vec3 n); void main() { - vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col = texture(diffuseMap, vary_texcoord0.xy); if (col.a < minimum_alpha) { discard; } - vec4 norm = texture2D(normalMap, vary_texcoord0.xy); - vec4 spec = texture2D(specularMap, vary_texcoord0.xy); + vec4 norm = texture(normalMap, vary_texcoord0.xy); + vec4 spec = texture(specularMap, vary_texcoord0.xy); frag_data[0] = vec4(col.rgb, 0.0); frag_data[1] = spec; diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl index 42266e9378..444c54a31e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl @@ -26,10 +26,10 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec2 texcoord0; -VARYING vec2 vary_texcoord0; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl index d41e0b202b..7cdddfe8db 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl @@ -43,38 +43,38 @@ uniform mat4 modelview_projection_matrix; uniform mat4 modelview_matrix; #endif -VARYING vec3 vary_position; +out vec3 vary_position; #endif uniform mat4 texture_matrix0; -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec4 diffuse_color; +in vec3 normal; +in vec2 texcoord0; #ifdef HAS_NORMAL_MAP -ATTRIBUTE vec4 tangent; -ATTRIBUTE vec2 texcoord1; +in vec4 tangent; +in vec2 texcoord1; out vec3 vary_tangent; flat out float vary_sign; out vec3 vary_normal; -VARYING vec2 vary_texcoord1; +out vec2 vary_texcoord1; #else -VARYING vec3 vary_normal; +out vec3 vary_normal; #endif #ifdef HAS_SPECULAR_MAP -ATTRIBUTE vec2 texcoord2; -VARYING vec2 vary_texcoord2; +in vec2 texcoord2; +out vec2 vary_texcoord2; #endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec4 vertex_color; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl index 573b522068..f3e7b2ee72 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ out vec4 frag_data[4]; diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl index 7a941674b8..05dced0026 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/normgenF.glsl @@ -23,19 +23,13 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D alphaMap; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; uniform float stepX; uniform float stepY; @@ -43,12 +37,12 @@ uniform float norm_scale; void main() { - float c = texture2D(alphaMap, vary_texcoord0).r; + float c = texture(alphaMap, vary_texcoord0).r; - vec3 right = vec3(norm_scale, 0, (texture2D(alphaMap, vary_texcoord0+vec2(stepX, 0)).r-c)*255); - vec3 left = vec3(-norm_scale, 0, (texture2D(alphaMap, vary_texcoord0-vec2(stepX, 0)).r-c)*255); - vec3 up = vec3(0, -norm_scale, (texture2D(alphaMap, vary_texcoord0-vec2(0, stepY)).r-c)*255); - vec3 down = vec3(0, norm_scale, (texture2D(alphaMap, vary_texcoord0+vec2(0, stepY)).r-c)*255); + vec3 right = vec3(norm_scale, 0, (texture(alphaMap, vary_texcoord0+vec2(stepX, 0)).r-c)*255); + vec3 left = vec3(-norm_scale, 0, (texture(alphaMap, vary_texcoord0-vec2(stepX, 0)).r-c)*255); + vec3 up = vec3(0, -norm_scale, (texture(alphaMap, vary_texcoord0-vec2(0, stepY)).r-c)*255); + vec3 down = vec3(0, norm_scale, (texture(alphaMap, vary_texcoord0+vec2(0, stepY)).r-c)*255); vec3 norm = cross(right, down) + cross(down, left) + cross(left,up) + cross(up, right); diff --git a/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl b/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl index 9bceae05b7..7896659ad3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/normgenV.glsl @@ -23,11 +23,11 @@ * $/LicenseInfo$ */ -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec2 texcoord0; -VARYING vec2 vary_fragcoord; -VARYING vec2 vary_texcoord0; +out vec2 vary_fragcoord; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl index 5ef9bb6805..e06f3a5f44 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl @@ -23,11 +23,7 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl index 1c36aa6b50..b74b2e6a83 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrglowF.glsl @@ -47,7 +47,7 @@ vec3 srgb_to_linear(vec3 c); void main() { - vec4 basecolor = texture2D(diffuseMap, base_color_texcoord.xy).rgba; + vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba; if (basecolor.a < minimum_alpha) { @@ -55,7 +55,7 @@ void main() } vec3 emissive = emissiveColor; - emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb); + emissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb); float lum = max(max(emissive.r, emissive.g), emissive.b); lum *= vertex_emissive.a; diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl index 8e5a6c90e0..faa273b834 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl @@ -62,7 +62,7 @@ uniform mat3 normal_matrix; void main() { - vec4 basecolor = texture2D(diffuseMap, base_color_texcoord.xy).rgba; + vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba; if (basecolor.a < minimum_alpha) { discard; @@ -71,7 +71,7 @@ void main() vec3 col = vertex_color.rgb * srgb_to_linear(basecolor.rgb); // from mikktspace.com - vec3 vNt = texture2D(bumpMap, normal_texcoord.xy).xyz*2.0-1.0; + vec3 vNt = texture(bumpMap, normal_texcoord.xy).xyz*2.0-1.0; float sign = vary_sign; vec3 vN = vary_normal; vec3 vT = vary_tangent.xyz; @@ -84,13 +84,13 @@ void main() // occlusion 1.0 // roughness 0.0 // metal 0.0 - vec3 spec = texture2D(specularMap, metallic_roughness_texcoord.xy).rgb; + vec3 spec = texture(specularMap, metallic_roughness_texcoord.xy).rgb; spec.g *= roughnessFactor; spec.b *= metallicFactor; vec3 emissive = emissiveColor; - emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb); + emissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb); tnorm *= gl_FrontFacing ? 1.0 : -1.0; @@ -131,7 +131,7 @@ vec3 srgb_to_linear(vec3 c); void main() { - vec4 basecolor = texture2D(diffuseMap, base_color_texcoord.xy).rgba; + vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba; if (basecolor.a < minimum_alpha) { discard; @@ -140,7 +140,7 @@ void main() vec3 col = vertex_color.rgb * srgb_to_linear(basecolor.rgb); vec3 emissive = emissiveColor; - emissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb); + emissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb); col += emissive; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl index 5ca39d6966..86e3f1acda 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredF.glsl @@ -23,15 +23,9 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; @@ -40,11 +34,11 @@ uniform vec2 screen_res; uniform float max_cof; uniform float res_scale; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc) { - vec4 s = texture2D(diffuseRect, tc); + vec4 s = texture(diffuseRect, tc); float sc = abs(s.a*2.0-1.0)*max_cof; @@ -63,7 +57,7 @@ void dofSample(inout vec4 diff, inout float w, float min_sc, vec2 tc) void dofSampleNear(inout vec4 diff, inout float w, float min_sc, vec2 tc) { - vec4 s = texture2D(diffuseRect, tc); + vec4 s = texture(diffuseRect, tc); float wg = 0.25; @@ -79,7 +73,7 @@ void main() { vec2 tc = vary_fragcoord.xy; - vec4 diff = texture2D(diffuseRect, vary_fragcoord.xy); + vec4 diff = texture(diffuseRect, vary_fragcoord.xy); { float w = 1.0; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index 80816912da..a32296369c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -23,21 +23,15 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; uniform sampler2D exposureMap; uniform vec2 screen_res; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; vec3 linear_to_srgb(vec3 cl); @@ -173,7 +167,7 @@ vec3 legacyGamma(vec3 color) void main() { //this is the one of the rare spots where diffuseRect contains linear color values (not sRGB) - vec4 diff = texture2D(diffuseRect, vary_fragcoord); + vec4 diff = texture(diffuseRect, vary_fragcoord); diff.rgb = toneMap(diff.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl index 004190dbd9..bace9b8c90 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl @@ -23,25 +23,19 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; uniform sampler2D depthMap; uniform vec2 screen_res; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; void main() { - vec4 diff = texture2D(diffuseRect, vary_fragcoord.xy); + vec4 diff = texture(diffuseRect, vary_fragcoord.xy); frag_color = diff; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl index 8b4cac3e64..7e8a5d68d4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoTCV.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec2 vary_fragcoord; +out vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl index 86f0077edb..10b4b3e76c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl @@ -23,10 +23,10 @@ * $/LicenseInfo$ */ -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec2 vary_fragcoord; -VARYING vec2 vary_tc; +out vec2 vary_fragcoord; +out vec2 vary_tc; uniform vec2 tc_scale; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.glsl index f75b8e2658..2c17de311c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredVisualizeBuffers.glsl @@ -23,20 +23,14 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; uniform float mipLevel; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index 8c9b6f8190..a8febabcc6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -25,11 +25,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl index 9608e89169..0f5f9ed289 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl @@ -25,7 +25,7 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; uniform vec3 box_center; uniform vec3 box_size; diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl index 186ba49969..9bbc63bce1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowSkinnedV.glsl @@ -26,7 +26,7 @@ uniform mat4 modelview_matrix; uniform mat4 projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl index 4fa9ae3633..17ce2dee5b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl @@ -25,7 +25,7 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; // SKY //////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl index 4f1756c367..b35d10c8a0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl @@ -48,8 +48,8 @@ void main() { // camera above water: class1\deferred\starsF.glsl // camera below water: class1\environment\starsF.glsl - vec4 col_a = texture2D(diffuseMap, vary_texcoord0.xy); - vec4 col_b = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col_a = texture(diffuseMap, vary_texcoord0.xy); + vec4 col_b = texture(diffuseMap, vary_texcoord0.xy); vec4 col = mix(col_b, col_a, blend_factor); col.rgb *= vertex_color.rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl index 37d1630252..726508607d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl @@ -27,13 +27,13 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; uniform float time; -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec4 diffuse_color; +in vec2 texcoord0; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec2 screenpos; +out vec4 vertex_color; +out vec2 vary_texcoord0; +out vec2 screenpos; void main() { diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl index a85e6ebc66..fd343ed2dc 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ out vec4 frag_data[4]; diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl index d3dfa882f0..9a8d791a1d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl @@ -27,11 +27,11 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec2 texcoord0; -VARYING vec2 vary_texcoord0; -VARYING float sun_fade; +out vec2 vary_texcoord0; +out float sun_fade; void calcAtmospherics(vec3 eye_pos); diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl index 3464212c84..f6d509e2c6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl @@ -33,10 +33,10 @@ uniform sampler2D detail_2; uniform sampler2D detail_3; uniform sampler2D alpha_ramp; -VARYING vec3 pos; -VARYING vec3 vary_normal; -VARYING vec4 vary_texcoord0; -VARYING vec4 vary_texcoord1; +in vec3 pos; +in vec3 vary_normal; +in vec4 vary_texcoord0; +in vec4 vary_texcoord1; vec2 encode_normal(vec3 n); @@ -44,14 +44,14 @@ void main() { /// Note: This should duplicate the blending functionality currently used for the terrain rendering. - vec4 color0 = texture2D(detail_0, vary_texcoord0.xy); - vec4 color1 = texture2D(detail_1, vary_texcoord0.xy); - vec4 color2 = texture2D(detail_2, vary_texcoord0.xy); - vec4 color3 = texture2D(detail_3, vary_texcoord0.xy); + vec4 color0 = texture(detail_0, vary_texcoord0.xy); + vec4 color1 = texture(detail_1, vary_texcoord0.xy); + vec4 color2 = texture(detail_2, vary_texcoord0.xy); + vec4 color3 = texture(detail_3, vary_texcoord0.xy); - float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a; - float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a; - float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; + float alpha1 = texture(alpha_ramp, vary_texcoord0.zw).a; + float alpha2 = texture(alpha_ramp,vary_texcoord1.xy).a; + float alphaFinal = texture(alpha_ramp, vary_texcoord1.zw).a; vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); outColor.a = 0.0; // yes, downstream atmospherics diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl index f42cb6ff6d..f6d3b59e85 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl @@ -27,16 +27,16 @@ uniform mat3 normal_matrix; uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec2 texcoord1; +in vec3 position; +in vec3 normal; +in vec4 diffuse_color; +in vec2 texcoord0; +in vec2 texcoord1; -VARYING vec3 pos; -VARYING vec3 vary_normal; -VARYING vec4 vary_texcoord0; -VARYING vec4 vary_texcoord1; +out vec3 pos; +out vec3 vary_normal; +out vec4 vary_texcoord0; +out vec4 vary_texcoord1; uniform vec4 object_plane_s; uniform vec4 object_plane_t; diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl index d857e47b90..e2d87e68fa 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl @@ -29,9 +29,9 @@ out vec4 frag_data[4]; uniform sampler2D diffuseMap; -VARYING vec4 vertex_color; -VARYING vec3 vary_normal; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec3 vary_normal; +in vec2 vary_texcoord0; uniform float minimum_alpha; @@ -39,7 +39,7 @@ vec2 encode_normal(vec3 n); void main() { - vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col = texture(diffuseMap, vary_texcoord0.xy); if (col.a < minimum_alpha) { discard; diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl index c850a39d6f..7dcab640f2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl @@ -36,7 +36,7 @@ in vec2 vary_texcoord0; void main() { - float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a; + float alpha = texture(diffuseMap, vary_texcoord0.xy).a; if (alpha < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl index 5a7cf369b5..f5192c3009 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowSkinnedV.glsl @@ -27,8 +27,8 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec2 texcoord0; out vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl index 3b6571a24a..ce8a10712c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl @@ -27,13 +27,13 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; uniform mat3 normal_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec2 texcoord0; -VARYING vec3 vary_normal; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec3 vary_normal; +out vec4 vertex_color; +out vec2 vary_texcoord0; void main() { |