From 14f6bbadef2c39e58a3b54c0c6212949acf50e45 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 8 Aug 2011 15:29:23 -0500 Subject: SH-2242 Work in progress migrating to glVertexAttrib everywhere --- .../shaders/class1/interface/customalphaV.glsl | 9 ++++++--- .../shaders/class1/interface/glowcombineV.glsl | 9 ++++++--- .../shaders/class1/interface/highlightF.glsl | 4 ++-- .../shaders/class1/interface/highlightV.glsl | 18 ++++-------------- .../shaders/class1/interface/occlusionV.glsl | 4 +++- .../shaders/class1/interface/solidcolorV.glsl | 10 ++++++---- .../shaders/class1/interface/twotextureaddV.glsl | 9 ++++++--- .../app_settings/shaders/class1/interface/uiV.glsl | 10 +++++++--- 8 files changed, 40 insertions(+), 33 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl index 04bfff22c1..22095bc611 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl @@ -5,12 +5,15 @@ * $/LicenseInfo$ */ +attribute vec3 position; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_FrontColor = gl_Color; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = vec4(texcoord0,0,1); + gl_FrontColor = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl index ce183ec154..46be1c45d3 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl @@ -5,11 +5,14 @@ * $/LicenseInfo$ */ +attribute vec3 position; +attribute vec2 texcoord0; +attribute vec2 texcoord1; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[1] = gl_MultiTexCoord1; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = vec4(texcoord0,0,1); + gl_TexCoord[1] = vec4(texcoord1,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index f6c6d945de..a0cbdaafb8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -6,10 +6,10 @@ */ - +uniform vec4 highlight_color; uniform sampler2D diffuseMap; void main() { - gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragColor = highlight_color*texture2D(diffuseMap, gl_TexCoord[0].xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl index f114f766bf..0547c44093 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl @@ -5,23 +5,13 @@ * $/LicenseInfo$ */ - +attribute vec3 position; +attribute vec2 texcoord0; void main() { //transform vertex - gl_Position = ftransform(); - vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz; - pos = normalize(pos); - float d = dot(pos, normalize(gl_NormalMatrix * gl_Normal)); - d *= d; - d = 1.0 - d; - d *= d; - - d = min(d, gl_Color.a*2.0); - - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_FrontColor.rgb = gl_Color.rgb; - gl_FrontColor.a = max(d, gl_Color.a); + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl index 5a5d0ec506..9c528750eb 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl @@ -5,8 +5,10 @@ * $/LicenseInfo$ */ +attribute vec3 position; + void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl index 8401208e28..18c8e394c6 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -5,12 +5,14 @@ * $/LicenseInfo$ */ - +attribute vec3 position; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_FrontColor = gl_Color; - gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_FrontColor = diffuse_color; + gl_TexCoord[0] = vec4(texcoord0,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl index f685b112b4..dde4e87c63 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl @@ -6,11 +6,14 @@ */ +attribute vec3 position; +attribute vec2 texcoord0; +attribute vec2 texcoord1; void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[1] = gl_MultiTexCoord1; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = vec4(texcoord0,0,1); + gl_TexCoord[1] = vec4(texcoord1,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl index 9ca6cae5c5..ebf2361da4 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl @@ -6,11 +6,15 @@ */ +attribute vec3 position; +attribute vec4 diffuse_color; +attribute vec2 texcoord0; + void main() { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - gl_FrontColor = gl_Color; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1); + gl_TexCoord[0] = vec4(texcoord0,0,1); + gl_FrontColor = diffuse_color; } -- cgit v1.2.3 From 2ee815478043c4d5845f094f744a055707dba0e0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 10 Aug 2011 13:01:14 -0500 Subject: SH-2238, SH-2223, SH-SH-2242 glVertexAttrib throughout main render pipeline complete, preview renders and debug displays still pending. Also fixed a render glitch and a crash (JIRAs listed). --- .../shaders/class1/interface/onetexturenocolorF.glsl | 13 +++++++++++++ .../shaders/class1/interface/onetexturenocolorV.glsl | 18 ++++++++++++++++++ .../app_settings/shaders/class1/interface/uiV.glsl | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl new file mode 100644 index 0000000000..a5442c9bf4 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -0,0 +1,13 @@ +/** + * @file onetexturenocolorF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform sampler2D tex0; + +void main() +{ + gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl new file mode 100644 index 0000000000..7df45e90e6 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl @@ -0,0 +1,18 @@ +/** + * @file onetexturenocolorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + +attribute vec3 position; +attribute vec2 texcoord0; + + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1); + gl_TexCoord[0] = vec4(texcoord0,0,1); +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl index ebf2361da4..9d129caf21 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl @@ -14,7 +14,7 @@ attribute vec2 texcoord0; void main() { gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1); - gl_TexCoord[0] = vec4(texcoord0,0,1); + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); gl_FrontColor = diffuse_color; } -- cgit v1.2.3 From 2dd8ce53e4e0d14f2bc20796eb6bdf1ef12a65df Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 11 Aug 2011 14:19:58 -0500 Subject: SH-2242 FXAA support instead of unreliable multisample textures (done here because it's a smaller change than integrating glVertexAttrib with FSAA pipe). Shader integration with LLDynamicTexture subclasses. --- .../shaders/class1/interface/glowcombineFXAAF.glsl | 23 ++++++++++++++++++++++ .../shaders/class1/interface/glowcombineFXAAV.glsl | 19 ++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl new file mode 100644 index 0000000000..6639f88047 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -0,0 +1,23 @@ +/** + * @file glowcombineFXAAF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2D glowMap; +uniform sampler2DRect screenMap; + +uniform vec2 screen_res; +varying vec2 vary_tc; + +void main() +{ + vec3 col = texture2D(glowMap, vary_tc).rgb + + texture2DRect(screenMap, vary_tc*screen_res).rgb; + + + gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144))); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl new file mode 100644 index 0000000000..f54876135e --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl @@ -0,0 +1,19 @@ +/** + * @file glowcombineFXAAV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +attribute vec3 position; + +varying vec2 vary_tc; + +void main() +{ + vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); + gl_Position = pos; + + vary_tc = pos.xy*0.5+0.5; +} + -- cgit v1.2.3 From ee4fdd2c18c722164d78a7305777fad6e49cba8b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sun, 21 Aug 2011 16:23:04 -0500 Subject: SH-2242 Work in progress on FXAA/glVertexAttrib -- DoF works, physics shape display still doesn't. --- .../shaders/class1/interface/debugF.glsl | 31 +++++++++++++++++++ .../shaders/class1/interface/debugV.glsl | 32 +++++++++++++++++++ .../class1/interface/splattexturerectF.glsl | 33 ++++++++++++++++++++ .../class1/interface/splattexturerectV.glsl | 36 ++++++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/interface/debugF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/debugV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl new file mode 100644 index 0000000000..d43bf3fb50 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -0,0 +1,31 @@ +/** + * @file debugF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform vec4 color; + +void main() +{ + gl_FragColor = color; +} diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl new file mode 100644 index 0000000000..2f64fdb7bc --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl @@ -0,0 +1,32 @@ +/** + * @file debugV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +attribute vec3 position; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl new file mode 100644 index 0000000000..c263f4dc6a --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -0,0 +1,33 @@ +/** + * @file splattexturerectF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2DRect screenMap; + +void main() +{ + gl_FragColor = texture2DRect(screenMap, gl_TexCoord[0].xy) * gl_Color; +} diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl new file mode 100644 index 0000000000..085970f549 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl @@ -0,0 +1,36 @@ +/** + * @file splattexturerectV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +attribute vec3 position; +attribute vec2 texcoord0; +attribute vec4 diffuse_color; + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = vec4(texcoord0,0,1); + gl_FrontColor = diffuse_color; +} + -- cgit v1.2.3 From 7821ff23baafff4e7712a126c17c3947e7b4989e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 27 Aug 2011 00:38:53 -0500 Subject: SH-2242 Physics shape display works again, added asserts to flush out areas where state being consumed by a shader does not match state being provided by vertex buffers. --- indra/newview/app_settings/shaders/class1/interface/highlightF.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index 4c0455502f..3a48205101 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -24,10 +24,10 @@ */ -uniform vec4 highlight_color; +uniform vec4 color; uniform sampler2D diffuseMap; void main() { - gl_FragColor = highlight_color*texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragColor = color*texture2D(diffuseMap, gl_TexCoord[0].xy); } -- cgit v1.2.3 From 530981a2149a74e1dc003cea1bbc9dc392fcae60 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 15 Sep 2011 00:54:25 -0500 Subject: SH-2243 work in progress -- no more deprecated built-in matrix state when using shaders. --- .../shaders/class1/interface/customalphaV.glsl | 6 +++-- .../shaders/class1/interface/debugV.glsl | 4 +++- .../shaders/class1/interface/glowcombineFXAAV.glsl | 26 +++++++++++++++++++--- .../shaders/class1/interface/glowcombineV.glsl | 6 +++-- .../shaders/class1/interface/highlightV.glsl | 9 +++++--- .../shaders/class1/interface/occlusionV.glsl | 4 +++- .../class1/interface/onetexturenocolorV.glsl | 21 ++++++++++++++++- .../shaders/class1/interface/solidcolorV.glsl | 4 +++- .../class1/interface/splattexturerectV.glsl | 6 +++-- .../shaders/class1/interface/twotextureaddV.glsl | 3 ++- .../app_settings/shaders/class1/interface/uiV.glsl | 8 ++++--- 11 files changed, 77 insertions(+), 20 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl index df67f76ad5..5bbc7deff0 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl @@ -22,7 +22,9 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; + attribute vec3 position; attribute vec4 diffuse_color; attribute vec2 texcoord0; @@ -30,7 +32,7 @@ attribute vec2 texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_TexCoord[0] = vec4(texcoord0,0,1); gl_FrontColor = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl index 2f64fdb7bc..cd3d090e52 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; + attribute vec3 position; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl index f54876135e..bd5dd6046b 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl @@ -1,17 +1,37 @@ /** * @file glowcombineFXAAV.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; + attribute vec3 position; varying vec2 vary_tc; void main() { - vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); + vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); gl_Position = pos; vary_tc = pos.xy*0.5+0.5; diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl index 303535ee31..94edbe5ab1 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl @@ -22,14 +22,16 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; + attribute vec3 position; attribute vec2 texcoord0; attribute vec2 texcoord1; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_TexCoord[0] = vec4(texcoord0,0,1); gl_TexCoord[1] = vec4(texcoord1,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl index 1d312313a8..6bb5affd93 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl @@ -22,14 +22,17 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + attribute vec3 position; attribute vec2 texcoord0; void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl index 62fe4a2ce5..43dcd5dbe2 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; + attribute vec3 position; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl index 7df45e90e6..615412c7a2 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl @@ -2,9 +2,28 @@ * @file onetexturenocolorV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec2 texcoord0; @@ -12,7 +31,7 @@ attribute vec2 texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1); + gl_Position = modelview_projection_matrix * vec4(position, 1); gl_TexCoord[0] = vec4(texcoord0,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl index be03d19290..45e6a9febc 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -22,6 +22,8 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec4 diffuse_color; @@ -29,7 +31,7 @@ attribute vec2 texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_FrontColor = diffuse_color; gl_TexCoord[0] = vec4(texcoord0,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl index 085970f549..2b471d99e8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl @@ -22,14 +22,16 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; + attribute vec3 position; attribute vec2 texcoord0; attribute vec4 diffuse_color; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_TexCoord[0] = vec4(texcoord0,0,1); gl_FrontColor = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl index 80c57e7766..2a36feaa21 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl @@ -23,6 +23,7 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec2 texcoord0; @@ -30,7 +31,7 @@ attribute vec2 texcoord1; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_TexCoord[0] = vec4(texcoord0,0,1); gl_TexCoord[1] = vec4(texcoord1,0,1); } diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl index faef21689e..a9e42a432f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl @@ -22,7 +22,9 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec4 diffuse_color; @@ -31,8 +33,8 @@ attribute vec2 texcoord0; void main() { - gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1); - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + gl_Position = modelview_projection_matrix * vec4(position, 1); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); gl_FrontColor = diffuse_color; } -- cgit v1.2.3 From da84f5552731e1ece3a463c4c385bb327f1048a1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 16 Sep 2011 12:40:53 -0500 Subject: SH-2243 work in progress -- don't use deprecated shader state --- .../shaders/class1/interface/customalphaF.glsl | 5 ++++- .../shaders/class1/interface/customalphaV.glsl | 12 ++++++----- .../shaders/class1/interface/debugV.glsl | 2 +- .../shaders/class1/interface/glowcombineF.glsl | 7 +++++-- .../shaders/class1/interface/glowcombineFXAAF.glsl | 22 ++++++++++++++++++-- .../shaders/class1/interface/glowcombineFXAAV.glsl | 4 ++-- .../shaders/class1/interface/glowcombineV.glsl | 13 +++++++----- .../shaders/class1/interface/highlightF.glsl | 4 +++- .../shaders/class1/interface/highlightV.glsl | 8 +++++--- .../shaders/class1/interface/occlusionV.glsl | 2 +- .../class1/interface/onetexturenocolorF.glsl | 24 ++++++++++++++++++++-- .../class1/interface/onetexturenocolorV.glsl | 7 ++++--- .../shaders/class1/interface/solidcolorF.glsl | 7 +++++-- .../shaders/class1/interface/solidcolorV.glsl | 13 +++++++----- .../class1/interface/splattexturerectF.glsl | 5 ++++- .../class1/interface/splattexturerectV.glsl | 13 +++++++----- .../shaders/class1/interface/twotextureaddF.glsl | 5 ++++- .../shaders/class1/interface/twotextureaddV.glsl | 13 +++++++----- .../app_settings/shaders/class1/interface/uiF.glsl | 5 ++++- .../app_settings/shaders/class1/interface/uiV.glsl | 12 ++++++----- 20 files changed, 130 insertions(+), 53 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index 27c63fdc8b..66f3e1ae11 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -27,9 +27,12 @@ uniform sampler2D diffuseMap; uniform float custom_alpha; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void main() { - vec4 color = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); color.a *= custom_alpha; gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl index 5bbc7deff0..890474d6d8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl @@ -25,15 +25,17 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec4 diffuse_color; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = vec4(texcoord0,0,1); - gl_FrontColor = diffuse_color; + vary_texcoord0 = texcoord0; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/debugV.glsl b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl index cd3d090e52..f4d704577a 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; +ATTRIBUTE vec3 position; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index b8963e1dec..caff5fc324 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -28,8 +28,11 @@ uniform sampler2D glowMap; uniform sampler2DRect screenMap; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; + void main() { - gl_FragColor = texture2D(glowMap, gl_TexCoord[0].xy) + - texture2DRect(screenMap, gl_TexCoord[1].xy); + gl_FragColor = texture2D(glowMap, vary_texcoord0.xy) + + texture2DRect(screenMap, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index 6639f88047..3e972f0cb4 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -1,7 +1,25 @@ /** * @file glowcombineFXAAF.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -11,7 +29,7 @@ uniform sampler2D glowMap; uniform sampler2DRect screenMap; uniform vec2 screen_res; -varying vec2 vary_tc; +VARYING vec2 vary_tc; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl index bd5dd6046b..058f3b1b82 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl @@ -25,9 +25,9 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; +ATTRIBUTE vec3 position; -varying vec2 vary_tc; +VARYING vec2 vary_tc; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl index 94edbe5ab1..f7970b7f78 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl @@ -25,14 +25,17 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; -attribute vec2 texcoord1; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; void main() { gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = vec4(texcoord0,0,1); - gl_TexCoord[1] = vec4(texcoord1,0,1); + vary_texcoord0 = texcoord0; + vary_texcoord1 = texcoord1; } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index 3a48205101..1d37b97bf1 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -27,7 +27,9 @@ uniform vec4 color; uniform sampler2D diffuseMap; +VARYING vec2 vary_texcoord0; + void main() { - gl_FragColor = color*texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl index 6bb5affd93..9bf7b60eb7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl @@ -26,13 +26,15 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; + +VARYING vec2 vary_texcoord0; void main() { //transform vertex gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; } diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl index 43dcd5dbe2..c26fa08ddc 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; +ATTRIBUTE vec3 position; void main() { diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl index a5442c9bf4..d860106305 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -1,13 +1,33 @@ /** * @file onetexturenocolorF.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ uniform sampler2D tex0; +VARYING vec2 vary_texcoord0; + void main() { - gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy); + gl_FragColor = texture2D(tex0, vary_texcoord0.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl index 615412c7a2..6b9986c8d7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl @@ -25,13 +25,14 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +VARYING vec2 vary_texcoord0; void main() { gl_Position = modelview_projection_matrix * vec4(position, 1); - gl_TexCoord[0] = vec4(texcoord0,0,1); + vary_texcoord0 = texcoord0; } diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index b1d2b949ac..a25c9a08fb 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -25,9 +25,12 @@ uniform sampler2D tex0; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void main() { - float alpha = texture2D(tex0, gl_TexCoord[0].xy).a * gl_Color.a; + float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a; - gl_FragColor = vec4(gl_Color.rgb, alpha); + gl_FragColor = vec4(vertex_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 45e6a9febc..c58f9dfdaf 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -25,14 +25,17 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec4 diffuse_color; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_FrontColor = diffuse_color; - gl_TexCoord[0] = vec4(texcoord0,0,1); + vertex_color = diffuse_color; + vary_texcoord0 = texcoord0; } diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index c263f4dc6a..9a295ce9f2 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -27,7 +27,10 @@ uniform sampler2DRect screenMap; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void main() { - gl_FragColor = texture2DRect(screenMap, gl_TexCoord[0].xy) * gl_Color; + gl_FragColor = texture2DRect(screenMap, vary_texcoord0.xy) * vertex_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl index 2b471d99e8..641d670c26 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl @@ -25,14 +25,17 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; -attribute vec4 diffuse_color; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec4 diffuse_color; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = vec4(texcoord0,0,1); - gl_FrontColor = diffuse_color; + vary_texcoord0 = texcoord0; + vertex_color = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl index 3408cc44f8..3ded949943 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -26,7 +26,10 @@ uniform sampler2D tex0; uniform sampler2D tex1; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; + void main() { - gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy)+texture2D(tex1, gl_TexCoord[1].xy); + gl_FragColor = texture2D(tex0, vary_texcoord0.xy)+texture2D(tex1, vary_texcoord1.xy); } diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl index 2a36feaa21..3c2f297f7f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl @@ -25,14 +25,17 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; -attribute vec2 texcoord1; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; void main() { gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = vec4(texcoord0,0,1); - gl_TexCoord[1] = vec4(texcoord1,0,1); + vary_texcoord0 = texcoord0; + vary_texcoord1 = texcoord1; } diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 7694056b08..2602e489c8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -25,7 +25,10 @@ uniform sampler2D diffuseMap; +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; + void main() { - gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); + gl_FragColor = vertex_color*texture2D(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 a9e42a432f..220dafef25 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl @@ -26,15 +26,17 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec4 diffuse_color; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; void main() { gl_Position = modelview_projection_matrix * vec4(position, 1); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); - gl_FrontColor = diffuse_color; + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vertex_color = diffuse_color; } -- cgit v1.2.3 From 8a1baaea6c0462b645499e8e7b88345e46b92621 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 16 Sep 2011 17:08:39 -0500 Subject: SH-2243 work in progress -- don't use gl_FragColor or gl_FragData for outputs -- no more deprecation warnings on nvidia --- .../newview/app_settings/shaders/class1/interface/customalphaF.glsl | 6 +++++- indra/newview/app_settings/shaders/class1/interface/debugF.glsl | 6 +++++- .../newview/app_settings/shaders/class1/interface/glowcombineF.glsl | 6 +++++- .../app_settings/shaders/class1/interface/glowcombineFXAAF.glsl | 4 ++++ indra/newview/app_settings/shaders/class1/interface/highlightF.glsl | 3 +++ indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl | 4 ++++ .../app_settings/shaders/class1/interface/onetexturenocolorF.glsl | 6 +++++- .../newview/app_settings/shaders/class1/interface/solidcolorF.glsl | 6 +++++- .../app_settings/shaders/class1/interface/splattexturerectF.glsl | 4 ++++ .../app_settings/shaders/class1/interface/twotextureaddF.glsl | 6 +++++- indra/newview/app_settings/shaders/class1/interface/uiF.glsl | 6 +++++- 11 files changed, 50 insertions(+), 7 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index 66f3e1ae11..765040a27f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2D diffuseMap; uniform float custom_alpha; diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl index d43bf3fb50..d89c7b0072 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform vec4 color; void main() diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index caff5fc324..8023545c4e 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + #extension GL_ARB_texture_rectangle : enable uniform sampler2D glowMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index 3e972f0cb4..57e9f93768 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -25,6 +25,10 @@ #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2D glowMap; uniform sampler2DRect screenMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index 1d37b97bf1..ce5409c816 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -23,6 +23,9 @@ * $/LicenseInfo$ */ +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif uniform vec4 color; uniform sampler2D diffuseMap; diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl index 57248699cb..5f91ce5e80 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -23,6 +23,10 @@ * $/LicenseInfo$ */ +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + void main() { gl_FragColor = vec4(1,1,1,1); diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl index d860106305..95b7632521 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2D tex0; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index a25c9a08fb..7ba2d07ca4 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2D tex0; VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index 9a295ce9f2..b085eb1760 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -25,6 +25,10 @@ #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2DRect screenMap; VARYING vec4 vertex_color; diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl index 3ded949943..9cbdfea2df 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2D tex0; uniform sampler2D tex1; diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 2602e489c8..0c5479af36 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2D diffuseMap; VARYING vec2 vary_texcoord0; -- cgit v1.2.3 From 9ea41c8094695365bc7ea10165ffd54cda204e88 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 20 Sep 2011 00:54:37 -0500 Subject: SH-2243 No deprecated calls for the whole session. --- .../shaders/class1/interface/alphamaskF.glsl | 47 ++++++++++++++++++++++ .../shaders/class1/interface/alphamaskV.glsl | 42 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl new file mode 100644 index 0000000000..433ecc9d2a --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -0,0 +1,47 @@ +/** + * @file alphamaskF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + +uniform sampler2D diffuseMap; + +uniform float minimum_alpha; +uniform float maximum_alpha; + +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; + +void main() +{ + vec4 col = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); + if (col.a < minimum_alpha || col.a > maximum_alpha) + { + discard; + } + + gl_FragColor = col; +} diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl new file mode 100644 index 0000000000..3580d1f27b --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskV.glsl @@ -0,0 +1,42 @@ +/** + * @file alphamaskV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 texture_matrix0; +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +void main() +{ + gl_Position = modelview_projection_matrix * vec4(position, 1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vertex_color = diffuse_color; +} + -- cgit v1.2.3 From 183fe0d14c48ebeb174567304cea197e7ea443fa Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 24 Sep 2011 03:09:32 -0500 Subject: SH-2244 Fix for shaders not compiling on pre-GL-3.0 ATI drivers --- indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/debugF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl | 2 +- .../newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/highlightF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl | 2 +- .../app_settings/shaders/class1/interface/onetexturenocolorF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl | 2 +- .../app_settings/shaders/class1/interface/splattexturerectF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/uiF.glsl | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index 433ecc9d2a..4f2767fc97 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index 765040a27f..4b481ba834 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl index d89c7b0072..6bcc97ba18 100644 --- a/indra/newview/app_settings/shaders/class1/interface/debugF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index 8023545c4e..f67703b839 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index 57e9f93768..7136d412ea 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index ce5409c816..ecbc30f05f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl index 5f91ce5e80..85f819f4c2 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl index 95b7632521..fafeb5a7b4 100644 --- a/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index 7ba2d07ca4..f790122749 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl index b085eb1760..a0bb255cfa 100644 --- a/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl index 9cbdfea2df..cdb48163dd 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl index 0c5479af36..36d6e06fc5 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif -- cgit v1.2.3 From 2179e1c1f2f3614678d528fe96640728ce663f2e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 2 Nov 2011 13:13:38 -0500 Subject: SH-2541 Fix for speckles on avatar on some cards -- don't use "maximum_alpha" for alpha tests in shaders as it was always being set to 1.0 anyway. --- indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl index 4f2767fc97..d2f5e1987a 100644 --- a/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -30,7 +30,6 @@ out vec4 gl_FragColor; uniform sampler2D diffuseMap; uniform float minimum_alpha; -uniform float maximum_alpha; VARYING vec2 vary_texcoord0; VARYING vec4 vertex_color; @@ -38,7 +37,7 @@ VARYING vec4 vertex_color; void main() { vec4 col = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); - if (col.a < minimum_alpha || col.a > maximum_alpha) + if (col.a < minimum_alpha) { discard; } -- cgit v1.2.3 From a6e40e6e02600cb47299dc9903400720786f72f0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 7 Nov 2011 12:34:05 -0600 Subject: SH-2652 Slightly slower DoF (quality), apply FXAA *after* DoF, fix for some render targets not getting allocated when needed. --- .../app_settings/shaders/class1/interface/glowcombineFXAAF.glsl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl index 7136d412ea..c66a6e5b48 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -29,17 +29,14 @@ out vec4 gl_FragColor; #endif -uniform sampler2D glowMap; -uniform sampler2DRect screenMap; +uniform sampler2DRect diffuseRect; uniform vec2 screen_res; VARYING vec2 vary_tc; void main() { - vec3 col = texture2D(glowMap, vary_tc).rgb + - texture2DRect(screenMap, vary_tc*screen_res).rgb; - + vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb; gl_FragColor = vec4(col.rgb, dot(col.rgb, vec3(0.299, 0.587, 0.144))); } -- cgit v1.2.3 From 1bd09e2e42fbde3f00be2577b719bd172b4c9496 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 7 Nov 2011 16:46:58 -0600 Subject: SH-2634 Fix for land overlay not showing colors --- indra/newview/app_settings/shaders/class1/interface/highlightF.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/interface') diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl index ecbc30f05f..574adeb50c 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -27,12 +27,12 @@ out vec4 gl_FragColor; #endif -uniform vec4 color; +uniform vec4 highlight_color; uniform sampler2D diffuseMap; VARYING vec2 vary_texcoord0; void main() { - gl_FragColor = color*texture2D(diffuseMap, vary_texcoord0.xy); + gl_FragColor = highlight_color*texture2D(diffuseMap, vary_texcoord0.xy); } -- cgit v1.2.3