diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/interface')
24 files changed, 547 insertions, 49 deletions
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..f520f301d9 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/alphamaskF.glsl @@ -0,0 +1,48 @@ +/**  + * @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$ + */ + +#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; + +void main()  +{ +	vec4 col = vertex_color*texture2D(diffuseMap, vary_texcoord0.xy); +	if (col.a < minimum_alpha) +	{ +		discard; +	} + +	frag_color = 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; +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl index 27c63fdc8b..a96d04cc39 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -22,14 +22,23 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ -  + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif +  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; +	frag_color = color;  } diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl index c4c896c35c..890474d6d8 100644 --- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl @@ -22,13 +22,20 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ -  +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0;  void main()  { -	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -	gl_TexCoord[0] = gl_MultiTexCoord0; -	gl_FrontColor = gl_Color; +	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +	vary_texcoord0 = texcoord0; +	vertex_color = diffuse_color;  } 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..67c6baddbb --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/debugF.glsl @@ -0,0 +1,37 @@ +/**  + * @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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform vec4 color; + +void main()  +{ +	frag_color = 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..f4d704577a --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/debugV.glsl @@ -0,0 +1,34 @@ +/**  + * @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$ + */ + +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; + +void main() +{ +	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index b8963e1dec..ed803de277 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -22,14 +22,23 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ -  + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif +  #extension GL_ARB_texture_rectangle : enable  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); +	frag_color = 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 new file mode 100644 index 0000000000..59520bb99f --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAF.glsl @@ -0,0 +1,44 @@ +/**  + * @file glowcombineFXAAF.glsl + * + * $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$ + */ +  +#extension GL_ARB_texture_rectangle : enable + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform sampler2DRect diffuseRect; + +uniform vec2 screen_res; +VARYING vec2 vary_tc; + +void main()  +{ +	vec3 col = texture2DRect(diffuseRect, vary_tc*screen_res).rgb; +	 +	frag_color = 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..058f3b1b82 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineFXAAV.glsl @@ -0,0 +1,39 @@ +/**  + * @file glowcombineFXAAV.glsl + * +  * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + *  + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + *  + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU + * Lesser General Public License for more details. + *  + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA + *  + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA + * $/LicenseInfo$ + */ + +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; + +VARYING vec2 vary_tc; + +void main() +{ +	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 4c6360f71d..f7970b7f78 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl @@ -22,12 +22,20 @@   * 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; + +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1;  void main()  { -	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -	gl_TexCoord[0] = gl_MultiTexCoord0; -	gl_TexCoord[1] = gl_MultiTexCoord1; +	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +	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 a3cb5225ba..6cc9bbbea2 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl @@ -23,11 +23,18 @@   * $/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; +  void main()   { -	gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); +	frag_color = 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 da3bea6d06..9bf7b60eb7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl @@ -22,24 +22,19 @@   * 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; + +VARYING vec2 vary_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 = modelview_projection_matrix * vec4(position.xyz, 1.0); +	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;  } diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl index 57248699cb..db130e456c 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -23,7 +23,13 @@   * $/LicenseInfo$   */ +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif +  void main()   { -	gl_FragColor = vec4(1,1,1,1); +	frag_color = vec4(1,1,1,1);  } diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl index 915e452e0f..c26fa08ddc 100644 --- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl @@ -23,8 +23,12 @@   * $/LicenseInfo$   */ +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; +  void main()  { -	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);  } 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..415181126b --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorF.glsl @@ -0,0 +1,39 @@ +/**  + * @file onetexturenocolorF.glsl + * + * $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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform sampler2D tex0; + +VARYING vec2 vary_texcoord0; + +void main()  +{ +	frag_color = 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 new file mode 100644 index 0000000000..6b9986c8d7 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/onetexturenocolorV.glsl @@ -0,0 +1,38 @@ +/**  + * @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; + +VARYING vec2 vary_texcoord0; + +void main() +{ +	gl_Position = modelview_projection_matrix * vec4(position, 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..67dc500493 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -22,12 +22,21 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ -  + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif +  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); +	frag_color = 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 fedf6ae546..c58f9dfdaf 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -22,13 +22,20 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ + +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0;  void main()  { -	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -	gl_FrontColor = gl_Color; -	gl_TexCoord[0] = gl_MultiTexCoord0; +	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +	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 new file mode 100644 index 0000000000..772bb374e8 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectF.glsl @@ -0,0 +1,42 @@ +/**  + * @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 + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform sampler2DRect screenMap; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +void main()  +{ +	frag_color = 	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 new file mode 100644 index 0000000000..641d670c26 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/splattexturerectV.glsl @@ -0,0 +1,41 @@ +/**  + * @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$ + */ + +uniform mat4 modelview_projection_matrix; + +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); +	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..95679e93e7 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -22,11 +22,20 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ -  + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif +  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); +	frag_color = 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 94aa964be6..3c2f297f7f 100644 --- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl @@ -23,12 +23,19 @@   * $/LicenseInfo$   */ +uniform mat4 modelview_projection_matrix; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1;  void main()  { -	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -	gl_TexCoord[0] = gl_MultiTexCoord0; -	gl_TexCoord[1] = gl_MultiTexCoord1; +	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +	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..299bfb72aa 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -22,10 +22,19 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/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; +  void main()   { -	gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); +	frag_color = 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 b1b90d0b5e..220dafef25 100644 --- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl @@ -22,13 +22,21 @@   * 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 = gl_ModelViewProjectionMatrix * gl_Vertex; -	gl_TexCoord[0] = gl_MultiTexCoord0; -	gl_FrontColor = gl_Color; +	gl_Position = modelview_projection_matrix * vec4(position, 1); +	vary_texcoord0 =  (texture_matrix0 * vec4(texcoord0,0,1)).xy; +	vertex_color = diffuse_color;  }  | 
