diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-05-17 18:09:36 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-05-17 18:09:36 -0500 |
commit | c827d32ebedeaa46ed75a91ae779f6547fc0d090 (patch) | |
tree | 0196248e4d7a2e42b36ab1189408ac3ea99c43e9 | |
parent | a2e418f250c49de9aba943a62f92189fcef6220a (diff) |
SL-19655 Decruft legacy GLSL shaders and now unused build queues.
156 files changed, 537 insertions, 1083 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index e5211d9548..3a3a7679ce 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -588,30 +588,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev if (major_version == 1 && minor_version < 30) { - if (minor_version < 10) - { - //should NEVER get here -- if major version is 1 and minor version is less than 10, - // viewer should never attempt to use shaders, continuing will result in undefined behavior - LL_ERRS() << "Unsupported GLSL Version." << LL_ENDL; - } - - if (minor_version <= 19) - { - shader_code_text[shader_code_count++] = strdup("#version 110\n"); - extra_code_text[extra_code_count++] = strdup("#define ATTRIBUTE attribute\n"); - extra_code_text[extra_code_count++] = strdup("#define VARYING varying\n"); - extra_code_text[extra_code_count++] = strdup("#define VARYING_FLAT varying\n"); - } - else if (minor_version <= 29) - { - //set version to 1.20 - shader_code_text[shader_code_count++] = strdup("#version 120\n"); - extra_code_text[extra_code_count++] = strdup("#define FXAA_GLSL_120 1\n"); - extra_code_text[extra_code_count++] = strdup("#define FXAA_FAST_PIXEL_OFFSET 0\n"); - extra_code_text[extra_code_count++] = strdup("#define ATTRIBUTE attribute\n"); - extra_code_text[extra_code_count++] = strdup("#define VARYING varying\n"); - extra_code_text[extra_code_count++] = strdup("#define VARYING_FLAT varying\n"); - } + llassert(false); // GL 3.1 or later required } else { @@ -648,40 +625,14 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } else { - //set version to 1.30 - shader_code_text[shader_code_count++] = strdup("#version 130\n"); + //set version to 1.40 + shader_code_text[shader_code_count++] = strdup("#version 140\n"); //some implementations of GLSL 1.30 require integer precision be explicitly declared extra_code_text[extra_code_count++] = strdup("precision mediump int;\n"); extra_code_text[extra_code_count++] = strdup("precision highp float;\n"); } - extra_code_text[extra_code_count++] = strdup("#define DEFINE_GL_FRAGCOLOR 1\n"); extra_code_text[extra_code_count++] = strdup("#define FXAA_GLSL_130 1\n"); - - extra_code_text[extra_code_count++] = strdup("#define ATTRIBUTE in\n"); - - if (type == GL_VERTEX_SHADER) - { //"varying" state is "out" in a vertex program, "in" in a fragment program - // ("varying" is deprecated after version 1.20) - extra_code_text[extra_code_count++] = strdup("#define VARYING out\n"); - extra_code_text[extra_code_count++] = strdup("#define VARYING_FLAT flat out\n"); - } - else - { - extra_code_text[extra_code_count++] = strdup("#define VARYING in\n"); - extra_code_text[extra_code_count++] = strdup("#define VARYING_FLAT flat in\n"); - } - - //backwards compatibility with legacy texture lookup syntax - extra_code_text[extra_code_count++] = strdup("#define texture2D texture\n"); - extra_code_text[extra_code_count++] = strdup("#define textureCube texture\n"); - extra_code_text[extra_code_count++] = strdup("#define texture2DLod textureLod\n"); - - if (major_version > 1 || minor_version >= 40) - { //GLSL 1.40 replaces texture2DRect et al with texture - extra_code_text[extra_code_count++] = strdup("#define texture2DRect texture\n"); - extra_code_text[extra_code_count++] = strdup("#define shadow2DRect(a,b) vec2(texture(a,b))\n"); - } } // Use alpha float to store bit flags @@ -719,13 +670,13 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev . uniform sampler2D texN; - VARYING_FLAT ivec4 vary_texture_index; + flat in int vary_texture_index; vec4 ret = vec4(1,0,1,1); vec4 diffuseLookup(vec2 texcoord) { - switch (vary_texture_index.r)) + switch (vary_texture_index) { case 0: ret = texture2D(tex0, texcoord); break; case 1: ret = texture2D(tex1, texcoord); break; @@ -751,7 +702,7 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev if (texture_index_channels > 1) { - extra_code_text[extra_code_count++] = strdup("VARYING_FLAT int vary_texture_index;\n"); + extra_code_text[extra_code_count++] = strdup("flat in int vary_texture_index;\n"); } extra_code_text[extra_code_count++] = strdup("vec4 diffuseLookup(vec2 texcoord)\n"); diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl index 767fad016c..374469ce2f 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl @@ -24,7 +24,7 @@ */ -ATTRIBUTE vec4 weight; +in vec4 weight; uniform vec4 matrixPalette[45]; diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl index 0543a26642..9adc68e62b 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl @@ -25,12 +25,12 @@ uniform mat4 projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec2 texcoord0; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec4 vertex_color; +out vec2 vary_texcoord0; uniform vec4 color; diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl index fac1599c6b..837074f08c 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl @@ -28,13 +28,13 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; 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 vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec4 vertex_color; +out vec2 vary_texcoord0; vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor); void calcAtmospherics(vec3 inPositionEye); diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index 90bf2851c9..0817076dd5 100644 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -22,7 +22,7 @@ * $/LicenseInfo$ */ -ATTRIBUTE vec4 weight4; +in vec4 weight4; uniform mat3x4 matrixPalette[MAX_JOINTS_PER_MESH_OBJECT]; 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() { diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl index 4e535f7e18..7a5e14566b 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.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 diffuseMap; uniform float minLuminance; @@ -40,11 +34,11 @@ uniform vec3 lumWeights; uniform vec3 warmthWeights; uniform float warmthAmount; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; void main() { - vec4 col = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col = texture(diffuseMap, vary_texcoord0.xy); /// CALCULATING LUMINANCE (Using NTSC lum weights) /// http://en.wikipedia.org/wiki/Luma_%28video%29 float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) ); diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl index fdca5018b0..ccda75596d 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl @@ -25,9 +25,9 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec2 vary_texcoord0; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl index 301e8aba26..8718dd8b52 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl @@ -23,19 +23,15 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseMap; uniform float glowStrength; -VARYING vec4 vary_texcoord0; -VARYING vec4 vary_texcoord1; -VARYING vec4 vary_texcoord2; -VARYING vec4 vary_texcoord3; +in vec4 vary_texcoord0; +in vec4 vary_texcoord1; +in vec4 vary_texcoord2; +in vec4 vary_texcoord3; void main() { @@ -47,14 +43,14 @@ void main() kern[0] = 0.25; kern[1] = 0.5; kern[2] = 0.8; kern[3] = 1.0; kern[4] = 1.0; kern[5] = 0.8; kern[6] = 0.5; kern[7] = 0.25; - col += kern[0] * texture2D(diffuseMap, vary_texcoord0.xy); - col += kern[1] * texture2D(diffuseMap, vary_texcoord1.xy); - col += kern[2] * texture2D(diffuseMap, vary_texcoord2.xy); - col += kern[3] * texture2D(diffuseMap, vary_texcoord3.xy); - col += kern[4] * texture2D(diffuseMap, vary_texcoord0.zw); - col += kern[5] * texture2D(diffuseMap, vary_texcoord1.zw); - col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw); - col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw); + col += kern[0] * texture(diffuseMap, vary_texcoord0.xy); + col += kern[1] * texture(diffuseMap, vary_texcoord1.xy); + col += kern[2] * texture(diffuseMap, vary_texcoord2.xy); + col += kern[3] * texture(diffuseMap, vary_texcoord3.xy); + col += kern[4] * texture(diffuseMap, vary_texcoord0.zw); + col += kern[5] * texture(diffuseMap, vary_texcoord1.zw); + col += kern[6] * texture(diffuseMap, vary_texcoord2.zw); + col += kern[7] * texture(diffuseMap, vary_texcoord3.zw); frag_color = max(vec4(col.rgb * glowStrength, col.a), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl index 63ca15139c..60ec4e6f3b 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl @@ -25,14 +25,14 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; uniform vec2 glowDelta; -VARYING vec4 vary_texcoord0; -VARYING vec4 vary_texcoord1; -VARYING vec4 vary_texcoord2; -VARYING vec4 vary_texcoord3; +out vec4 vary_texcoord0; +out vec4 vary_texcoord1; +out vec4 vary_texcoord2; +out vec4 vary_texcoord3; void main() { diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl index ac400aa2a6..5a3845b1a3 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl @@ -27,7 +27,7 @@ uniform mat4 modelview_matrix; uniform mat3 normal_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; void calcAtmospherics(vec3 inPositionEye); @@ -39,9 +39,9 @@ uniform vec3 eyeVec; uniform float waterHeight; uniform vec3 lightDir; -VARYING vec4 refCoord; -VARYING vec4 littleWave; -VARYING vec4 view; +out vec4 refCoord; +out vec4 littleWave; +out vec4 view; out vec3 vary_position; out vec3 vary_light_dir; out vec3 vary_tangent; diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index 69c1983b4d..a46e91c394 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -23,22 +23,18 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseMap; uniform float minimum_alpha; -VARYING vec2 vary_texcoord0; -VARYING vec4 vertex_color; +in vec2 vary_texcoord0; +in vec4 vertex_color; void main() { - vec4 col = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); + vec4 col = vertex_color*texture(diffuseMap, vary_texcoord0.xy); if (col.a < minimum_alpha) { discard; diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl index 3580d1f27b..a8dac55130 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl @@ -26,12 +26,12 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -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; +out vec4 vertex_color; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl b/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl index 1936e0dcaa..06b19c22c9 100644 --- a/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl @@ -23,17 +23,13 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseMap; -VARYING vec2 tc0; +in vec2 tc0; void main() { - frag_color = texture2D(diffuseMap, tc0); + frag_color = texture(diffuseMap, tc0); } diff --git a/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl b/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl index 7beb20ede4..cbcc6bef97 100644 --- a/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl @@ -25,9 +25,9 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec2 tc0; +out vec2 tc0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/clipF.glsl b/indra/newview/app_settings/shaders/class1/interface/clipF.glsl index 9454bbf21e..ee2d652f32 100644 --- a/indra/newview/app_settings/shaders/class1/interface/clipF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/clipF.glsl @@ -23,16 +23,12 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform vec4 color; uniform vec4 clip_plane; -VARYING vec3 vary_position; +in vec3 vary_position; void main() diff --git a/indra/newview/app_settings/shaders/class1/interface/clipV.glsl b/indra/newview/app_settings/shaders/class1/interface/clipV.glsl index e376b25a71..7dd2ef593f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/clipV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/clipV.glsl @@ -26,9 +26,9 @@ uniform mat4 modelview_projection_matrix; uniform mat4 modelview_matrix; -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec3 vary_position; +out vec3 vary_position; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl index cb8d6a8c03..cefa429639 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -23,11 +23,7 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform vec4 color; diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl index 153998f1d5..2e32863109 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl @@ -25,7 +25,7 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; #ifdef HAS_SKIN mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index e578bb6fc5..fa8aa5c7fe 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -23,8 +23,6 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ out vec4 frag_color; @@ -36,5 +34,5 @@ in vec2 tc; void main() { - frag_color = texture2D(diffuseRect, tc) + texture2D(emissiveRect, tc); + frag_color = texture(diffuseRect, tc) + texture(emissiveRect, tc); } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index c50548d528..3d4035620f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.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/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl index 48aab1ce21..fa67b13e4d 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl @@ -24,9 +24,9 @@ */ -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec2 vary_tc; +out vec2 vary_tc; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index 58c9e5ad0a..9bba1b2e18 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -23,18 +23,14 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform vec4 color; uniform sampler2D diffuseMap; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; void main() { - frag_color = max(color*texture2D(diffuseMap, vary_texcoord0.xy), vec4(0)); + frag_color = max(color*texture(diffuseMap, vary_texcoord0.xy), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl index 947c2b0065..0253c7236d 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightNormV.glsl @@ -26,12 +26,12 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec2 texcoord1; -ATTRIBUTE vec2 texcoord2; +in vec3 position; +in vec2 texcoord0; +in vec2 texcoord1; +in vec2 texcoord2; -VARYING vec2 vary_texcoord0; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl index c5d102b739..9f7ff8337a 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightSpecV.glsl @@ -26,12 +26,12 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec2 texcoord1; -ATTRIBUTE vec2 texcoord2; +in vec3 position; +in vec2 texcoord0; +in vec2 texcoord1; +in vec2 texcoord2; -VARYING vec2 vary_texcoord0; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl index 0b362cf46c..481b7a3b1d 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.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; #ifdef HAS_SKIN mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl b/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl index 5190abf17c..633c928e6b 100644 --- a/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/irradianceGenV.glsl @@ -25,9 +25,9 @@ uniform mat4 modelview_matrix; -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec3 vary_dir; +out vec3 vary_dir; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl index 5c479d27a9..75ff19e470 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionCubeV.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/interface/occlusionSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionSkinnedV.glsl index 7305065a05..1ff9c347b6 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionSkinnedV.glsl @@ -26,7 +26,7 @@ uniform mat4 projection_matrix; uniform mat4 modelview_matrix; -ATTRIBUTE vec3 position; +in vec3 position; mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl index c26fa08ddc..b44c746fa7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl @@ -25,7 +25,7 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; +in vec3 position; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl index f1400c9b44..a85d055a5b 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterF.glsl @@ -23,20 +23,16 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D tex0; uniform float tolerance; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; void main() { - frag_color = texture2D(tex0, vary_texcoord0.xy); + frag_color = texture(tex0, vary_texcoord0.xy); if(frag_color[0] + frag_color[1] + frag_color[2] < tolerance) { diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl index a33ef7e92c..1b8411603a 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturefilterV.glsl @@ -25,10 +25,10 @@ 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/interface/pathfindingF.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl index 7379360e17..fac22be6de 100644 --- a/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingF.glsl @@ -23,13 +23,9 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif -VARYING vec4 vertex_color; +in vec4 vertex_color; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl index 19fa607307..4f08df839d 100644 --- a/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingNoNormalV.glsl @@ -25,10 +25,10 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; +in vec3 position; +in vec4 diffuse_color; -VARYING vec4 vertex_color; +out vec4 vertex_color; uniform float tint; uniform float alpha_scale; diff --git a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl index 91f252cf1e..9e77927cb8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/pathfindingV.glsl @@ -25,11 +25,11 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec3 normal; +in vec3 position; +in vec4 diffuse_color; +in vec3 normal; -VARYING vec4 vertex_color; +out vec4 vertex_color; uniform float tint; uniform float ambiance; diff --git a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl index cd5d97c785..9ecdf0bf77 100644 --- a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl @@ -31,7 +31,7 @@ out vec4 frag_color; uniform samplerCubeArray reflectionProbes; uniform int sourceIdx; -VARYING vec3 vary_dir; +in vec3 vary_dir; //uniform float roughness; diff --git a/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl b/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl index 5f5d9396ff..2c31e98838 100644 --- a/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenV.glsl @@ -25,9 +25,9 @@ uniform mat4 modelview_matrix; -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec3 vary_dir; +out vec3 vary_dir; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index da02534dbb..a14334fd01 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -23,21 +23,17 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D tex0; uniform vec4 color; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; void main() { - float alpha = texture2D(tex0, vary_texcoord0.xy).a * color.a; + float alpha = texture(tex0, vary_texcoord0.xy).a * color.a; frag_color = vec4(color.rgb, alpha); } diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl index f33115d78d..b280fcdc15 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -25,10 +25,10 @@ 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/interface/twotexturecompareF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl index 6eeb2596b2..6d51b898b7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl @@ -23,11 +23,7 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D tex0; uniform sampler2D tex1; @@ -36,12 +32,12 @@ uniform float dither_scale; uniform float dither_scale_s; uniform float dither_scale_t; -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; +in vec2 vary_texcoord0; +in vec2 vary_texcoord1; void main() { - frag_color = abs(texture2D(tex0, vary_texcoord0.xy) - texture2D(tex1, vary_texcoord0.xy)); + frag_color = abs(texture(tex0, vary_texcoord0.xy) - texture(tex1, vary_texcoord0.xy)); vec2 dither_coord; dither_coord[0] = vary_texcoord0[0] * dither_scale_s; diff --git a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl index 67c6674f0c..a103bff12d 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareV.glsl @@ -25,12 +25,12 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec2 texcoord1; +in vec3 position; +in vec2 texcoord0; +in vec2 texcoord1; -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; +out vec2 vary_texcoord0; +out vec2 vary_texcoord1; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 299bfb72aa..a29b848253 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -23,18 +23,14 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseMap; -VARYING vec2 vary_texcoord0; -VARYING vec4 vertex_color; +in vec2 vary_texcoord0; +in vec4 vertex_color; void main() { - frag_color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); + frag_color = vertex_color*texture(diffuseMap, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl index 220dafef25..91a846b9fa 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl @@ -26,12 +26,12 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -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; +out vec4 vertex_color; +out vec2 vary_texcoord0; void main() { diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl index eaf0f71b41..6535c0835e 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl @@ -23,19 +23,15 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform float minimum_alpha; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; void default_lighting() { diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl index fc76c0cc00..4dc67028d5 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl @@ -23,11 +23,7 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform float minimum_alpha; @@ -36,12 +32,12 @@ uniform sampler2D diffuseMap; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; void default_lighting() { - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + vec4 color = texture(diffuseMap,vary_texcoord0.xy); if (color.a < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl index 6b86d717da..2d1c7dadb0 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl @@ -23,14 +23,10 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl index 59c1bc1446..cea08ecffd 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightNonIndexedF.glsl @@ -23,14 +23,10 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; uniform sampler2D diffuseMap; @@ -39,7 +35,7 @@ vec3 scaleSoftClip(vec3 light); void default_lighting() { - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; + vec4 color = texture(diffuseMap,vary_texcoord0.xy) * vertex_color; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl index 7da8e9054a..670b3ddaf1 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl @@ -23,19 +23,15 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform float minimum_alpha; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; void default_lighting_water() { diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl index f767c17f86..2e5ed57014 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -23,11 +23,7 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform float minimum_alpha; @@ -36,12 +32,12 @@ uniform sampler2D diffuseMap; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; void default_lighting_water() { - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + vec4 color = texture(diffuseMap,vary_texcoord0.xy); if (color.a < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl index 2530bdcc74..09b4a6e317 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl @@ -23,14 +23,10 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl index 7f112d7435..4888fa547c 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterNonIndexedF.glsl @@ -23,14 +23,10 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; uniform sampler2D diffuseMap; @@ -39,7 +35,7 @@ vec4 applyWaterFog(vec4 color); void default_lighting_water() { - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; + vec4 color = texture(diffuseMap,vary_texcoord0.xy) * vertex_color; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl index 1deb374cd0..67c99530e3 100644 --- a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl @@ -23,22 +23,18 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D texture0; uniform sampler2D texture1; -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; +in vec2 vary_texcoord0; +in vec2 vary_texcoord1; void main() { - float tex0 = texture2D(texture0, vary_texcoord0.xy).a; - float tex1 = texture2D(texture1, vary_texcoord1.xy).a; + float tex0 = texture(texture0, vary_texcoord0.xy).a; + float tex1 = texture(texture1, vary_texcoord1.xy).a; frag_color = max(vec4(tex0+(1.0-tex1)-0.5), vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl index ee9970bc70..7d5417919e 100644 --- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl @@ -26,12 +26,12 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec2 texcoord1; +in vec3 position; +in vec2 texcoord0; +in vec2 texcoord1; -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; +out vec2 vary_texcoord0; +out vec2 vary_texcoord1; #ifdef HAS_SKIN mat4 getObjectSkinnedTransform(); diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl index 467a9949e4..ff9aaf3357 100644 --- a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl @@ -23,21 +23,17 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform float minimum_alpha; uniform sampler2D diffuseMap; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; void main() { - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + vec4 color = texture(diffuseMap,vary_texcoord0.xy); if (color.a < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl index e90dbb115a..cf3162f5f1 100644 --- a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl @@ -27,10 +27,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/objects/indexedTextureV.glsl b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl index ca29bf3143..d90f9271dc 100644 --- a/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/indexedTextureV.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -ATTRIBUTE int texture_index; +in int texture_index; -VARYING_FLAT int vary_texture_index; +flat out int vary_texture_index; void passTextureIndex() { diff --git a/indra/newview/app_settings/shaders/class1/objects/previewF.glsl b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl index 687d6b7482..ec785cd1c0 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewF.glsl @@ -23,19 +23,15 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseMap; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; void main() { - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; + vec4 color = texture(diffuseMap,vary_texcoord0.xy) * vertex_color; frag_color = max(color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl index b56fc97a85..e3e71202ae 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsF.glsl @@ -23,20 +23,16 @@ * $/LicenseInfo$ */ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseMap; uniform vec4 color; -VARYING vec2 vary_texcoord0; +in vec2 vary_texcoord0; //==================================================================================================== void main() { - frag_color = max(texture2D(diffuseMap,vary_texcoord0.xy) * color, vec4(0)); + frag_color = max(texture(diffuseMap,vary_texcoord0.xy) * color, vec4(0)); } diff --git a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl index 913dec83bd..d8c74e8537 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewPhysicsV.glsl @@ -27,10 +27,10 @@ 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; +out vec2 vary_texcoord0; //==================================================================================================== diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index 5886f47cbc..b474a5803f 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -28,14 +28,14 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec2 texcoord0; uniform vec4 color; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec4 vertex_color; +out vec2 vary_texcoord0; uniform vec4 light_position[8]; uniform vec3 light_direction[8]; diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl index 22821a2f76..07f5d250cf 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl @@ -30,12 +30,12 @@ uniform mat4 modelview_projection_matrix; uniform vec4 color; -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec2 texcoord0; +in vec3 position; +in vec3 normal; +in vec2 texcoord0; -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +out vec4 vertex_color; +out vec2 vary_texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index f4d6eff69e..ae8cd97b18 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -25,19 +25,13 @@ //class2/deferred/alphaF.glsl -#extension GL_ARB_texture_rectangle : enable - /*[EXTRA_CODE_HERE]*/ #define INDEXED 1 #define NON_INDEXED 2 #define NON_INDEXED_NO_COLOR 3 -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform mat3 env_mat; uniform vec3 sun_dir; @@ -47,13 +41,13 @@ uniform vec3 moon_dir; uniform sampler2D diffuseMap; #endif -VARYING vec3 vary_fragcoord; -VARYING vec3 vary_position; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_norm; +in vec3 vary_fragcoord; +in vec3 vary_position; +in vec2 vary_texcoord0; +in vec3 vary_norm; #ifdef USE_VERTEX_COLOR -VARYING vec4 vertex_color; //vertex color should be treated as sRGB +in vec4 vertex_color; //vertex color should be treated as sRGB #endif #ifdef HAS_ALPHA_MASK @@ -195,7 +189,7 @@ void main() #endif #ifdef USE_DIFFUSE_TEX - vec4 diffuse_tap = texture2D(diffuseMap,vary_texcoord0.xy); + vec4 diffuse_tap = texture(diffuseMap,vary_texcoord0.xy); #endif #ifdef USE_INDEXED_TEX diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl index cd7c005162..7b7b4a040c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl @@ -214,7 +214,7 @@ void main() // emissiveColor is the emissive color factor from GLTF and is already in linear space vec3 colorEmissive = emissiveColor; // emissiveMap here is a vanilla RGB texture encoded as sRGB, manually convert to linear - colorEmissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb); + colorEmissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb); // PBR IBL float gloss = 1.0 - perceptualRoughness; @@ -305,7 +305,7 @@ void main() // emissiveColor is the emissive color factor from GLTF and is already in linear space vec3 colorEmissive = emissiveColor; // emissiveMap here is a vanilla RGB texture encoded as sRGB, manually convert to linear - colorEmissive *= srgb_to_linear(texture2D(emissiveMap, emissive_texcoord.xy).rgb); + colorEmissive *= srgb_to_linear(texture(emissiveMap, emissive_texcoord.xy).rgb); float a = basecolor.a*vertex_color.a; diff --git a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl index 080f622155..60134a7f72 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl @@ -40,7 +40,7 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv, vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); vec3 env_vec = env_mat * refnormpersp; - glossenv = srgb_to_linear(textureCube(environmentMap, env_vec).rgb); + glossenv = srgb_to_linear(texture(environmentMap, env_vec).rgb); } void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv, @@ -63,7 +63,7 @@ void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); vec3 env_vec = env_mat * refnormpersp; - legacyenv = srgb_to_linear(textureCube(environmentMap, env_vec).rgb); + legacyenv = srgb_to_linear(texture(environmentMap, env_vec).rgb); glossenv = legacyenv; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl index 1e7ccb747a..d1db6dd943 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl @@ -23,11 +23,11 @@ * $/LicenseInfo$ */ -ATTRIBUTE vec3 position; +in vec3 position; uniform vec2 screen_res; -VARYING vec2 vary_fragcoord; +out vec2 vary_fragcoord; // forwards void setAtmosAttenuation(vec3 c); diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index e1cbfcce1a..1ea57516a4 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.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 //class 2, shadows, no SSAO // Inputs -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; uniform vec3 sun_dir; uniform float shadow_bias; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 99a26a050d..0126e09d4c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -22,20 +22,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 //class 2 -- shadows and SSAO // Inputs -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/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl index 3dfca0f655..5ae7f2c571 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.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/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl index 4c418e414f..3773f191e8 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -// VARYING param funcs +// out param funcs uniform vec3 sun_dir; diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl index 07733bda18..34669a6796 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl @@ -24,8 +24,8 @@ */ -VARYING vec3 vary_AdditiveColor; -VARYING vec3 vary_AtmosAttenuation; +in vec3 vary_AdditiveColor; +in vec3 vary_AtmosAttenuation; vec3 getSunlitColor() { diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl index 31109aed31..1b854d80b3 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl @@ -24,8 +24,8 @@ */ -VARYING vec3 vary_AdditiveColor; -VARYING vec3 vary_AtmosAttenuation; +out vec3 vary_AdditiveColor; +out vec3 vary_AtmosAttenuation; vec3 additive_color; vec3 atmos_attenuation; diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl index 22e16b7e0f..7a6741fe0e 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -VARYING vec3 vary_PositionEye; -VARYING vec3 vary_AdditiveColor; -VARYING vec3 vary_AtmosAttenuation; +in vec3 vary_PositionEye; +in vec3 vary_AdditiveColor; +in vec3 vary_AtmosAttenuation; vec3 getSunlitColor() { diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl index 0f2a3ee527..23c3aed4d8 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -VARYING vec3 vary_PositionEye; -VARYING vec3 vary_AdditiveColor; -VARYING vec3 vary_AtmosAttenuation; +out vec3 vary_PositionEye; +out vec3 vary_AdditiveColor; +out vec3 vary_AtmosAttenuation; vec3 atmos_attenuation; vec3 sunlit_color; diff --git a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl index f1b1997c43..1c79748b49 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/fullbrightShinyF.glsl @@ -25,21 +25,17 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif #ifndef HAS_DIFFUSE_LOOKUP uniform sampler2D diffuseMap; #endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; -VARYING vec3 vary_position; +in vec4 vertex_color; +in vec2 vary_texcoord0; +in vec3 vary_texcoord1; +in vec3 vary_position; uniform samplerCube environmentMap; @@ -62,7 +58,7 @@ void main() #ifdef HAS_DIFFUSE_LOOKUP vec4 color = diffuseLookup(vary_texcoord0.xy); #else - vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 color = texture(diffuseMap, vary_texcoord0.xy); #endif color.rgb *= vertex_color.rgb; diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl index e5341386bd..77e3b92385 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl @@ -52,11 +52,7 @@ vec3 legacy_adjust(vec3 c); #if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif #ifdef HAS_SUN_SHADOW float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen); @@ -77,9 +73,9 @@ uniform mat3 env_mat; uniform vec3 sun_dir; uniform vec3 moon_dir; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; -VARYING vec3 vary_position; +in vec3 vary_position; uniform mat4 proj_mat; uniform mat4 inv_proj; @@ -167,7 +163,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe if (nh > 0.0) { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); + float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); vec3 speccol = lit*scol*light_col.rgb*spec.rgb; speccol = clamp(speccol, vec3(0), vec3(1)); col += speccol; @@ -184,11 +180,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe } #else -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_data[4]; -#else -#define frag_data gl_FragData -#endif #endif uniform sampler2D diffuseMap; //always in sRGB space @@ -200,7 +192,7 @@ uniform sampler2D bumpMap; #ifdef HAS_SPECULAR_MAP uniform sampler2D specularMap; -VARYING vec2 vary_texcoord2; +in vec2 vary_texcoord2; #endif uniform float env_intensity; @@ -214,13 +206,13 @@ uniform float minimum_alpha; in vec3 vary_normal; in vec3 vary_tangent; flat in float vary_sign; -VARYING vec2 vary_texcoord1; +in vec2 vary_texcoord1; #else -VARYING vec3 vary_normal; +in vec3 vary_normal; #endif -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; +in vec4 vertex_color; +in vec2 vary_texcoord0; vec2 encode_normal(vec3 n); @@ -228,7 +220,7 @@ vec2 encode_normal(vec3 n); vec3 getNormal(inout float glossiness) { #ifdef HAS_NORMAL_MAP - vec4 vNt = texture2D(bumpMap, vary_texcoord1.xy); + vec4 vNt = texture(bumpMap, vary_texcoord1.xy); glossiness *= vNt.a; vNt.xyz = vNt.xyz * 2 - 1; float sign = vary_sign; @@ -247,7 +239,7 @@ vec3 getNormal(inout float glossiness) vec4 getSpecular() { #ifdef HAS_SPECULAR_MAP - vec4 spec = texture2D(specularMap, vary_texcoord2.xy); + vec4 spec = texture(specularMap, vary_texcoord2.xy); spec.rgb *= specular_color.rgb; #else vec4 spec = vec4(specular_color.rgb, 1.0); @@ -301,7 +293,7 @@ void main() waterClip(); // diffcol == diffuse map combined with vertex color - vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 diffcol = texture(diffuseMap, vary_texcoord0.xy); diffcol.rgb *= vertex_color.rgb; alphaMask(diffcol.a); @@ -364,7 +356,7 @@ void main() if (glossiness > 0.0) // specular reflection { float sa = dot(normalize(refnormpersp), light_dir.xyz); - vec3 dumbshiny = sunlit_linear * shadow * (texture2D(lightFunc, vec2(sa, glossiness)).r); + vec3 dumbshiny = sunlit_linear * shadow * (texture(lightFunc, vec2(sa, glossiness)).r); // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; @@ -395,7 +387,7 @@ void main() float gtdenom = 2 * nh; float gt = max(0,(min(gtdenom * nv / vh, gtdenom * nl / vh))); - float scol = shadow*fres*texture2D(lightFunc, vec2(nh, glossiness)).r*gt/(nh*nl); + float scol = shadow*fres*texture(lightFunc, vec2(nh, glossiness)).r*gt/(nh*nl); color.rgb += lit*scol*sunlit_linear.rgb*spec.rgb; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl index 2da177ea7e..2a096a98ec 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.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 depthMap; uniform sampler2D diffuseRect; @@ -49,7 +43,7 @@ uniform vec2 screen_res; uniform float far_z; uniform mat4 inv_proj; -VARYING vec4 vary_fragcoord; +in vec4 vary_fragcoord; void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist); float calcLegacyDistanceAttenuation(float distance, float falloff); @@ -88,15 +82,15 @@ void main() vec3 n; vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG() - vec4 spec = texture2D(specularRect, tc); - vec3 diffuse = texture2D(diffuseRect, tc).rgb; + vec4 spec = texture(specularRect, tc); + vec3 diffuse = texture(diffuseRect, tc).rgb; vec3 h, l, v = -normalize(pos); float nh, nv, vh, lightDist; if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { - vec3 colorEmissive = texture2D(emissiveRect, tc).rgb; + vec3 colorEmissive = texture(emissiveRect, tc).rgb; vec3 orm = spec.rgb; float perceptualRoughness = orm.g; float metallic = orm.b; @@ -167,7 +161,7 @@ void main() if (nh > 0.0) { - float scol = fres * texture2D(lightFunc, vec2(nh, spec.a)).r * gt / (nh * nl); + float scol = fres * texture(lightFunc, vec2(nh, spec.a)).r * gt / (nh * nl); col += lit * scol * light_col[i].rgb * spec.rgb; } } diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl index 831b3b2684..c2b9ed3d96 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightV.glsl @@ -23,9 +23,9 @@ * $/LicenseInfo$ */ -ATTRIBUTE vec3 position; +in vec3 position; -VARYING vec4 vary_fragcoord; +out vec4 vary_fragcoord; void main() { diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index 33715d4d87..23120bbbbe 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -23,16 +23,9 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable - /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; uniform sampler2D specularRect; @@ -67,7 +60,7 @@ uniform float size; uniform vec3 color; uniform float falloff; -VARYING vec4 vary_fragcoord; +in vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -118,7 +111,7 @@ void main() if (proj_shadow_idx >= 0) { - vec4 shd = texture2D(lightMap, tc); + vec4 shd = texture(lightMap, tc); shadow = (proj_shadow_idx==0)?shd.b:shd.a; shadow += shadow_fade; shadow = clamp(shadow, 0.0, 1.0); @@ -139,8 +132,8 @@ void main() float nh, nl, nv, vh, lightDist; calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist); - vec3 diffuse = texture2D(diffuseRect, tc).rgb; - vec4 spec = texture2D(specularRect, tc); + vec3 diffuse = texture(diffuseRect, tc).rgb; + vec4 spec = texture(specularRect, tc); vec3 dlit = vec3(0, 0, 0); vec3 slit = vec3(0, 0, 0); @@ -148,7 +141,7 @@ void main() if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { - vec3 colorEmissive = texture2D(emissiveRect, tc).rgb; + vec3 colorEmissive = texture(emissiveRect, tc).rgb; vec3 orm = spec.rgb; float perceptualRoughness = orm.g; float metallic = orm.b; @@ -223,7 +216,7 @@ void main() if (nh > 0.0) { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl); + float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl); vec3 speccol = dlit*scol*spec.rgb*shadow; speccol = clamp(speccol, vec3(0), vec3(1)); final_color += speccol; diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl index 7724a6cac9..42ba96148c 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.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 specularRect; @@ -48,8 +42,8 @@ uniform vec3 color; uniform float falloff; uniform float size; -VARYING vec4 vary_fragcoord; -VARYING vec3 trans_center; +in vec4 vary_fragcoord; +in vec3 trans_center; uniform vec2 screen_res; @@ -83,8 +77,8 @@ void main() vec3 n; vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG() - vec3 diffuse = texture2D(diffuseRect, tc).rgb; - vec4 spec = texture2D(specularRect, tc); + vec3 diffuse = texture(diffuseRect, tc).rgb; + vec4 spec = texture(specularRect, tc); // Common half vectors calcs vec3 lv = trans_center.xyz-pos; @@ -101,7 +95,7 @@ void main() if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { - vec3 colorEmissive = texture2D(emissiveRect, tc).rgb; + vec3 colorEmissive = texture(emissiveRect, tc).rgb; vec3 orm = spec.rgb; float perceptualRoughness = orm.g; float metallic = orm.b; @@ -141,7 +135,7 @@ void main() if (nh > 0.0) { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl); + float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl); final_color += lit*scol*color.rgb*spec.rgb; } } diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl index d42c8f6cf6..8d23f1b427 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightV.glsl @@ -26,13 +26,13 @@ uniform mat4 modelview_projection_matrix; uniform mat4 modelview_matrix; -ATTRIBUTE vec3 position; +in vec3 position; uniform vec3 center; uniform float size; -VARYING vec4 vary_fragcoord; -VARYING vec3 trans_center; +out vec4 vary_fragcoord; +out vec3 trans_center; void main() { diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl index f1865a77e2..02e724c155 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.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 vec2 screen_res; uniform mat4 projection_matrix; @@ -39,8 +33,8 @@ uniform mat4 inv_proj; uniform float zNear; uniform float zFar; -VARYING vec2 vary_fragcoord; -VARYING vec3 camera_ray; +in vec2 vary_fragcoord; +in vec3 camera_ray; uniform sampler2D specularRect; uniform sampler2D diffuseRect; @@ -67,10 +61,10 @@ void main() vec3 n; vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG() vec3 pos = getPositionWithDepth(tc, getDepth(tc)).xyz; - vec4 spec = texture2D(specularRect, tc); + vec4 spec = texture(specularRect, tc); vec2 hitpixel; - vec4 diffuse = texture2D(diffuseRect, tc); + vec4 diffuse = texture(diffuseRect, tc); vec3 specCol = spec.rgb; vec4 fcol = texture(diffuseMap, tc); diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl index b084094d4d..f7e7268cc3 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostV.glsl @@ -26,12 +26,12 @@ uniform mat4 projection_matrix; uniform mat4 inv_proj; -ATTRIBUTE vec3 position; +in vec3 position; uniform vec2 screen_res; -VARYING vec2 vary_fragcoord; -VARYING vec3 camera_ray; +out vec2 vary_fragcoord; +out vec3 camera_ray; void main() diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index a8d61afeca..2f3efaa94a 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -23,19 +23,12 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable - #define FLT_MAX 3.402823466e+38 #define REFMAP_COUNT 256 #define REF_SAMPLE_COUNT 64 //maximum number of samples to consider -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; uniform sampler2D specularRect; @@ -60,7 +53,7 @@ uniform mat3 env_mat; uniform vec3 sun_dir; uniform vec3 moon_dir; uniform int sun_up_factor; -VARYING vec2 vary_fragcoord; +in vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -127,16 +120,16 @@ void main() vec2 tc = vary_fragcoord.xy; float depth = getDepth(tc.xy); vec4 pos = getPositionWithDepth(tc, depth); - vec4 norm = texture2D(normalMap, tc); + vec4 norm = texture(normalMap, tc); float envIntensity = norm.z; norm.xyz = getNorm(tc); vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; - vec4 baseColor = texture2D(diffuseRect, tc); - vec4 spec = texture2D(specularRect, vary_fragcoord.xy); // NOTE: PBR linear Emissive + vec4 baseColor = texture(diffuseRect, tc); + vec4 spec = texture(specularRect, vary_fragcoord.xy); // NOTE: PBR linear Emissive #if defined(HAS_SUN_SHADOW) || defined(HAS_SSAO) - vec2 scol_ambocc = texture2D(lightMap, vary_fragcoord.xy).rg; + vec2 scol_ambocc = texture(lightMap, vary_fragcoord.xy).rg; #endif #if defined(HAS_SUN_SHADOW) @@ -180,12 +173,12 @@ void main() if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { - vec3 orm = texture2D(specularRect, tc).rgb; + vec3 orm = texture(specularRect, tc).rgb; float perceptualRoughness = orm.g; float metallic = orm.b; float ao = orm.r * ambocc; - vec3 colorEmissive = texture2D(emissiveRect, tc).rgb; + vec3 colorEmissive = texture(emissiveRect, tc).rgb; // PBR IBL float gloss = 1.0 - perceptualRoughness; @@ -211,7 +204,7 @@ void main() else if (!GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_ATMOS)) { //should only be true of WL sky, just port over base color value - color = texture2D(emissiveRect, tc).rgb; + color = texture(emissiveRect, tc).rgb; color = srgb_to_linear(color); if (sun_up_factor > 0) { @@ -263,7 +256,7 @@ void main() float gtdenom = 2 * nh; float gt = max(0,(min(gtdenom * nv / vh, gtdenom * nl / vh))); - scol *= fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl); + scol *= fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl); color.rgb += lit*scol*sunlit_linear.rgb*spec.rgb; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index f2ab585716..1ea801d7d7 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -23,9 +23,6 @@ * $/LicenseInfo$ */ -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : enable - /*[EXTRA_CODE_HERE]*/ #define DEBUG_ANY_LIGHT_TYPE 0 // Output green light cone @@ -38,11 +35,7 @@ #define DEBUG_SPOT_NL 0 // monochome area effected by light #define DEBUG_SPOT_ZERO 0 // Output zero for spotlight -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif uniform sampler2D diffuseRect; uniform sampler2D specularRect; @@ -75,8 +68,8 @@ uniform float size; uniform vec3 color; uniform float falloff; -VARYING vec3 trans_center; -VARYING vec4 vary_fragcoord; +in vec3 trans_center; +in vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -126,7 +119,7 @@ void main() if (proj_shadow_idx >= 0) { - vec4 shd = texture2D(lightMap, tc); + vec4 shd = texture(lightMap, tc); shadow = (proj_shadow_idx == 0) ? shd.b : shd.a; shadow += shadow_fade; shadow = clamp(shadow, 0.0, 1.0); @@ -147,15 +140,15 @@ void main() float nh, nl, nv, vh, lightDist; calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist); - vec3 diffuse = texture2D(diffuseRect, tc).rgb; - vec4 spec = texture2D(specularRect, tc); + vec3 diffuse = texture(diffuseRect, tc).rgb; + vec4 spec = texture(specularRect, tc); vec3 dlit = vec3(0, 0, 0); vec3 slit = vec3(0, 0, 0); vec3 amb_rgb = vec3(0); if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { - vec3 colorEmissive = texture2D(emissiveRect, tc).rgb; + vec3 colorEmissive = texture(emissiveRect, tc).rgb; vec3 orm = spec.rgb; float perceptualRoughness = orm.g; float metallic = orm.b; @@ -231,7 +224,7 @@ void main() if (nh > 0.0) { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl); + float scol = fres*texture(lightFunc, vec2(nh, spec.a)).r*gt/(nh*nl); vec3 speccol = dlit*scol*spec.rgb*shadow; speccol = clamp(speccol, vec3(0), vec3(1)); final_color += speccol; diff --git a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl index 21c30012ab..e99ad5b474 100644 --- a/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/underWaterF.glsl @@ -50,9 +50,9 @@ uniform float waterFogKS; uniform vec2 screenRes; //bigWave is (refCoord.w, view.w); -VARYING vec4 refCoord; -VARYING vec4 littleWave; -VARYING vec4 view; +in vec4 refCoord; +in vec4 littleWave; +in vec4 view; in vec3 vary_position; vec4 applyWaterFogViewLinearNoClip(vec3 pos, vec4 color, vec3 sunlit); @@ -62,9 +62,9 @@ void main() vec4 color; //get detail normals - vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; - vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; - vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; + vec3 wave1 = texture(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; + vec3 wave2 = texture(bumpMap, littleWave.xy).xyz*2.0-1.0; + vec3 wave3 = texture(bumpMap, littleWave.zw).xyz*2.0-1.0; vec3 wavef = normalize(wave1+wave2+wave3); //figure out distortion vector (ripply) @@ -72,7 +72,7 @@ void main() distort = distort+wavef.xy*refScale; #ifdef TRANSPARENT_WATER - vec4 fb = texture2D(screenTex, distort); + vec4 fb = texture(screenTex, distort); #else vec4 fb = vec4(waterFogColorLinear, 0.0); #endif diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl index 3d4f4fc17b..8fee259933 100644 --- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl @@ -99,9 +99,9 @@ uniform vec3 waterFogColorLinear; //bigWave is (refCoord.w, view.w); -VARYING vec4 refCoord; -VARYING vec4 littleWave; -VARYING vec4 view; +in vec4 refCoord; +in vec4 littleWave; +in vec4 view; in vec3 vary_position; in vec3 vary_normal; in vec3 vary_tangent; @@ -144,12 +144,12 @@ void main() //get wave normals vec2 bigwave = vec2(refCoord.w, view.w); vec3 wave1_a = texture(bumpMap, bigwave, -2 ).xyz*2.0-1.0; - vec3 wave2_a = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; - vec3 wave3_a = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; + vec3 wave2_a = texture(bumpMap, littleWave.xy).xyz*2.0-1.0; + vec3 wave3_a = texture(bumpMap, littleWave.zw).xyz*2.0-1.0; vec3 wave1_b = texture(bumpMap2, bigwave ).xyz*2.0-1.0; - vec3 wave2_b = texture2D(bumpMap2, littleWave.xy).xyz*2.0-1.0; - vec3 wave3_b = texture2D(bumpMap2, littleWave.zw).xyz*2.0-1.0; + vec3 wave2_b = texture(bumpMap2, littleWave.xy).xyz*2.0-1.0; + vec3 wave3_b = texture(bumpMap2, littleWave.zw).xyz*2.0-1.0; //wave1_a = wave2_a = wave3_a = wave1_b = wave2_b = wave3_b = vec3(0,0,1); @@ -210,16 +210,16 @@ void main() vec3 sunlit_linear = srgb_to_linear(sunlit); #ifdef TRANSPARENT_WATER - vec4 fb = texture2D(screenTex, distort2); - float depth = texture2D(screenDepth, distort2).r; + vec4 fb = texture(screenTex, distort2); + float depth = texture(screenDepth, distort2).r; vec3 refPos = getPositionWithNDC(vec3(distort2*2.0-vec2(1.0), depth*2.0-1.0)); if (refPos.z > pos.z-0.05) { //we sampled an above water sample, don't distort distort2 = distort; - fb = texture2D(screenTex, distort2); - depth = texture2D(screenDepth, distort2).r; + fb = texture(screenTex, distort2); + depth = texture(screenDepth, distort2).r; refPos = getPositionWithNDC(vec3(distort2 * 2.0 - vec2(1.0), depth * 2.0 - 1.0)); } diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index cdd8ae88bb..5ab1f52439 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -257,8 +257,7 @@ public: typedef enum e_drawable_flags { - IN_REBUILD_Q1 = 0x00000001, - IN_REBUILD_Q2 = 0x00000002, + IN_REBUILD_Q = 0x00000001, EARLY_MOVE = 0x00000004, MOVE_UNDAMPED = 0x00000008, ON_MOVE_LIST = 0x00000010, diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index c9370b49f1..e935bc5553 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -366,7 +366,7 @@ void LLVolumeImplFlexible::doIdleUpdate() if (visible) { - if (!drawablep->isState(LLDrawable::IN_REBUILD_Q1) && + if (!drawablep->isState(LLDrawable::IN_REBUILD_Q) && pixel_area > 256.f) { U32 id; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index ed1c7c8dea..978cb78083 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3107,22 +3107,6 @@ public: renderNormals(drawable); } - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BUILD_QUEUE)) - { - if (drawable->isState(LLDrawable::IN_REBUILD_Q2)) - { - gGL.diffuseColor4f(0.6f, 0.6f, 0.1f, 1.f); - const LLVector4a* ext = drawable->getSpatialExtents(); - LLVector4a center; - center.setAdd(ext[0], ext[1]); - center.mul(0.5f); - LLVector4a size; - size.setSub(ext[1], ext[0]); - size.mul(0.5f); - drawBoxOutline(center, size); - } - } - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_AREA)) { setTextureAreaDebugText(drawable); @@ -3452,14 +3436,12 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_BBOXES | LLPipeline::RENDER_DEBUG_NORMALS | LLPipeline::RENDER_DEBUG_POINTS | - //LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY | LLPipeline::RENDER_DEBUG_TEXTURE_AREA | LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | LLPipeline::RENDER_DEBUG_RAYCAST | LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | LLPipeline::RENDER_DEBUG_AVATAR_JOINTS | LLPipeline::RENDER_DEBUG_AGENT_TARGET | - //LLPipeline::RENDER_DEBUG_BUILD_QUEUE | LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA | LLPipeline::RENDER_DEBUG_TEXEL_DENSITY)) { diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 5105ec835b..04ca62e0ec 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -998,8 +998,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLSpatialGroup::sNoDelete = FALSE; gPipeline.clearReferences(); - - gPipeline.rebuildGroups(); } LLAppViewer::instance()->pingMainloopTimeout("Display:FrameStats"); @@ -1130,8 +1128,6 @@ void display_cube_face() LLSpatialGroup::sNoDelete = FALSE; gPipeline.clearReferences(); - - gPipeline.rebuildGroups(); } void render_hud_attachments() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d4dc813bba..d0acac858c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1028,10 +1028,6 @@ U64 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_LOD_INFO; } - else if ("build queue" == info_display) - { - return LLPipeline::RENDER_DEBUG_BUILD_QUEUE; - } else if ("lights" == info_display) { return LLPipeline::RENDER_DEBUG_LIGHTS; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9960ce7bd0..2687ccfae2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -338,7 +338,6 @@ LLPipeline::LLPipeline() : mOldRenderDebugMask(0), mMeshDirtyQueryObject(0), mGroupQ1Locked(false), - mGroupQ2Locked(false), mResetVertexBuffers(false), mLastRebuildPool(NULL), mLightMask(0), @@ -557,7 +556,6 @@ void LLPipeline::cleanup() assertInitialized(); mGroupQ1.clear() ; - mGroupQ2.clear() ; for(pool_set_t::iterator iter = mPools.begin(); iter != mPools.end(); ) @@ -2513,33 +2511,6 @@ void LLPipeline::clearRebuildGroups() // Copy the saved HUD groups back in mGroupQ1.assign(hudGroups.begin(), hudGroups.end()); mGroupQ1Locked = false; - - // Clear the HUD groups - hudGroups.clear(); - - mGroupQ2Locked = true; - for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); - iter != mGroupQ2.end(); ++iter) - { - LLSpatialGroup* group = *iter; - - // If the group contains HUD objects, save the group - if (group->isHUDGroup()) - { - hudGroups.push_back(group); - } - // Else, no HUD objects so clear the build state - else - { - group->clearState(LLSpatialGroup::IN_BUILD_Q2); - } - } - // Clear the group - mGroupQ2.clear(); - - // Copy the saved HUD groups back in - mGroupQ2.assign(hudGroups.begin(), hudGroups.end()); - mGroupQ2Locked = false; } void LLPipeline::clearRebuildDrawables() @@ -2551,24 +2522,11 @@ void LLPipeline::clearRebuildDrawables() LLDrawable* drawablep = *iter; if (drawablep && !drawablep->isDead()) { - drawablep->clearState(LLDrawable::IN_REBUILD_Q2); - drawablep->clearState(LLDrawable::IN_REBUILD_Q1); + drawablep->clearState(LLDrawable::IN_REBUILD_Q); } } mBuildQ1.clear(); - // clear drawables on the non-priority build queue - for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin(); - iter != mBuildQ2.end(); ++iter) - { - LLDrawable* drawablep = *iter; - if (!drawablep->isDead()) - { - drawablep->clearState(LLDrawable::IN_REBUILD_Q2); - } - } - mBuildQ2.clear(); - //clear all moving bridges for (LLDrawable::drawable_vector_t::iterator iter = mMovedBridge.begin(); iter != mMovedBridge.end(); ++iter) @@ -2622,52 +2580,6 @@ void LLPipeline::rebuildPriorityGroups() } -void LLPipeline::rebuildGroups() -{ - if (mGroupQ2.empty() || gCubeSnapshot) - { - return; - } - - LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; - mGroupQ2Locked = true; - // Iterate through some drawables on the non-priority build queue - S32 size = (S32) mGroupQ2.size(); - S32 min_count = llclamp((S32) ((F32) (size * size)/4096*0.25f), 1, size); - - S32 count = 0; - - std::sort(mGroupQ2.begin(), mGroupQ2.end(), LLSpatialGroup::CompareUpdateUrgency()); - - LLSpatialGroup::sg_vector_t::iterator iter; - LLSpatialGroup::sg_vector_t::iterator last_iter = mGroupQ2.begin(); - - for (iter = mGroupQ2.begin(); - iter != mGroupQ2.end() && count <= min_count; ++iter) - { - LLSpatialGroup* group = *iter; - last_iter = iter; - - if (!group->isDead()) - { - group->rebuildGeom(); - - if (group->getSpatialPartition()->mRenderByGroup) - { - count++; - } - } - - group->clearState(LLSpatialGroup::IN_BUILD_Q2); - } - - mGroupQ2.erase(mGroupQ2.begin(), ++last_iter); - - mGroupQ2Locked = false; - - updateMovedList(mMovedBridge); -} - void LLPipeline::updateGeom(F32 max_dtime) { LLTimer update_timer; @@ -2693,16 +2605,6 @@ void LLPipeline::updateGeom(F32 max_dtime) LLDrawable* drawablep = *curiter; if (drawablep && !drawablep->isDead()) { - if (drawablep->isState(LLDrawable::IN_REBUILD_Q2)) - { - drawablep->clearState(LLDrawable::IN_REBUILD_Q2); - LLDrawable::drawable_list_t::iterator find = std::find(mBuildQ2.begin(), mBuildQ2.end(), drawablep); - if (find != mBuildQ2.end()) - { - mBuildQ2.erase(find); - } - } - if (drawablep->isUnload()) { drawablep->unload(); @@ -2711,7 +2613,7 @@ void LLPipeline::updateGeom(F32 max_dtime) if (updateDrawableGeom(drawablep, TRUE)) { - drawablep->clearState(LLDrawable::IN_REBUILD_Q1); + drawablep->clearState(LLDrawable::IN_REBUILD_Q); mBuildQ1.erase(curiter); } } @@ -2720,54 +2622,6 @@ void LLPipeline::updateGeom(F32 max_dtime) mBuildQ1.erase(curiter); } } - - // Iterate through some drawables on the non-priority build queue - S32 min_count = 16; - S32 size = (S32) mBuildQ2.size(); - if (size > 1024) - { - min_count = llclamp((S32) (size * (F32) size/4096), 16, size); - } - - S32 count = 0; - - max_dtime = llmax(update_timer.getElapsedTimeF32()+0.001f, F32SecondsImplicit(max_dtime)); - LLSpatialGroup* last_group = NULL; - LLSpatialBridge* last_bridge = NULL; - - for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin(); - iter != mBuildQ2.end(); ) - { - LLDrawable::drawable_list_t::iterator curiter = iter++; - LLDrawable* drawablep = *curiter; - - LLSpatialBridge* bridge = drawablep->isRoot() ? drawablep->getSpatialBridge() : - drawablep->getParent()->getSpatialBridge(); - - if (drawablep->getSpatialGroup() != last_group && - (!last_bridge || bridge != last_bridge) && - (update_timer.getElapsedTimeF32() >= max_dtime) && count > min_count) - { - break; - } - - //make sure updates don't stop in the middle of a spatial group - //to avoid thrashing (objects are enqueued by group) - last_group = drawablep->getSpatialGroup(); - last_bridge = bridge; - - bool update_complete = true; - if (!drawablep->isDead()) - { - update_complete = updateDrawableGeom(drawablep, FALSE); - count++; - } - if (update_complete) - { - drawablep->clearState(LLDrawable::IN_REBUILD_Q2); - mBuildQ2.erase(curiter); - } - } updateMovedList(mMovedBridge); } @@ -2992,10 +2846,10 @@ void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags f { if (drawablep && !drawablep->isDead() && assertInitialized()) { - if (!drawablep->isState(LLDrawable::IN_REBUILD_Q1)) + if (!drawablep->isState(LLDrawable::IN_REBUILD_Q)) { mBuildQ1.push_back(drawablep); - drawablep->setState(LLDrawable::IN_REBUILD_Q1); // mark drawable as being in priority queue + drawablep->setState(LLDrawable::IN_REBUILD_Q); // mark drawable as being in priority queue } if (flag & (LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION)) @@ -4837,63 +4691,6 @@ void LLPipeline::renderDebug() } } - if (mRenderDebugMask & LLPipeline::RENDER_DEBUG_BUILD_QUEUE) - { - U32 count = 0; - U32 size = mGroupQ2.size(); - LLColor4 col; - - LLVertexBuffer::unbind(); - LLGLEnable blend(GL_BLEND); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - LLGLDepthTest depth(GL_TRUE, GL_FALSE); - gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep); - - gGL.pushMatrix(); - gGL.loadMatrix(gGLModelView); - gGLLastMatrix = NULL; - - for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter) - { - LLSpatialGroup* group = *iter; - if (group->isDead()) - { - continue; - } - - LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge(); - - if (bridge && (!bridge->mDrawable || bridge->mDrawable->isDead())) - { - continue; - } - - if (bridge) - { - gGL.pushMatrix(); - gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); - } - - F32 alpha = llclamp((F32) (size-count)/size, 0.f, 1.f); - - - LLVector2 c(1.f-alpha, alpha); - c.normVec(); - - - ++count; - col.set(c.mV[0], c.mV[1], 0, alpha*0.5f+0.5f); - group->drawObjectBox(col); - - if (bridge) - { - gGL.popMatrix(); - } - } - - gGL.popMatrix(); - } - gGL.flush(); gUIProgram.unbind(); } @@ -5992,11 +5789,7 @@ void LLPipeline::findReferences(LLDrawable *drawablep) { LL_INFOS() << "In mBuildQ1" << LL_ENDL; } - if (std::find(mBuildQ2.begin(), mBuildQ2.end(), drawablep) != mBuildQ2.end()) - { - LL_INFOS() << "In mBuildQ2" << LL_ENDL; - } - + S32 count; count = gObjectList.findReferences(drawablep); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 3b6a11b378..6b367d3d73 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -599,7 +599,6 @@ public: RENDER_DEBUG_SCULPTED = 0x00080000, RENDER_DEBUG_AVATAR_VOLUME = 0x00100000, RENDER_DEBUG_AVATAR_JOINTS = 0x00200000, - RENDER_DEBUG_BUILD_QUEUE = 0x00400000, RENDER_DEBUG_AGENT_TARGET = 0x00800000, RENDER_DEBUG_UPDATE_TYPE = 0x01000000, RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000, @@ -821,9 +820,7 @@ protected: // Different queues of drawables being processed. // LLDrawable::drawable_list_t mBuildQ1; // priority - LLDrawable::drawable_list_t mBuildQ2; // non-priority LLSpatialGroup::sg_vector_t mGroupQ1; //priority - LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority LLSpatialGroup::sg_vector_t mGroupSaveQ1; // a place to save mGroupQ1 until it is safe to unref @@ -832,7 +829,6 @@ protected: LLDrawable::drawable_list_t mPartitionQ; //drawables that need to update their spatial partition radius - bool mGroupQ2Locked; bool mGroupQ1Locked; bool mResetVertexBuffers; //if true, clear vertex buffers on next update diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index df067d2b88..3164c3e124 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2924,16 +2924,6 @@ function="World.EnvPreset" parameter="triangle count" /> </menu_item_check> <menu_item_check - label="Build Queue" - name="Build Queue"> - <menu_item_check.on_check - function="Advanced.CheckInfoDisplay" - parameter="build queue" /> - <menu_item_check.on_click - function="Advanced.ToggleInfoDisplay" - parameter="build queue" /> - </menu_item_check> - <menu_item_check label="Lights" name="Lights"> <menu_item_check.on_check |