diff options
| author | ruslantproductengine <ruslantproductengine@lindenlab.com> | 2016-05-13 18:47:23 +0300 | 
|---|---|---|
| committer | ruslantproductengine <ruslantproductengine@lindenlab.com> | 2016-05-13 18:47:23 +0300 | 
| commit | 1b5af4be298198cedc407b6b294b2d71129d7731 (patch) | |
| tree | 0fdc088875470a70c684da2ef7fea1055775b203 /indra/newview/app_settings/shaders | |
| parent | bceafa5062db394048312aa7fe0a7706fb9524b7 (diff) | |
Add invert texture coordinates for media textures.
Diffstat (limited to 'indra/newview/app_settings/shaders')
4 files changed, 46 insertions, 1 deletions
| diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl index 3c026796c8..7e83389f6e 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl @@ -26,6 +26,13 @@  uniform mat3 normal_matrix;  uniform mat4 texture_matrix0;  uniform mat4 modelview_projection_matrix; +uniform bool invert_tex_y = false; +const mat4 invTexM = mat4( +  1, 0, 0, 0, +  0,-1, 0, 0, +  0, 0, 1, 0, +  0, 0, 0, 1 +);   ATTRIBUTE vec3 position;  ATTRIBUTE vec4 diffuse_color; @@ -44,6 +51,10 @@ void main()  	//transform vertex  	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);   	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; +  if(invert_tex_y)  +	{ +		vary_texcoord0 = vec2(invTexM * vec4(vary_texcoord0,0,1)).xy; +	}  	passTextureIndex();  	vary_normal = normalize(normal_matrix * normal); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl index 8e899e3e0f..2595712882 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl @@ -26,6 +26,13 @@  uniform mat4 texture_matrix0;  uniform mat4 modelview_matrix;  uniform mat4 modelview_projection_matrix; +uniform bool invert_tex_y = false; +const mat4 invTexM = mat4( +  1, 0, 0, 0, +  0,-1, 0, 0, +  0, 0, 1, 0, +  0, 0, 0, 1 +);  ATTRIBUTE vec3 position; @@ -62,6 +69,10 @@ void main()  #endif  	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; +  if(invert_tex_y)  +	{ +		vary_texcoord0 = vec2(invTexM * vec4(vary_texcoord0,0,1)).xy; +	}  	calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl index fc20d3270e..a8efcd9857 100755 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl @@ -26,6 +26,14 @@  uniform mat4 texture_matrix0;  uniform mat4 modelview_matrix;  uniform mat4 modelview_projection_matrix; + +uniform bool invert_tex_y = false; +const mat4 invTexM = mat4( +  1, 0, 0, 0, +  0,-1, 0, 0, +  0, 0, 1, 0, +  0, 0, 0, 1 +);  ATTRIBUTE vec3 position;  void passTextureIndex(); @@ -49,6 +57,11 @@ void main()  	vec4 pos = (modelview_matrix * vert);  	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);  	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; +   +  if(invert_tex_y)  +	{ +		vary_texcoord0 = vec2(invTexM * vec4(vary_texcoord0,0,1)).xy; +	}  	calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index 37a20383e2..c744dc1397 100755 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -27,6 +27,13 @@ uniform mat3 normal_matrix;  uniform mat4 texture_matrix0;  uniform mat4 modelview_matrix;  uniform mat4 modelview_projection_matrix; +uniform bool invert_tex_y = false; +const mat4 invTexM = mat4( +  1, 0, 0, 0, +  0,-1, 0, 0, +  0, 0, 1, 0, +  0, 0, 0, 1 +);   ATTRIBUTE vec3 position;  void passTextureIndex(); @@ -51,7 +58,10 @@ void main()  	gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);  	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; -	 +	if(invert_tex_y)  +	{ +		vary_texcoord0 = vec2(invTexM * vec4(vary_texcoord0,0,1)).xy; +	}  	vec3 norm = normalize(normal_matrix * normal); | 
